Electron Cloud (ElectronCloud)
ElectronCloud provides three modes:
frozenapplies a transverse thin kick from a prescribed stationary uniform electron disk. Its field is analytic in free space or calculated once from sampled macro electrons with a PIC solver.build_uptracks electrons driven by prescribed beam slices and external magnetic fields. Electron self-fields, multiple primary sources, multichannel surface emission and additional chamber geometries are optional. It applies no beam kick.coupledadds electron-cloud PIC self-fields and a transverse beam kick. The actual saved beam-slice particles drive the electrons in a grounded chamber with a common geometry for wall events and field boundaries.
The default build_up model retains the externally driven, dilute-cloud
approximation. Set Build up.Electron self fields=true to include cloud
space charge. coupled always includes it. These are quasistatic transverse
models; numerical convergence alone does not validate measured instability
thresholds or equilibrium densities. See Electron-cloud models and response workflows for the
optional physical models, response extraction, replay and analysis.
Configuration and execution
Enable the top-level Electron cloud block and define named configurations.
Each ElectronCloud sequence command selects a configuration and supplies
its own Interaction length (m). The command does not transport particles
over that length. Insert actual transport commands separately. In build_up
this required field is retained for API compatibility but does not change
electron dynamics, because no beam feedback is applied.
In frozen, no Slicer is required: the prescribed field is independent of longitudinal
position and time. The command leaves z_rel, dp, bunch.t0 and the
reference energy unchanged. In build_up, the command requires a current
z_rel SliceSet and leaves all beam particle coordinates unchanged.
coupled also requires that SliceSet and changes only px and py.
See Injection / Particle Generation for the coordinate convention.
The configured density prescribes the frozen cloud or initializes the dynamic
cloud; dynamic modes also accept an explicit initial electron line density.
Neither intensity is inferred from beam intensity or bunch grouping.
The following is an input fragment; injection and transport must also be supplied:
{
"Electron cloud": {
"Enabled": true,
"Configurations": {
"round_cloud": {
"Mode": "frozen",
"Solver": "uniform_round_free_space",
"Electron density (1/m^3)": 1e12,
"Radius (m)": 0.01,
"Center X (m)": 0.0,
"Center Y (m)": 0.0
}
}
},
"Sequence": {
"cloud_at_ip": {
"Command": "ElectronCloud",
"S (m)": 10.0,
"Configuration": "round_cloud",
"Interaction length (m)": 1.0,
"Save fields": true,
"Save turns": [[0]]
}
}
}
Python input generation uses ElectronCloudConfig,
ElectronCloudConfiguration and ElectronCloudItem from
PASS.para.schema.electron_cloud. Pass the top-level model to
generate_input(..., electron_cloud=cloud_config). Configuration names are
case-sensitive; each command owns its own cloud state and resources.
The same explicit random seed gives the same initial macro-electron
sample for equal source parameters. An omitted seed or JSON null is
nondeterministic. Booleans and fractional values are not valid integer seeds.
Configuration parameters
The top-level block contains Enabled (boolean, default false) and
Configurations (mapping of names to the following configuration objects).
Disabling the block skips its configurations and all electron-cloud actions.
JSON key / Python field |
Default |
Meaning |
|---|---|---|
|
|
|
|
|
Frozen: analytic free space or |
|
Required |
Nonnegative physical electron number density inside the disk. Dynamic non-disk distributions use it as the equivalent reference-disk density; set it to zero when specifying an initial electron line density. |
|
Required |
Positive uniform-disk radius, or reference radius for the default dynamic total-electron normalization. It is not a Gaussian RMS size; it remains required but does not set the size of non-disk distributions. |
|
|
Transverse cloud center, in metres. |
|
|
Positive integer source sample size for frozen PIC or the initial dynamic cloud. It does not alter physical density. |
|
|
Integer or |
|
|
Grid point counts, integers at least 3; dynamic PIC requires odd counts of at least 5. |
|
|
Full positive widths of the grid, centered at the origin. |
|
|
|
|
|
Field and wall geometry. Dynamic modes accept circle, ellipse, rectangle, racetrack and polygon; |
|
|
Required nested |
The grid and deposition fields apply to frozen PIC, frozen field diagnostics,
coupled PIC and build-up with self-fields, a prescribed Beam driver or a
noncircular chamber. The mesh must cover and resolve the complete chamber.
For a legacy circular chamber, each spacing must be at most half its radius.
This is a minimum resolvability check, not a convergence criterion. Explicit
Aperture type/value defines the wall; default/off uses
Build up.Chamber radius (m).
JSON key / Python field |
Default |
Meaning |
|---|---|---|
|
|
Thin-kick location in the sequence. |
|
|
Optional integer order at the same position, following the shared sequence rules. |
|
Required |
Name in this beam’s |
|
Required |
Nonnegative represented machine length for frozen/coupled beam kicks. Build-up dynamics are independent of this value. |
|
|
Required current |
|
|
Per-command switch. |
|
|
Save frozen fields, or dynamic particle state/history at selected turns. Coupled output also contains the final cloud fields. |
|
|
|
All numeric configuration values must be finite. Unknown electron-cloud fields are rejected, so unsupported dynamic-model parameters cannot silently enable physics that is absent.
Frozen-cloud field and momentum conventions
Let \(n_e\ge0\) be the electron density, \(e>0\) the elementary charge, \(\rho_e=-e n_e\), \(a\) the cloud radius and \(\boldsymbol r=(x-x_c,y-y_c)\). Gauss’s law for an infinitely long, uniform charged cylinder gives
The field is zero at the center and points toward it. The analytic field includes the exterior \(1/r\) radial dependence. A convenient potential reference is \(\phi(a)=0\):
Free-space two-dimensional potentials have an arbitrary additive constant; this choice does not affect the kick.
PASS stores normalized transverse mechanical momenta \(p_x=P_x/P_0\) and \(p_y=P_y/P_0\). Under the small-angle, reference-speed thin-kick approximation, the command applies
Here \(q_b\) is signed and \(P_0\) is the full particle reference momentum in SI units. Internally the equivalent factor is \(\operatorname{sign}(q_b)L_{\mathrm{int}}/(\beta_0 c B\rho)\) with positive \(B\rho=P_0/|q_b|\), including the ion charge-to-mass normalization. The resulting kick focuses positively charged particles and defocuses electrons near the cloud center.
There is no \(1/\gamma_0^2\) factor: the stationary electron cloud has no prescribed longitudinal current whose magnetic force cancels its electric force. That cancellation belongs to the co-moving self-field model in Space-Charge Effect (SpaceCharge). This is not a full six-dimensional electromagnetic integrator: longitudinal electric fields, cloud magnetic fields, energy work, and corrections for individual-particle speed are outside the approximation.
PIC normalization and boundary conditions
PIC samples uniformly in disk area, with equal nonnegative electron-number weights. Using an internal source length \(L_s=1\,\mathrm{m}\) and \(N_m\) samples,
The shared PIC solver deposits these signed charges and returns the integrated
density \(\widetilde\rho\) in C/m2, potential
\(\widetilde\phi\) in V m and fields \(\widetilde E_x,\widetilde E_y\)
in V. ElectronCloud divides them by \(L_s\) to obtain C/m3, V
and V/m. Only the final beam kick multiplies by the separate machine length
\(L_{\mathrm{int}}\). Neither length is a longitudinal slice width.
fft_free_space uses open-boundary fields. fd_dirichlet supports the
conducting geometries of Transverse Field Solvers; dst_dirichlet requires the
full grid-aligned rectangle, using default or a matching rectangular
aperture. Dirichlet solvers impose zero wall potential and require a finite
aperture. Their result generally differs physically from the free-space
analytic cylinder. FD and DST can be compared directly only on the same
rectangular domain with identical deposited charge.
For frozen PIC, the complete source disk and deposition support must fit within the supported field domain; the command rejects invalid geometry instead of clipping electron charge. The aperture configures the field domain rather than a particle-loss operation. Use transport-element Aperture settings for beam losses. Free-space analytic evaluation includes points outside the source disk. PIC evaluation requires particles to lie in its supported interpolation domain; it does not substitute a zero field for out-of-grid particles.
Nonconvex polygon source containment is checked against the continuous edges, including concave features smaller than a grid cell. For a nonconvex racetrack with unequal rectangle and end-cap heights, source containment uses an inner polygon with 128 segments per curved end. This conservative check can reject a source extremely close to a curved wall; move the source inward in that case.
Dynamic models and physical time
Set Mode="build_up", Solver="round_gaussian_beam" and provide a
Build up object. For coupled PIC instead select Mode="coupled" and
Solver="fd_dirichlet" with the same nested object.
By default the top-level electron density, disk radius and center describe a
uniform initial disk that must lie strictly inside the selected chamber.
Initial directions are isotropic in three dimensions, with the specified
monoenergetic kinetic energy. The optional initial position and velocity
distributions below apply to both dynamic modes. Zero initial intensity is
allowed; primary sources can subsequently create electrons.
from PASS.para.schema.electron_cloud import (
ElectronCloudBuildUpConfiguration, ElectronCloudConfiguration,
)
model = ElectronCloudConfiguration(
mode="build_up", solver="round_gaussian_beam",
electron_density=1e8, radius=0.01, n_macroparticles=512,
random_seed=20260926,
buildup=ElectronCloudBuildUpConfiguration(
chamber_radius=0.02, beam_sigma=0.002, max_time_step=5e-11,
primary_electrons_per_particle_per_m=1e-6,
secondary_yield_max=1.5,
),
)
JSON key / Python field |
Default |
Meaning |
|---|---|---|
|
|
Positive circular wall radius for default/off aperture. Required in that case; omit for explicit noncircular geometry. |
|
|
Positive round Gaussian sigma, required in build-up without Beam driver. Optional and unused in coupled mode. |
|
Required |
Positive integration-step ceiling; the pusher may shorten it further. |
|
|
Uniform part |
|
|
Signed finite normal-quadrupole gradient; Boolean values are rejected. |
|
|
Nonnegative kinetic energy per electron for the default monoenergetic velocity distribution; must be zero for uniform/Gaussian velocities. |
|
|
|
|
|
Required positive |
|
|
Optional nonnegative total real electrons per metre, after chamber truncation. Requires top-level Electron density = 0; null retains the reference-disk normalization. |
|
|
Isotropic fixed-energy directions, independent uniform components, or independent Gaussian components: |
|
|
Required nonnegative |
|
|
Nonnegative prescribed primary yield per real beam particle per metre. |
|
|
Positive integer samples created at each nonzero primary-emission event. |
|
|
Nonnegative peak of the uncapped true-secondary yield curve; zero is an absorbing wall. |
|
|
Positive incident energy at the uncapped yield maximum. |
|
|
Yield-curve shape parameter, strictly greater than one. |
|
|
Positive primary emission energy and nominal secondary emission energy. |
|
|
Positive integer population limit; exceeding it raises an error instead of discarding charge. |
|
|
Positive integer integration-step limit per physical interval. |
|
|
Positive integer per-particle wall-event limit within one integration step. |
Initial distributions and normalization
uniform_chamber samples the full selected chamber uniformly in area and
requires zero top-level center coordinates. uniform_rectangle samples the
intersection of the rectangle centered at Center X/Y and the chamber.
gaussian samples independent normal coordinates around that center,
conditioned on lying inside the chamber. Rejection sampling retains the requested
number of macro electrons and total weight: it does not discard charge in the
tails. Consequently the mean and RMS of a clipped Gaussian can differ from its
input center and spread. Only uniform_disk uses Radius as a spatial size.
Sampling is bounded: a zero-area intersection or insufficient acceptance within
the sampling limit raises an error rather than hanging or dropping particles.
Let \(a\) be the top-level reference radius and \(n_e\) its electron
density. Unless Initial electron line density is specified, all four
distributions retain \(N_e/L_s=n_e\pi a^2\). For non-disk distributions,
\(n_e\) is an equivalent reference-disk density, not the local or peak density.
Specifying the line density directly decouples total charge from \(a\) and
requires \(n_e=0\) to avoid two conflicting intensity inputs. The initial
source length is \(L_s=1\,\mathrm m\), and every macro electron has weight
\(N_e/N_{\mathrm{macro}}\). Zero total intensity creates an empty state.
Uniform velocities have independent zero-mean components in \([-w_i,w_i]\), hence \(\langle v_i^2\rangle=w_i^2/3\), and their maximum combined speed must be strictly below \(c\). Gaussian velocities have zero-mean components with configured standard deviations, conditioned on \(|\boldsymbol v|<c\). This is a specified velocity distribution, not a relativistic thermal equilibrium distribution. Both are converted exactly to \(\boldsymbol u=\gamma\boldsymbol v/c\); the initial energy ledger uses the actual sampled relativistic kinetic energies. No sample-mean subtraction or RMS rescaling is applied. Set a spread component to zero to obtain, for example, zero longitudinal velocity. Gaussian velocity configurations with too little subluminal probability are likewise rejected when the bounded sampler cannot fill the requested population.
For an elliptical Gaussian cloud with independent transverse Gaussian velocities:
model = ElectronCloudConfiguration(
mode="build_up", solver="round_gaussian_beam",
electron_density=0, radius=0.01, n_macroparticles=10000,
center_x=0.001, random_seed=42,
buildup=ElectronCloudBuildUpConfiguration(
chamber_radius=0.02, beam_sigma=0.002, max_time_step=5e-11,
initial_distribution="gaussian",
initial_position_spread=[0.003, 0.002],
initial_line_density=1e6,
initial_velocity_distribution="gaussian",
initial_velocity_spread=[2e5, 1e5, 0.0],
),
)
Initialization uses the same host PCG64 sampling on CPU and GPU before the one-time transfer to the selected backend. The legacy disk/monoenergetic defaults retain their existing random sequence. This adds no work to the tracking loop.
Slice timing
Execute the selected Slicer at the same position and turn before the
cloud. Only continuous z_rel intervals are supported; complete live-particle
coverage and positive occupied-bin widths are required. Zero-width empty bins
are skipped. The saved Slicer memberships and
intervals are consumed without silently recomputing or rescaling them.
For interval \([z_{\min},z_{\max}]\), the physical passage interval is
The driver sorts intervals from all bunches by these times. Intervals may
touch but may not overlap; repeated turns and backwards physical time are
rejected. Empty bins still advance the cloud with zero beam field. Gaps also
advance electron motion, external-field effects and wall events.
Endpoint roundoff tolerance is bounded by the smaller of eight absolute-time
ULPs and \(10^{-12}\) times the shorter slice duration. If subtracting
absolute endpoints changes a saved slice duration by more than \(10^{-6}\)
relative to \(\Delta z/(\beta_0c)\), execution is rejected. This prevents
large absolute clocks from silently erasing short bunch pulses.
The first interval or observation point establishes the initial cloud time,
including negative times; no unspecified earlier history is invented. Each
command call ends at the last saved bin’s trailing edge or later observation
point, not automatically at the end of the ring period. The following call
advances the intervening gap. Slots without live source particles retain
explicit empty intervals. With an auto range, they contribute only a
zero-charge observation at bunch.t0; the tiny fallback slice width is not a
physical pulse. This also applies when allocated records are all lost or pending
injection: those records and their statistics remain present, but they cannot
define an automatic pulse width. Observation points already covered by a real
interval do not cause another advance. Lost or reserved records retain normal
slicing; this rule only changes their zero-charge electron-cloud time projection.
Reference time advances through transport commands, not through the executor’s
turn counter. Multi-turn input therefore needs an actual closed transport path.
Use bunch.t0 and saved intervals for timing, never nominal z_center or
harmonic_id as a substitute for physical passage time.
Prescribed drive and electron integration
In legacy build_up without Beam driver, during each slice the transverse source is a fixed, axis-centered round
Gaussian truncated at chamber radius \(R\), with configured sigma
\(\sigma_b\). The current slice population sets its signed line charge;
tracked transverse beam coordinates do not change its center or size.
For \(0<r<R\),
The center uses the continuous linear limit. The denominator ensures that
lambda_b is the line charge contained within the chamber. Axial symmetry
makes the grounded circular wall affect the electrostatic potential reference,
not the radial electric field. The beam magnetic field and configured external
field both act on the electrons.
Both dynamic modes support a uniform external field plus an ideal normal quadrupole, evaluated at the electron’s transverse midpoint:
This field belongs to the local electron-cloud station. It is configured
explicitly and is not inferred from lattice Quadrupole commands.
A pure dipole uses magnetic_gradient=0 and a transverse uniform field.
For the circular chamber the conservative field bound is
\(|\boldsymbol B_0|+|G|R\). The model is longitudinally uniform:
transverse magnetic-mirror trapping can occur, but finite magnet length,
fringe fields and longitudinal electron losses are not represented.
Electrons use two position coordinates and three dimensionless momentum components, \(\boldsymbol u=\boldsymbol P/(m_ec)=\gamma_e\boldsymbol v/c\), with \(\gamma_e=\sqrt{1+|\boldsymbol u|^2}\). A relativistic Boris momentum update is combined with symmetric half drifts. Each half drift finds the first circular-wall intersection, emits or absorbs there, then advances the remaining time. No longitudinal transport between cloud stations is modeled. The Boris update is described in the WarpX particle-pusher documentation.
The configured time-step ceiling is additionally restricted using conservative beam-oscillation, cyclotron and transverse-displacement estimates. These controls do not replace resolution studies: force splitting near wall impacts and Boris phase error still depend on the time step. Particle count and emission statistics need independent convergence checks. The standard relativistic Boris method also has known limitations for relativistic \(\boldsymbol E\times\boldsymbol B\) drift; see Higuera and Cary.
Coupled PIC fields and beam response
In coupled, the beam source uses the saved slice’s live transverse
coordinates and memberships. Each beam macro particle deposits line charge
\(q_{\ell,j}=r_b Z_b e/\Delta z\), where \(r_b\) is the real-to-macro
particle ratio. Its transverse source distribution is held fixed throughout
the saved physical slice interval. It is not replaced by the Gaussian profile;
beam_sigma has no physical effect in this mode.
The grounded FD solver separately solves the beam field and cloud field. Dynamic cloud particles deposit line charges \(q_{\ell,e,j}=-e w_j/L_s\) in C/m, with source length \(L_s\) initially 1 m. Dividing by cell area gives density in C/m3; Poisson then returns potential in V and field in V/m, with no further source-length division. Restored snapshots may carry another source length; scaling electron weights with that length preserves the physical field. Each electron step performs a half drift with wall events, rebuilds the cloud field at the midpoint, applies the Boris update using \(\boldsymbol E_b+\boldsymbol E_e\) and \(\boldsymbol B_{\mathrm{ext}}+\boldsymbol B_b\), then performs the second half drift. Empty-beam gaps still evolve cloud self-fields. There is no cloud magnetic field or longitudinal electric field.
For a witness at the slice’s fixed transverse position, midpoint quadrature accumulates the cloud field over the slice duration \(\Delta t_s\):
Only the cloud field contributes to the beam kick. There is no beam self-kick
or \(1/\gamma_0^2\) reduction. The operation changes only px and py;
x, y, z_rel, dp, reference energy and bunch.t0 stay fixed.
Beam source coordinates are not advanced during a slice. The interaction
length scales this beam response, not electron counts or their physical clock.
Near the circular wall, deposition and interpolation renormalize each stencil
over its supported interior nodes to conserve deposited charge. This treatment
has first-order wall error and is not an exact Hamiltonian or energy-conserving
particle-field discretization. Time steps are limited by max_time_step,
external/beam cyclotron estimates, cloud plasma and cell-acceleration frequency
estimates (\(\omega\Delta t\le0.2\)), and electron displacement
(\(v_\perp\Delta t\le0.2h\), with the smaller grid spacing \(h\)).
These controls are safeguards, not a convergence proof. Independently vary
grid size, macro-electron/primary sample counts, random seeds, slice widths
and time steps before drawing physical conclusions.
Legacy primary and secondary emission
At a slice’s leading edge, a prescribed primary source creates \(N_{\mathrm{primary}}=Y_p N_{\mathrm{slice}}L_s\) electrons, represented by equal-weight macro electrons sampled uniformly around the wall and directed inward. Here \(L_s\) is the source length (initially 1 m) and \(Y_p\) has units 1/m. This phenomenological source does not calculate gas ionization, synchrotron-photon transport or a material photoelectric spectrum. Primary production is concentrated at the slice front rather than distributed continuously across its duration. Reducing only the electron time step does not remove that source-time approximation; also refine the Slicer intervals.
For incident kinetic energy \(E_i\), let \(x=E_i/E_{\max}\) and \(s>1\). The uncapped true-secondary curve and implemented limits are
Each incident macro electron creates at most one macro secondary, with weight \(w_o=w_i\delta_{\mathrm{eff}}\) and per-electron energy \(E_o\). Zero weight means absorption. This enforces both the per-electron and weighted aggregate incident-energy bound, conservatively suppressing low-energy emission. The curve uses the true-secondary shape of Furman and Pivi, Eqs. 31-32. It is not their full probabilistic model: this legacy option omits elastic/reflected and rediffused components, angle-dependent material yield and a joint secondary energy spectrum are absent. Macro-particle multiplication is represented by weights, not integer branching.
Primary and secondary directions obey a three-dimensional cosine distribution about the inward normal: \(\mu=\cos\theta=\sqrt U\) and \(\phi=2\pi V\), for independent uniform random values \(U,V\). All three momentum components are retained although only x and y are tracked. The default monoenergetic initial cloud uses an isotropic full sphere; the optional initial velocity distributions are independent of wall emission.
Output and state
Frozen selected-turn HDF5 diagnostics are written below the current PASS run directory
as electron_cloud/<run_id>/beam<id>_<command>/turn_<turn>_call_<call>.h5.
The run identifier contains a fresh token; call numbers distinguish repeated
executions at the same turn. The command’s saved_fields lists written paths.
Required field output completes before staged beam kicks are committed. A failed
write leaves beam momenta unchanged; a retry reserves a new diagnostic filename.
Files have format marker PASS-electron-cloud-fields-1 and contain:
Dataset |
Unit |
Meaning |
|---|---|---|
|
m |
One-dimensional grid axes. |
|
C/m3 |
Signed physical volume charge density. |
|
1/m3 |
Physical electron number density. |
|
V |
Electrostatic potential. |
|
V/m |
Transverse electric fields. |
|
m, m, 1 |
PIC source coordinates and electron-number weights; absent for analytic clouds. |
Two-dimensional grid arrays use (y, x) ordering. Dataset attributes specify
units. File metadata_json records the command, beam, turn, position,
interaction length, configuration and kick diagnostics; PIC source metadata
includes the represented source length and random state. After execution,
last_diagnostics gives live-particle counts and maximum fields/kicks, with
per-bunch records. The analytic potential uses the reference stated above.
PIC sampling noise and conducting-wall image fields should be distinguished
from force-normalization errors when interpreting these plots.
Both dynamic modes use the same output-directory and selection rules and save
source/x,y,ux,uy,uz,weight arrays and source metadata. Default dilute build_up saves no
cloud self-field maps. Dynamic PIC output additionally stores the actual final
cloud grid and fields datasets with the SI units above, plus history
and maximum-kick diagnostics. The momentum components
ux, uy, uz are dimensionless. Source metadata
contains source_length, physical time, last_turn, RNG state and
cumulative number/energy counters. history_json records each gap or slice,
including times, beam population, signed line charge, primary input, electron
populations before/after, incident/emitted populations and step count.
Each record satisfies
Accumulated wall energy is incident minus emitted kinetic energy, in eV for all represented electrons. Multiply by \(e\) for joules. Counts and wall energies refer to the saved source length; scale by \(L/L_s\) for a station representing machine length \(L\). This is not a self-consistent machine heat-load prediction. The configured interaction length does not rescale the underlying electron ensemble.
The cumulative energy ledger stores initial_energy_ev,
primary_energy_ev and signed field_work_ev (the kinetic-energy change
at Boris force updates). With \(K=\sum w(\gamma_e-1)m_ec^2\) in eV,
it obeys
\(K_{\mathrm{final}}=K_{\mathrm{initial}}+K_{\mathrm{primary}}+W_{\mathrm{field}}-E_{\mathrm{wall}}\).
This checks numerical bookkeeping; it does not measure the integrator’s
physical trajectory error.
In coupled mode it also does not establish conservation of total beam,
electron and field energy under the quasistatic thin-lens approximation.
The entire dynamic command stages electron state, RNG state and beam kicks;
all are committed only after successful evolution and requested output.
An evolution or output failure leaves them unchanged.
The command provides state_dict() / load_state_dict() and
save_state(path) / load_state(path) for its own source,
configuration identity and random state. This preserves a nondeterministic
PIC realization, or a dynamic population with time and momenta, for reuse.
These APIs are cloud snapshots, not a complete
simulation restart: matching beam particles, beam reference state, turn and
any other collective-effect state must be handled separately. Frozen mode
has no evolving cloud clock; both dynamic modes restore their saved physical
clock. Coupled snapshots use the same dynamic-state format, validate mode and
configuration identity, and rebuild field resources rather than saving caches.
During tracking, dynamic electron arrays remain on the selected CPU or GPU backend. Staged states own detached particle data; coupled mode reuses the fixed grid, field factorization and numerical workspace through serial calls. Reading a public cloud state, writing source/field snapshots or capturing a component snapshot materializes a validated host snapshot; on GPU this adds a device-to-host transfer. Input fields and component snapshot formats are unchanged. Scalar diagnostics and emission sampling can still synchronize the host and device. When comparing CPU/GPU performance, warm compilation and solver setup first, measure synchronized tracking separately from setup and snapshot output, and include both wall-free and wall-emission workloads. Small clouds need not run faster on GPU.
Coupled GPU execution combines fixed-order deposition with deterministic cuDSS solves. Highly occupied cells use a fixed reduction tree, so the last bits may differ from earlier serial summation. Repeatability checks apply to the same code, GPU architecture, SM count and software stack, not across devices. See Transverse Field Solvers.
Loading a cloud snapshot changes only this command’s source. The tracking entry starts a new run from turn 0; these component APIs do not provide a machine-restart workflow.
Runnable examples
example/09_electron_cloud_models contains an English walkthrough and two
serial workflows. run_models.py covers five chambers, optional self-fields,
elliptical/off-axis and tabulated drivers, four primary sources, three-channel
surface emission, population control and a measured time-step comparison.
The five geometry cases and the half-step ellipse case disable population
control. Two additional ellipse cases compare coarse and finer merge cells
against the same unmerged half-step reference. All eight histories are saved;
the report separates integration-step changes from merge effects and includes
effective macro count, merge count and whether the soft target was reached.
Conservation of weight and kinetic energy does not by itself bound subsequent
trajectory, spectrum or wall-load errors introduced by merging.
run_response.py extracts G and all four K components from real coupled PIC,
then compares independent direct kicks with response reconstruction.
Both scripts accept CPU/GPU selection and write new HDF5/JSON artifacts under
tests/codex/ecloud_examples. The model workflow also writes CSV and PNG.
See Electron-cloud models and response workflows for assumptions, units and validation scope.
Electron-cloud models and response workflows
All options below are explicit extensions of Electron Cloud (ElectronCloud). Existing inputs retain the dilute round-driver and simplified secondary defaults. Electron coordinates remain 2D3V: x/y move, all three mechanical momentum components are retained, and there is no longitudinal electron transport.
Prescribed drive, self-fields and chamber
Build up.Electron self fields is a boolean, default false. Enabling it
in build_up solves the electron space-charge field during driven intervals
and empty gaps. coupled always includes this field. Both use a grounded
transverse electrostatic mesh; check mesh spacing and time-step convergence.
Build up.Beam driver optionally defines ElectronCloudBeamDriver:
Fields |
Meaning |
|---|---|
|
|
|
Positive Gaussian RMS widths, allowing unequal sizes. |
|
Prescribed beam center; independent of the initial cloud center. |
|
Increasing map axes and nonnegative relative density in (y, x) order. |
The driver is normalized to the signed physical charge of each saved slice.
It is forbidden in coupled, whose source is the actual beam distribution.
The historical solver label round_gaussian_beam remains the build-up mode
selector even when the optional driver uses the finite-domain PIC solver.
Dynamic Aperture type/value selects circle, ellipse, rectangle, racetrack
or a simple polygon using the same dimensions as Space-Charge Effect (SpaceCharge).
Collision intersections, inward normals, source placement and the grounded
Poisson domain share this geometry. default/off retain the legacy
Chamber radius (m) circle. A complete initial uniform disk must fit inside;
the other initial spatial distributions are conditioned on the chamber interior.
Noncircular shapes automatically use the finite-domain beam field. Without
Beam driver, Beam sigma (m) supplies the axis-centered round Gaussian
density projected onto that domain. For explicit noncircular apertures, omit
Chamber radius (m) to avoid conflicting geometry definitions.
Primary production
Build up.Primary sources is a list of PrimarySourceConfiguration.
It cannot be combined with a nonzero legacy primary yield. Each source has
Macro electrons (default 64), Mean energy (eV) (default 2),
Energy distribution (monoenergetic or gamma), and
Energy shape (positive Gamma shape, default 2). Weights represent physical
electron number. Birth times are sampled within the finite source interval;
electrons are advanced only after birth.
|
Physical number |
Parameters |
|---|---|---|
|
N_b P sigma L / (k_B T) |
|
|
N_b Y L |
|
|
N_b f_loss Y_loss L |
|
|
photon_rate QE L dt |
|
Wall sources also accept Wall angle min (rad) and Wall angle max (rad)
to restrict the emitting region by polar angle about the chamber origin.
Sampling is uniform in wall arclength conditional on that region; it is not
uniform in polar angle on an ellipse. The photon source also operates in
empty gaps. N_b is the number of real beam particles passing in the interval.
Gas pressure, cross sections, losses and
illumination must come from the intended operating conditions.
Surface emission
Build up.Surface emission selects SurfaceEmissionConfiguration and
cannot be combined with a nonzero legacy Secondary yield max. This is a
three-channel phenomenological model, not a complete Furman-Pivi material fit.
True secondaries use
True yield max,True peak energy (eV),True shape,Yield angle coefficientandPeak angle coefficient.True energy distributionselectsgammaormonoenergetic;True mean energy (eV)andTrue energy shapedefine the unconditioned spectrum. Finite incident energy changes the conditioned outgoing mean.Elastic probability at zero energyandElastic energy scale (eV)define the elastic branch.Rediffused probabilityandRediffused energy shapedefine the rediffused branch.Samplingselectsstochastic_eventorweighted_channels.Max secondaries per impactbounds the event multiplicity.
True yield energy table (eV) and True yield table replace the analytic
true-yield curve with linear interpolation. Yield table outside is
zero (default) or constant. The angle coefficients still shift the
energy axis and scale the yield.
The channels share an incident-energy budget. The stochastic true-secondary branch samples a conditioned total energy and a joint energy partition; independent samples are not clipped afterward into a spurious peak at the incident energy. Cosine emission uses both signs of longitudinal momentum. For monoenergetic stochastic emission, the Poisson multiplicity is conditioned on N times emission energy not exceeding incident energy; the low-energy mean yield can therefore differ from the requested unconstrained curve. The probabilities and spectra require experimental calibration for a real surface, conditioning history and incident-energy range.
Population control and diagnostics
Build up.Population control selects PopulationControlConfiguration.
It uses local phase-space cells and two representative momenta to preserve
total weight, weighted momentum and relativistic kinetic energy during
merging. Heavy representatives may be split. The options are
Target macro electrons, Spatial cell size (m),
Normalized momentum cell size, Max weight to mean ratio and
Max split children. The target is a soft reduction goal: separated cells
cannot be merged arbitrarily just to hit a particle count. The independent
Max macro electrons remains a hard resource limit.
Moment conservation does not preserve every spatial feature or higher moment.
Compare the charge density and field with a larger population and smaller
cells. The effective count is \(N_\mathrm{eff}=(\sum w)^2/\sum w^2\).
Identical-state splitting increases this weight-based count without creating
independent phase-space samples.
The analysis helpers in PASS.commands.ecloud.diagnostics compute weighted
counts, line density, kinetic energy, core density and RMS quantities.
HDF5 diagnostics spectra contain independent edges, centers and
values arrays with units. Cloud spectra use electrons/bin at the saved
observation time. Wall spectra additionally use J/bin for net kinetic
deposition and accumulate over the recorded history identified by scope. Their
wall-position axis is atan2(y,x), not arclength. The last wall-energy bin
includes every energy at or above 1 MeV; its finite 10 MeV plotting edge is
not an upper cutoff. The GUI preserves these attributes, reads, plots
and exports these spectra alongside fields, particles and histories.
Wall energy deposition is incident kinetic energy minus outgoing kinetic
energy. The helper wall_power reports W/m after dividing by the observation
duration and represented source length. An optional perimeter gives mean
W/m2; it does not resolve local hot spots.
CPU and GPU execute the same physical distributions and energy constraints. The GPU material sampler uses device Philox draws seeded once per emission call from the component’s saved PCG64 generator. Cloning and restoring a state reproduces draws on the same backend and software stack; individual CPU and GPU draws need not match. Reproducible random draws do not imply bitwise-identical GPU wall spectra: double-precision atomic reductions with variable weights can differ in their last bits, without feeding back into particle trajectories or RNG. Rare conditional-CDF underflow or extreme Dirichlet parameters use a host fallback for only the affected samples. Primary-source sampling retains the host generator but gathers only selected beam coordinates from the device. Population control and wall-spectrum reductions run on GPU; only small diagnostics are transferred.
The Sequence command collects wall spectra only when Save fields is
enabled. Continuous collection uses scope=cumulative_since_state_origin. Scalar number
and energy accounting remains active regardless of output selection. This
avoids paying for unused spectra in tracking runs. The low-level
BuildUpCloud API retains wall-spectrum collection by default; passing
record_wall_spectra=False disables it and drops previously collected
spectra on restore, without changing the physical particles or RNG.
If a snapshot contains earlier wall impacts without recorded wall spectra,
restoring it with collection enabled starts a new recorded history with
scope=cumulative_since_recording_restart. Later accumulation and subsequent
save/restore retain this scope. Scalar number and energy ledgers still include
the complete physical history, so these restarted spectra must not be treated
as the full-history wall energy.
Response extraction and replay
PASS.commands.ecloud.response supplies ResponseSlice,
extract_response, write_response, read_response and
make_periodic_response. The extractor drives the actual BuildUpCloud
solver from a cloned physical state and RNG state. It measures a spatial
background kick G and all four source-to-witness response components K.
Only the source centroid is perturbed; witness probes stay fixed. Central
differences at epsilon and epsilon/2 must agree within the requested
tolerance; an even-residual check against the baseline also detects quadratic
response that central differences alone would miss. A finite slice can respond within its own duration, so the
diagonal of the causal matrix is not forced to zero.
Here p_perp is mechanical transverse momentum divided by reference momentum. G is dimensionless and K has units 1/m. Charge, interaction length and signed witness reference factors are already incorporated. G supplies the baseline focusing; do not add it a second time through a separate frozen-cloud kick. The approximation retains the calibrated witness profile and its coherent response, not arbitrary nonlinear evolution of a changing beam distribution.
ElectronCloudResponseItem adds a Sequence command with the following fields:
JSON key |
Default |
Meaning |
|---|---|---|
|
Required |
Calibrated HDF5 and current general/z_rel slices, produced at this position. |
|
|
Complete measured causal history, or verified |
|
|
Use the file calibration limit or a stricter limit. |
|
|
Relative Frobenius tolerance of the centered transverse covariance; use the recorded value or a stricter one. |
|
0, null, true |
Standard station location, ordering and enable switch. |
Finite timelines may include multiple bunches and turns without assuming a stationary kernel. Periodic replay requires multiple recorded periods and agreement of G, lag-dependent K and a checked omitted-memory tail. A local cloud snapshot is not a whole-simulation restart. Every tracking run starts fresh; response files describe calibrated physics and do not restore clocks or other commands.
Use capture_response_slices to capture the production saved-slice timeline.
Automatic empty bunches can yield zero-width observation points, which are
not finite response intervals. For empty groups, use an explicit finite
Slicer range instead; capture rejects zero-width observations.
The covariance check does not detect every change in higher moments or fine
structure. Calibrate again when the distribution changes beyond the rigid
profile assumption, even if its covariance happens to remain unchanged.
Numerical and physical validation
Use direct coupled runs to test reconstruction in the stated displacement domain. Independently refine electron time step, mesh spacing, macro count, response probe grid and the measured memory duration. Tune and exponential growth estimates need an explicit fitting interval; a fitted threshold is conditional on the scanned parameters and growth model. Numerical agreement does not substitute for measured material and machine inputs, nor establish full three-dimensional, electromagnetic or fringe-field validity.