at.physics.nonlinear#
Non-linear optics.
Functions
|
Computes the non-linear chromaticities. |
|
Compute the tunes for a sequence of amplitudes. |
|
Generates a detuning element. |
|
Generates a range of tunes for varying x, y, or z amplitudes. |
- chromaticity(ring, method='linopt', dpm=0.02, npoints=11, order=3, dp=0, **kwargs)[source]#
Computes the non-linear chromaticities.
This function computes the tunes for the specified momentum offsets. Then it fits this data and returns the chromaticity up to the given order (npoints>order).
- Parameters:
ring (Lattice) – Lattice description
method (str) –
'linopt'(dfault) returns the tunes from thelinopt6()function,'fft'tracks a single particle and computes the tunes with fft,'laskar'tracks a single particle and computes the tunes with NAFF.dpm (float) – Maximum momentum deviation
npoints (int) – Number of momentum deviations
order (int) – Order of the fit
dp (float) – Central momentum deviation
- Returns:
fit (ndarray) – Horizontal Vertical polynomial coefficients from
np.polyfitof shape (2, order+1). The polynomial coefficients are multiplied by`k!`where`k`is the order of the coefficient.dpa – dp array of shape (npoints,)
qz – tune array of shape (npoints, 2)
- detuning(ring, xm=3e-05, ym=3e-05, npoints=3, nturns=512, dp=None, **kwargs)[source]#
Compute the tunes for a sequence of amplitudes.
This function uses
tunes_vs_amp()to compute the tunes for the specified amplitudes. Then it fits this data and returns the detuning coefficiant dQx/Jx, dQy/Jx, dQx/Jy, dQy/Jy and the qx, qy arrays versus x, y arrays.Tracking is done in 4D.
- Parameters:
ring (Lattice) – Lattice description
xm (float) – Maximum x amplitude
ym (float) – Maximum y amplitude
npoints (int) – Number of points in each plane
nturns (int) – Number of turns for tracking
method –
'laskar'or'fft'. Default:'laskar'num_harmonics – Number of harmonic components to compute (before mask applied)
fmin – Lower bound for tune
fmax – Upper bound for tune
hann – Turn on Hanning window. Default:
False
- Returns:
q0 (ndarray) – qx, qy from horizontal and vertical amplitude scans. Fit results with shape (2, 2). Only the fractional part is returned
q1 (ndarray) – Amplitude detuning coefficients with shape (2, 2)
[[dQx/dJx, dQy/dJx], [dQx/dJy, dQy/dJy]]x (ndarray) – x amplitudes (npoints, )
q_dx (ndarray) – qx, qy tunes as a function of x amplitude (npoints, 2) Only the fractional parts are returned
y (ndarray) – y amplitudes (npoints, )
q_dy (ndarray) – qx, qy tunes as a function of y amplitude (npoints, 2) Only the fractional parts are returned
- gen_detuning_elem(ring, orbit=None, orbit6=None, qpx=None, qpy=None, detuning_coeff=None, alphac=None, dp=None)[source]#
Generates a detuning element.
The detuning coefficients and chromaticities are computed in using the 4D lattice model if they are not provided by the user.
- Parameters:
ring (Lattice) – Lattice description
orbit (ndarray | None) – Avoids looking for initial the closed orbit if it is already known ((6,) array).
qpx (Sequence[float] | None) – horizontal chromatic detuning coefficients. Default None. If specified qpy should also be provided, if not first order term computed automatically from ring. Higher order terms can be calculated with physics.chromaticity()
qpy (Sequence[float] | None) – vertical chromatic detuning coefficients. Default None. If specified qpy should also be provided, if not first order term computed automatically from ring. Higher order terms can be calculated with physics.chromaticity()
detuning_coeff (Sequence[float] | None) – First order amplitude detuning coefficients [dQx/dJx, dQx/dJy, dQy/dJy]. Default None: coefficient computer from ring. Can be claculated with physics.detuning()
alphac (Sequence[float] | None) – Higher order momentum compaction factor. Default None. Can be Can be claculated with physics.mcf()
- Returns:
nonlin_elem – DeltaQ Element reproducing the detuning of the ring with amplitude and momentum
- tunes_vs_amp(ring, amp=None, dim=0, nturns=512, dp=None, **kwargs)[source]#
Generates a range of tunes for varying x, y, or z amplitudes.
- Parameters:
ring (Lattice) – Lattice description
amp (Sequence[float] | None) – Oscillation amplitude. If amp is None the tunes are calculated from
linopt6()else tracking is useddim (int) – Coordinate index of the oscillation
nturns (int) – Number of turns
method –
'laskar'or'fft'. Default:'laskar'num_harmonics – Number of harmonic components to compute (before mask applied)
fmin – Lower bound for tune
fmax – Upper bound for tune
hann – Turn on Hanning window. Default:
False
- Returns:
tunes (ndarray) – Array of tunes qx, qy with shape (len(amp), 2)