Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

1. OPAL-map

OPAL-map is work in progress.

1.1. Introduction

OPAL-map is an map tracking beam optics code. This type computes maps for each beam line element to describe the action of the system.

The map creation is done by applying the Lie Operator on the element Hamiltonian and calculated in the Truncated Power Series Algebra (TPSA)[bib.berz1999_opalmap]. The TPSA is a Differential Algebra (DA), which uses the Taylor expansion as the equivalent function. In OPAL-map the TPSA gets provided from the own OPAL DA package.

In contrast to time t dependent tracking codes, as OPAL-t, map tracking codes use the longitudinal bunch position s as independent variable. Furthermore, map tracking codes do not use numerical integrators for the determination of the particle trajectory, which can be a computationally very expensive.

The main advantage in map tracking codes lies in the ''map'' itself. These do not only contain valuable information about the beam line, but also can be accumulated to reduce the computational effort in the particle tracking.

1.2. Variables in OPAL-map

For in and outputs, the units as in Variables in OPAL-t are used.

OPAL-map uses an Frenet-Serret coordinate system, referring on a reference particle. This particle has the ideal properties, ergo follows the design path. The following canonical variables to describe the motion of particles. The physical units are listed in square brackets.

X

Horizontal position x of a particle relative to the reference particle [m].

PX

\frac{p_x}{P_0} Normalized horizontal canonical momentum [1]. (Where p_x is the momentum of the particle and P_0 is the momentum of the reference particle)

Y

Horizontal position y of a particle relative to the reference particle [m].

PY

\frac{p_y}{P_0} Normalized horizontal canonical momentum [1].

Z

Longitudinal position z of a particle relatice to the reference particle [m].

DELTA

\frac{E}{P_0 c}-\frac{1}{\beta_0} Energy derviation [1]. (Where E is the total energy of the particle and \beta_0 = \frac{u}{c} the speed relative to the speed of light c of the reference particle)

The independent variable is position of the reference particle s [m].

1.3. Principle of Map Tracking

The particle motion gets calculated by applying the map on the particle parameter. Flow chart of map tracking.

mapTracking
Figure 1. Flow chart of map tracking.
v^f = \mathbf{\mathcal{M}} \circ v^i

Where v denotes the final (v^f) and initial (v^i) six dimensional phase space vector of each particle. \mathbf{\mathcal{M}} is the map. This map can represent either a beam element slice, the whole element, a beam line section or the whole system.

1.3.1. Creation of map

The creation of the element map is based on the Hamiltonian Mechanic, more specificly on the Lie Operator.

\begin{aligned}
    H &= T + V\\
    \frac{d\mathbf{q_i}}{ds} &= \frac{\partial H}{\partial p_i} \; , \;  \frac{d\mathbf{p_i}}{ds} = - \frac{\partial H}{\partial q_i}
\end{aligned}

\frac{d\mathbf{q_i}}{ds} &= \frac{\partial H}{\partial p_i} \; , \; \frac{d\mathbf{p_i}}{ds} = - \frac{\partial H}{\partial q_i} Here H, the time dependent Hamiltonian represents the total energy, consisting of the kinetic T and potential V energy. The lower equations are the Hamiltonian equations of motion, where the momenta p_i and the positons q_i form the cannonical paris. Using cannonical transformations, the Hamiltonian can be adjusted to use the pathlength s as independent and the particle parameters as depenedent variable(s).

Introducing the Lie operator, which acts similar to a "waiting" Poissant Bracket:

\begin{aligned}
    :\!f\!:  = \left[ f, \circ \right] = \sum_{i=1}^{n} \left( \frac{\partial f}{\partial q_i}\frac{\partial \circ}{\partial p_i} - \frac{\partial f}{\partial p_i}\frac{\partial \circ}{\partial q_i} \right)
\end{aligned}

If a function f:= f_{\left( \mathbf{q_{(s)}},\mathbf{p_{(s)}}\right) } describes one of the phase space variables v its total derivative to the independent variable, combined with the Hamiltonian equations of motions, is similar to the Lie operator times the independ variable, i. e. s.

\begin{aligned}
    \frac{df}{ds}&= \sum_{i=1}^{n} \left( \frac{dq_i}{ds}\frac{\partial f}{\partial q_i} +\frac{dp_i}{ds}\frac{\partial f}{\partial p_i} \right) \\
    \frac{df}{ds}&= \sum_{i=1}^{n} \left( \frac{\partial H}{\partial p_i}\frac{\partial f}{\partial q_i} -\frac{\partial H}{\partial q_i}\frac{\partial f}{\partial p_i} \right)  \equiv -:\!H\!: f
\end{aligned}

The integral over the independent variable \int \, \cdot \, ds:

\begin{aligned}
    f_{(s)}&= e^{-:\!H\!: s} f_{(s_0)} \\
	\mathcal{M} &= e^{-:\!H\!: s}
\end{aligned}

Where e^{-:\!H\!: s} is the Lie expansion.

1.3.2. Implementaion of map tracking

For the derivative of the Hamiltonian, a Differential Algebra (DA) was used, in particular the Truncated Power Series Algebra (TPSA). This algebra uses the Taylor expansion as the equivalent function, which also is responsible for its name by creating truncated power series. Just form the definition of the Taylor expansion, it can be seen that a finite, to the order \Omega, expansion is an approximaion of the acutal function, due to the error term \mathcal{O}\left( \mathbf{v}_{\left( \Delta s\right)}^{\,\Omega +1}\right) .

\begin{aligned}
     f = \mathbf{\mathcal{M}} = {\sum_{n=0}^{\Omega} \frac{f^{\left(n\right)}}{n !} \left( \mathbf{v}_{\left( \Delta s\right)} \right)^n} + {\mathcal{O}\left( \mathbf{v}_{\left( \Delta s\right)}^{\,\Omega +1}\right) }
\end{aligned}

In OPAL-map the Hamiltonian gets Taylor expanded and its map derived (Creation of Map) in the TPSA using the OPAL DA package. The truncation length gets definded in TRACK setting the MAP_ORDER attribute.

TRACK, LINE= QUADTEST, BEAM=BEAM1, MAXSTEPS=10000, DT=1.0e-10, ZSTOP=4.0, MAP_ORDER=2;

1.4. Additional Parameter in OPAL-map

Table 1. Additional Parameter.
Attribute Name set in Default Value Units Description

MAP_ORDER

TRACK

1

[ ]

defines the map order ( = order TPSA - 1).

NSlices

beam line element

1

[ ]

defines the number of steps inide the element.

1.4.1. Limitations

OPAL-map is the new flavour of OPAL and currently just contains the fundamental beam line elements:

+ * Drift (Drift), * Dipole (Sbend), * Quadrupole (Quadrupole)

+

other elements will follow soon.

1.5. Example

FODO lattice: FODO.in

To RUN OPAL-map, the METHOD attribute gets set to THICK.

RUN, METHOD = "THICK", BEAM=BEAM1, FIELDSOLVER=FS1, DISTRIBUTION=DIST1;

The maximal order of the beam line maps get defined with the MAP_ORDER attribute.

TRACK, LINE= QUADTEST, BEAM=BEAM1, MAXSTEPS=10000, DT=1.0e-10, ZSTOP=4.0, MAP_ORDER=2;

As an optional parameter for the beam line elements NSlices=<x> provides the opportunity to split one element in <x> smaller steps. Otherwise, the default value is defined with 1.

D1:  DRIFT, 		L=1., 		     ELEMEDGE=0.000, NSLICES=10;
QP1: QUADRUPOLE, 	L=0.3, 	K1= 8.64195, ELEMEDGE=1.000, NSLICES=15;

1.6. Output

References

  • [user-content-bib.berz1999_opalmap] Martin Berz. Modern map methods in particle beam physics. eng. ISBN: 978-0-12-014750-2. San Diego: Academic Press, 1999.