The Particles class

A Simulation object may contain several particle species. Each species is represented by an instance of the Particles class, and is stored in the list Simulation.ptcl.

Note

It is not recommended to initialize a Particles object directly. Instead, use the method Simulation.add_new_species. This will append a new instance of Particles to the list Simulation.ptcl. This new instance will also be directly returned by the function, so that you can use its methods below.

class fbpic.particles.Particles

An instance of Particles stores a set of macroparticles that have the same charge and mass. (Note that for ionizable species, ions in different states of ionization - i.e. different levels - are stored in the same Particles object.)

Particles.track(comm)

Activate particle tracking for the current species (i.e. allocates an array of unique IDs for each macroparticle; these IDs are written in the openPMD file)

Parameters:

comm (an fbpic.BoundaryCommunicator object) – Contains information about the number of processors

Particles.make_ionizable(element, target_species, level_start=0, level_max=None)

Make this species ionizable.

The implemented ionization model is the ADK model (using the instantaneous electric field, i.e. without averaging over the laser period).

The expression of the ionization rate can be found in Chen, JCP 236 (2013), equation 2.

Note that the implementation in FBPIC evaluates this ionization rate in the reference frame of each macroparticle, and is thus valid in lab-frame simulations as well as boosted-frame simulation.

Parameters:
  • element (string) – The atomic symbol of the considered ionizable species (e.g. ‘He’, ‘N’ ; do not use ‘Helium’ or ‘Nitrogen’)

  • target_species (a Particles object, or a dictionary of Particles) – Stores the electron macroparticles that are created in the ionization process. If a single Particles object is passed, then electrons from all ionization levels are stored into this object. If a dictionary is passed, then its keys should be integers (corresponding to the ionizable levels of element, starting at level_start), and its values should be Particles objects. In this case, the electrons from each distinct ionizable level will be stored into these separate objects. Note that using separate objects will typically require longer computing time.

  • level_start (int) – The ionization level at which the macroparticles are initially (e.g. 0 for initially neutral atoms)

  • level_max (int, optional) – If not None, defines the maximum ionization level that macroparticles can reach. Should not exceed the physical limit for the chosen element.

Particles.activate_spin_tracking(sx_m=0.0, sy_m=0.0, sz_m=1.0, anom=0.00115965218128, spin_distr='fixed')

Activate spin tracking for this particle. This will enable calculating the evolution of particle spin vector throughout the simulation.

\[\frac{d\boldsymbol{s}}{dt} = (\boldsymbol{\Omega}_T + \boldsymbol{\Omega}_a) \times \boldsymbol{s}\]

where

\[\boldsymbol{\Omega}_T = \frac{q}{m}\left( \frac{\boldsymbol{B}}{\gamma} - \frac{\boldsymbol{B}}{1+\gamma} \times \frac{\boldsymbol{E}}{c} \right)\]

and

\[\boldsymbol{\Omega}_a = a_e \frac{q}{m}\left( \boldsymbol{B} - \frac{\gamma}{1+\gamma}\boldsymbol{\beta} (\boldsymbol{\beta}\cdot\boldsymbol{B}) - \boldsymbol{\beta} \times \frac{\boldsymbol{E}}{c} \right)\]

Here, \(a_e\) is the anomalous magnetic moment of the particle, \(\gamma\) is the Lorentz factor of the particle, \(\boldsymbol{\beta}=\boldsymbol{v}/c\) is the normalised velocity

The implementation of the push algorithm is detailed in https://arxiv.org/abs/2303.16966.

Note: spin tracking must be activated _before_ making a species ionizable, otherwise an error will be raised.

Parameters:
  • sx_m (float (dimensionless), optional) – The species-averaged average projection onto the x-axis

  • sy_m (float (dimensionless), optional) – The species-averaged average projection onto the y-axis

  • sz_m (float (dimensionless), optional) – The species-averaged average projection onto the z-axis

  • anom (float) – The anomalous magnetic moment of the particle. Default value is that of an electron.

  • spin_distr (str, optional) – If ‘fixed’, all particles will have a fixed spin value equal to s{x,y,z}_m. If ‘rand’, the spin vectors will be random, but with an ensemble average defined by one of the values of s{x,y,z}_m. The first non-zero mean component will be used, with order of preference being x,y,z, ie if sx_m!=0, the generated spins will have an ensemble averages of <sx>=sx_m, <sy>=0, <sz>=0, or if sz_m!=0, <sx>=0, <sy>=0 and <sz>=sz_m.