10.73 QUAD—A quadrupole implemented as a matrix, up to 3rd order. Use KQUAD for symplectic tracking.

A quadrupole implemented as a matrix, up to 3rd order. Use KQUAD for symplectic tracking.
Parallel capable? : yes
GPU capable? : yes
Back-tracking capable? : yes

Parameter Name UnitsType Default


L M double 0.0


K1 1∕M2double 0.0

geometric strength

TILT RADdouble 0.0

rotation about longitudinal axis

DX M double 0.0


DY M double 0.0


DZ M double 0.0


FSE double 0.0

fractional strength error

HKICK RADdouble 0.0

horizontal correction kick

VKICK RAD double 0.0

vertical correction kick


calibration factor for horizontal correction kick


calibration factor for vertical correction kick


use for horizontal steering?


use for vertical steering?

ORDER short 0

matrix order


include entrance edge effects?


include exit edge effects?

FRINGE_TYPE STRINGfixed-strength

type of fringe: ”inset”, ”fixed-strength”, or ”integrals”

FFRINGE double 0.0

For non-integrals mode, fraction of length occupied by linear fringe region.

LEFFECTIVE M double -1

Effective length. Ignored if non-positive. Cannot be used with non-zero FFRINGE.

I0P M double 0.0

i0+ fringe integral

I1P M2 double 0.0

i1+ fringe integral

I2P M3 double 0.0

i2+ fringe integral

I3P M4 double 0.0

i3+ fringe integral

LAMBDA2P M3 double 0.0

lambda2+ fringe integral

I0M M double 0.0

i0- fringe integral

QUAD continued

A quadrupole implemented as a matrix, up to 3rd order. Use KQUAD for symplectic tracking.

Parameter NameUnitsType Default


I1M M2 double0.0

i1- fringe integral

I2M M3 double0.0

i2- fringe integral

I3M M4 double0.0

i3- fringe integral

LAMBDA2M M3 double0.0

lambda2- fringe integral

RADIAL short 0

If non-zero, converts the quadrupole into a radially-focusing lens


Optionally used to assign an element to a group, with a user-defined name. Group names will appear in the parameter output file in the column ElementGroup

This element simulates a quadrupole using a matrix of first, second, or third order.

As of version 29.2, this element incorporates the ability to have different values for the insertion and effective lengths. This is invoked when LEFFECTIVE is positive. In this case, the L parameter is understood to be the physical insertion length. Using LEFFECTIVE is a convenient way to incorporate the fact that the effective length may differ from the physical length and even vary with excitation, without having to modify the drift spaces on either side of the quadrupole element.

By default, the element has hard edges and constant field within the defined length, L. However, this element supports two different methods of implementing fringe fields. Which method is used is determined by the FRINGE_TYPE parameter.

Edge integral method The most recent and preferred implementation of fringe field effects is based on edge integrals and is invoked by setting FRINGE_TYPE to “integrals”. This method is compatible with the use of LEFFECTIVE. However, it provides a first-order matrix only.

The model is based on publications of D. Zhuo et al. [34] and J. Irwin et al. [35], as well as unpublished work of C. X. Wang (ANL). The fringe field is characterized by 10 integrals given in equations 19, 20, and 21 of [34]. However, the values input into elegant should be normalized by K1 or K12, as appropriate.

For the exit-side fringe field, let s1 be the center of the magnet, s0 be the location of the nominal end of the magnet (for a hard-edge model), and let s2 be a point well outside the magnet. Using K1,he(s) to represent the hard edge model and K1(s) the actual field profile, we define the normalized difference as ˜
k(s) = (K1(s) - K1,he(s))∕K1(s1). (Thus, ˜
k(s) =  ˜
K(s)∕K0, using the notation of Zhou et al.)

The integrals to be input to elegant are defined as

                        ∫ s0              ∫ s2
                   i-0 =     ˜k(s)ds   i+0 =     ˜k (s)ds                        (122)
                 ∫       s1               ∫s0
             -     s0˜                +     s2˜
            i1 =  s1 k(s)(s - s0)ds   i1 =  s0 k (s)(s- s0)ds                 (123)
                ∫ s0                      ∫ s2
           i-2 =     ˜k(s)(s - s0)2ds   i+2 =     ˜k (s)(s- s0)2ds                (124)
                ∫s1                       ∫s0
            -     s0˜          3      +     s2˜          3
           i3 =  s  k(s)(s - s0) ds   i3 =  s  k (s)(s- s0) ds                (125)
      ∫ s0  ∫ s0  1                        ∫0s2  ∫ s2
λ -2 =     ds    ds′˜k(s)˜k(s′)(s′- s)   λ+2 =     ds    ds′˜k(s)˜k(s′)(s′- s)     (126)
       s1    s                              s0    s

Normally, the effects are dominated by i1- and i1+.

Trapazoidal models This method is based on a third-order matrix formalism and the assumption that the fringe fields depend linearly on z. Although the third-order matrix is computed, it is important to note that the assumed fields do not satisfy Maxwell’s equations.

To invoke this method, one specifies “inset” or “fixed-strength” for the FRINGE_TYPE parameter and then provides a non-zero value for FFRINGE. If FFRINGE is zero (the default), then the magnet is hard-edged regardless of the setting of FRINGE_TYPE. If FFRINGE is positive, then the magnet has linear fringe fields of length FFRINGE*L/2 at each end. That is, the total length of fringe field from both ends combined is FFRINGE*L.

Depending on the value of FRINGE_TYPE, the fringe fields are modeled as contained within the length L (“inset” type) or extending symmetrically outside the length L (“fixed-strength” type).

For “inset” type fringe fields, the length of the “hard core” part of the quadrupole is L*(1-FFRINGE). For “fixed-strength” type fringe fields, the length of the hard core is L*(1-FFRINGE/2). In the latter case, the fringe gradient reaches 50% of the hard core value at the nominal boundaries of the magnet. This means that the integrated strength of the magnet does not change as the FFRINGE parameter is varied. This is not the case with “inset” type fringe fields.