track#

Quadrupole.track(bunch, backtrack=False, out_initial=False, opmd_diag=False, diag_dir=None, show_progress_bar=True)#

Track bunch through element.

Parameters:
bunchParticleBunch

Particle bunch to be tracked.

backtrackbool

Whether to perform the tracking backwards.

out_initialbool

Whether to include the initial bunch in the output.

opmd_diagbool or OpenPMDDiagnostics

Determines whether to write simulation diagnostics to disk (i.e. particle distributions and fields). The output is written to HDF5 files following the openPMD standard. The number of outputs the n_out value. It is also possible to provide an already existing OpenPMDDiagnostics instance instead of a boolean value.

diag_dirstr

Directory into which the openPMD output will be written. By default this is a ‘diags’ folder in the current directory. Only needed if opmd_diag=True.

show_progress_barbool, optional

Whether to show a progress bar of the tracking. By default True.

Returns:
A list of size ‘n_out’ containing the bunch distribution at each step.