Tune footprint

The Line class provides a method to compute and optionally plot the tune footprint as illustrated in the following example.

Basic usage

See also: xtrack.Line.get_footprint()

import numpy as np

import xtrack as xt
import xpart as xp

import matplotlib.pyplot as plt

nemitt_x = 1e-6
nemitt_y = 1e-6


line = xt.Line.from_json(
    '../../test_data/hllhc15_noerrors_nobb/line_w_knobs_and_particle.json')
line.particle_ref = xp.Particles(mass0=xp.PROTON_MASS_EV, p0c=7e12)
line.build_tracker()

plt.close('all')
plt.figure(1)

# Compute and plot footprint
fp0 = line.get_footprint(nemitt_x=nemitt_x, nemitt_y=nemitt_y)
fp0.plot(color='k', label='I_oct=0')

# Change octupoles strength and compute footprint again
line.vars['i_oct_b1'] = 500
fp1 = line.get_footprint(nemitt_x=nemitt_x, nemitt_y=nemitt_y)
fp1.plot(color='r', label='I_oct=500')

# Change octupoles strength and compute footprint again
line.vars['i_oct_b1'] = -250
fp2 = line.get_footprint(nemitt_x=nemitt_x, nemitt_y=nemitt_y)
fp2.plot(color='b', label='I_oct=-250')

plt.legend()

plt.figure(2)

line.vars['i_oct_b1'] = 0
fp0_jgrid = line.get_footprint(nemitt_x=nemitt_x, nemitt_y=nemitt_y,
                         mode='uniform_action_grid')
fp0_jgrid.plot(color='k', label='I_oct=0')

# Change octupoles strength and compute footprint again
line.vars['i_oct_b1'] = 500
fp1_jgrid = line.get_footprint(nemitt_x=nemitt_x, nemitt_y=nemitt_y,
                            mode='uniform_action_grid')
fp1_jgrid.plot(color='r', label='I_oct=500')

# Change octupoles strength and compute footprint again
line.vars['i_oct_b1'] = -250
fp2_jgrid = line.get_footprint(nemitt_x=nemitt_x, nemitt_y=nemitt_y,
                         mode='uniform_action_grid')
fp2_jgrid.plot(color='b', label='I_oct=-250')

plt.legend()
plt.show()
_images/footprint_polar.png

Footprints produced with a polar grid.

_images/footprint_unif_action.png

Footprints produced with a uniform grid in action space.

Linear rescale on knobs

In some cases the effects introducing the detuning also introduce other effects (e.g. coupling, or non-linear resonances) that disturb the particles tune measurement. In this case it is possible to rescale quantify the detuning for smaller values of the knobs associate to the detuning effects and rescale to the actual value of the knob. This can be done by the linear_rescale_on_knobs option as illustrated in the following example for a case where the detuning with amplitude is introduced by beam-beam interactions.

See also: xtrack.Line.get_footprint()

import xtrack as xt


collider = xt.Multiline.from_json('./collider_03_tuned_bb_on.json')
collider.build_trackers()

fp_polar_no_rescale = collider['lhcb1'].get_footprint(nemitt_x=2.5e-6, nemitt_y=2.5e-6)

fp_polar_with_rescale = collider['lhcb1'].get_footprint(
    nemitt_x=2.5e-6, nemitt_y=2.5e-6,
    linear_rescale_on_knobs=[
        xt.LinearRescale(knob_name='beambeam_scale', v0=0.0, dv=0.1)]
    )
_images/footprint_bb_no_rescale.png

Footprints produced without rescaling beam-beam knob.

_images/footprint_bb_with_rescale.png

Footprints produced with rescaling beam-beam knob.