Solenoid
This module describes the PASS solenoid element Solenoid, used to simulate the motion of charged particles in a longitudinal magnetic field. The solenoid produces a uniform magnetic field \(B_z\) along the beam direction, coupling the horizontal and vertical planes through the Larmor rotation effect while providing transverse focusing.
The PASS solenoid uses an exact nonlinear map (analytical solution of the Hamiltonian in the Larmor framework). For a pure solenoid (without multipole field overlay), the map has zero error; when multipole fields are superimposed, a Sol-Kick-Sol (SKS) symplectic integrator is used.
Code Location
Source file:
PASS/commands/element/solenoid.pyClass name:
Solenoid(inherits fromCommand)Registration name:
solenoidKey features:
Uses exact solenoid map (Larmor rotation + focusing, \(p_z\) computed per particle)
No thin lens mode (solenoid has no thin lens limit; \(L=0\) produces no effect)
Supports multipole field overlay (
knl/ksl), using SKS integratorSupports uniform (2nd-order leapfrog) and yoshida4 (4th-order Yoshida composition) integrators
\(k_s = 0\) automatically degenerates to a pure drift
Chromaticity effects naturally introduced through per-particle \(p_z\)
Supports aperture check
Coordinate Convention
PASS uses normalized curvilinear coordinates. The six-dimensional phase-space variables are \((x, p_x, y, p_y, z, \delta)\):
Variable |
Symbol |
Definition |
|---|---|---|
|
\(x\) |
Horizontal offset (relative to the reference orbit) |
|
\(p_x\) |
Normalized horizontal momentum, \(p_x = P_x / P_0\) |
|
\(y\) |
Vertical offset |
|
\(p_y\) |
Normalized vertical momentum, \(p_y = P_y / P_0\) |
|
\(\zeta\) |
Longitudinal coordinate, \(\zeta = s - \beta_0 c t\) |
|
\(\delta\) |
Relative momentum deviation, \(\delta = P / P_0 - 1\) |
where \(P_0\) is the reference particle momentum, \(\beta_0 = v_0 / c\) is the reference particle normalized velocity.
Solenoid Field and Normalized Strength
The solenoid produces a uniform magnetic field along the beam direction (\(s\) axis):
The normalized solenoid strength is defined as:
where \(q_0\) is the reference particle charge and \(P_0\) is the reference particle momentum. In PASS, the user directly specifies \(k_s\) (ks).
Define the half-strength:
The Larmor rotation angle is:
where \(p_z\) is the particle’s normalized longitudinal momentum component (different for each particle, see below), and \(L\) is the solenoid length.
Physical Derivation
Hamiltonian
In the Cartesian coordinate system, the solenoid Hamiltonian is:
The physical meaning of each term:
Term |
Physical Meaning |
|---|---|
\(-\sqrt{(1+\delta)^2 - p_x^2 - p_y^2}\) |
Free propagation (exact drift) |
\(\frac{k_s^2}{8}(x^2 + y^2)\) |
Solenoid focusing (equivalent quadrupole component) |
\(-\frac{k_s}{2}(x p_y - y p_x)\) |
Larmor rotation (\(x\)-\(y\) coupling) |
Note
The Larmor rotation term \(-\frac{k_s}{2}(x p_y - y p_x)\) depends on both position and momentum simultaneously, which is the fundamental difference between the solenoid and the quadrupole. The quadrupole kick term depends only on position, allowing the Hamiltonian to be cleanly split into drift and kick parts (DKD integrator). The Larmor rotation term of the solenoid cannot be split into purely position-dependent or purely momentum-dependent parts, and therefore cannot use ordinary drift for DKD integration.
Larmor Framework and Exact Solution
Performing the Larmor transformation—rotating the transverse coordinate system about the \(s\) axis by angle \(\theta = \text{sk} \cdot s / p_z\)—defines the canonical momenta in the Larmor framework:
In the Larmor framework, \(p_{k1}\) and \(p_{k2}\) are conserved quantities (do not vary with \(s\)), so the longitudinal momentum component:
is constant per particle throughout the solenoid. This allows the solenoid map to be solved exactly without approximation.
Exact Solenoid Map
Given the solenoid length \(L\), the Larmor rotation angle:
The map is divided into two steps: rotation and drift.
Step 1: Larmor rotation (rotating coordinates to the Larmor framework at \(s=L\))
Step 2: Drift in the Larmor framework (equivalent drift length \(\sin\theta / \text{sk}\))
Longitudinal coordinate update:
where \(\text{rvv} = \beta / \beta_0\) is the ratio of the particle velocity to the reference particle velocity:
Note
\(p_z\) is different for each particle (including contributions from \(\delta\) and Larmor momenta), so the map is exactly nonlinear
When \(k_s \to 0\), \(\sin\theta/\text{sk} \to L/p_z\), and the map degenerates to exact drift
Why the Solenoid Has No Thin Lens Mode
The thin lens limit of a quadrupole (\(L \to 0\), \(k_1 \to \infty\), \(k_1 L = \text{const}\)) gives a finite momentum kick \(\Delta p_x = -k_{1L} \cdot x\), which is physically self-consistent.
The thin lens limit of a solenoid (\(L \to 0\), \(k_s \to \infty\), \(k_s L = \text{const}\)) has a fundamental difficulty:
Larmor rotation angle \(\theta = k_s L / (2 p_z)\) is finite ✓
Focusing term \(\text{sk} \cdot \sin\theta = (k_s/2) \cdot \sin\theta \to \infty\) diverges ✗
The scaling behavior of position and momentum is asymmetric: the rotation angle is finite but the focusing force diverges, so the thin lens limit does not exist.
Therefore, in PASS, the solenoid with \(L = 0\) has no effect (identity map) and does not provide a thin lens mode.
Multipole Field Overlay and SKS Integrator
When transverse multipole field components (\(k_{nl}\) / \(k_{sl}\)) are superimposed inside the solenoid, the total Hamiltonian is:
where \(H_{\text{mult}}\) is the multipole kick Hamiltonian (depending only on position). Since \(H_{\text{sol}}\) and \(H_{\text{mult}}\) do not commute, a split-operator method is needed.
PASS uses the Sol-Kick-Sol (SKS) integrator, fully parallel to the quadrupole’s DKD:
where:
Sol = exact solenoid map (
_solenoid_exact_cpu), handling the \(B_z\) fieldKick = multipole kick (Horner recursion), handling transverse multipole fields
Drift Operator |
Kick Operator |
Scenario |
|
|---|---|---|---|
Quadrupole DKD |
Free drift |
Quadrupole kick |
\(B_z = 0\), only transverse gradient field |
Solenoid SKS |
Solenoid map |
Multipole kick |
\(B_z \neq 0\), superimposed transverse multipole fields |
Note
The “Sol” in SKS is not a free drift but the exact solenoid map. Inside the solenoid, \(B_z\) is always present, and particles do not drift in field-free space. If a free drift is incorrectly used instead of the solenoid map, the Larmor rotation effect would be lost.
Uniform Integrator (2nd-order symplectic)
Each slice uses the Sol-Kick-Sol structure, i.e., 2nd-order leapfrog:
The per-slice error is \(O(\Delta s^3)\), and the global error is \(O(\Delta s^2)\).
yoshida4 Integrator (4th-order symplectic)
A 4th-order symplectic map is constructed by composing three 2nd-order SKS steps [Yoshida 1990]:
where the Yoshida coefficients are:
The per-slice error is \(O(\Delta s^5)\), and the global error is \(O(\Delta s^4)\).
Overall Tracking Flow
Depending on whether multipole fields are superimposed, the solenoid has two tracking paths:
====== Thick lens (length > 0) ======
No multipole field (knl/ksl all zero):
Single-segment exact solenoid map Sol(L, ks)
[Zero error, no slicing needed]
With multipole field (knl/ksl nonzero):
Slice 1 → Slice 2 → ... → Slice N
(Each slice: Sol(ds/2) → Kick(ds) → Sol(ds/2))
where ds = L / N
Special cases:
ks = 0 → degenerates to pure drift Drift(L)
L = 0 → no effect (solenoid has no thin lens limit)
The complete map is:
Without multipole field:
With multipole field (\(N\) slices):
Chromaticity Effects
The chromaticity effects of the solenoid are naturally introduced through the per-particle \(p_z\) expression.
In the Larmor framework, \(p_z\) depends on \(\delta\) and the Larmor momenta \(p_{k1}, p_{k2}\):
Particles with different momentum deviations \(\delta\) have different \(p_z\), and therefore different Larmor rotation angles \(\theta = \text{sk} \cdot L / p_z\) and different equivalent drift lengths \(\sin\theta / \text{sk}\). This is the physical origin of solenoid chromaticity—momentum-dependent rotation angle and focusing strength.
Interface Parameters
Property |
JSON key |
Type |
Unit |
Description |
|---|---|---|---|---|
|
|
float |
m |
Longitudinal position of the element in the beamline |
|
|
float |
m |
Element length (must be \(\ge 0\); \(= 0\) produces no effect) |
|
|
str |
Element name |
|
|
|
float |
\(\text{m}^{-1}\) |
Solenoid normalized strength \(k_s = q_0 B_z / P_0\), default 0 |
|
|
list |
\(\text{m}^{-n}\) |
Multipole normal integrated strength array \(K_{nL}\), default |
|
|
list |
\(\text{m}^{-n}\) |
Multipole skew integrated strength array \(K_{sL}\), default |
|
|
int |
Number of slices, default 1 (effective only with multipole field overlay) |
|
|
|
str |
Integrator, options: |
|
|
|
str |
Aperture type, default |
|
|
|
list |
Aperture parameter values, default |
Note
knl/kslare optional parameters. When not specified or all zero, the solenoid uses a single-segment exact map (zero error), ignoringnum_slicesandintegratorWhen nonzero
knl/kslare specified, the SKS integrator is enabled, andnum_slicesandintegratortake effectWhen
ks = 0and the element has length, it degenerates to a pure driftWhen
length = 0, the solenoid has no effect (thin lens mode is not provided)
Usage Examples
Pure Solenoid (Exact Map)
{
"SOL1": {
"S (m)": 10.0,
"Command": "Solenoid",
"Length (m)": 1.0,
"ks": 2.0,
"Aperture Type": "off"
}
}
Length 1.0 m, normalized strength \(k_s = 2.0\). Uses a single-segment exact solenoid map with zero error.
Weak Solenoid
{
"SOL2": {
"S (m)": 20.0,
"Command": "Solenoid",
"Length (m)": 2.0,
"ks": 0.5,
"Aperture Type": "off"
}
}
Weak-field solenoid with a small Larmor rotation angle.
Reverse-Field Solenoid
{
"SOL3": {
"S (m)": 30.0,
"Command": "Solenoid",
"Length (m)": 1.5,
"ks": -3.0,
"Aperture Type": "off"
}
}
\(k_s < 0\) indicates a reverse magnetic field, with the Larmor rotation in the opposite direction.
Solenoid with Quadrupole Overlay (SKS Integrator)
{
"SOL4": {
"S (m)": 40.0,
"Command": "Solenoid",
"Length (m)": 1.0,
"ks": 2.0,
"KiL": [0.0, 0.1],
"Kisl": [],
"Num Slices": 4,
"Integrator": "yoshida4",
"Aperture Type": "off"
}
}
Solenoid (\(k_s = 2.0\)) with superimposed quadrupole component (\(K_{1L} = 0.1\)), 4 slices, 4th-order symplectic integrator. The KiL array index 0 is \(K_{0L}\) (dipole), and index 1 is \(K_{1L}\) (quadrupole).
Zero-Field Degeneration (Pure Drift)
{
"SOL5": {
"S (m)": 50.0,
"Command": "Solenoid",
"Length (m)": 1.0,
"ks": 0.0,
"Aperture Type": "off"
}
}
When \(k_s = 0\), degenerates to a pure drift.
Application Scenarios
Low-energy beam transport lines: In low-energy sections where \(\beta\gamma\) is small, solenoid focusing is more efficient than quadrupoles, and is commonly used in injectors and low-energy transport lines
Electron coolers: Solenoids confine the electron beam to co-move with the ion beam, used for cooling transverse emittance
Collider detector solenoids: The solenoid magnetic fields of large experimental detectors (e.g., CMS, ATLAS) have a significant impact on beam optics and must be accurately accounted for in the lattice model
Superconducting solenoids: Multipole field errors in high-field superconducting solenoids can be modeled through
knl/kslparameter overlayRotationally symmetric beams: The Larmor rotation of the solenoid can be used to eliminate \(x\)-\(y\) coupling or produce specific rotationally symmetric beam distributions