Skip to content
# New features

## Add various kind of loops and feedback for CavityResonator class
Add an interface in CavityResonator to allow for external FB and loops.
Add generator_phasor_record and ig_phasor_record attributes to CavityResonator.
Also change CavityMonitor and plot_cavitydata to record and display the new attributes.
Add ProportionalLoop, TunerLoop, ProportionalIntegralLoop and DirectFeedback class.
Add update_feedback method to CavityResonator to force FB update when needed.
Update CavityMonitor to now record Vc and theta.
Add option "mean" to plot_cavitydata to plot the mean phasor voltage and angle versus time for non empty bunches.
Add option "tuner_diff" to plot_cavitydata to plot the phase difference between cavity and generator current.
Add sample_voltage method to CavityResonator, used to sample the voltage seen by a zero charge particle during an RF period.

## Add higher order momentum compaction factor
Add mcf_order optional parameter for Synchrotron class to prodivde higher-orders momentum compaction factor.
Add Synchrotron.get_mcf_order method to compute momentum compaction factor up to 3rd order from AT lattice.
Add Synchrotron.get_longitudinal_twiss method to compute the longitudinal Twiss parameters and the synchrotron tune for single or multi-harmonic RF systems.
The longitudinal invariant Js is now computed in Bunch.cs_invariant and Beam.bunch_cs and save by BeamMontior and BunchMonitor, its value is 0 by default if the longitudinal Twiss parameters are not provided in the Synchrotron class.

## Other new features
Add monopolar component to WakeField and WakePotential class.
Add loss_factor computation for WakeFunction class.
Update read_ABCI function so it can now read files with monopolar and dipolar components together.
Added group_attributes and rename_attribute convenience methods to the ImpedanceModel class.
Add share_stds method to Mpi class.
Update spectral_density function with Chebyshev, Legenre and Sacherer modes.
Add head_tail_form_factor and tune_shift_from_effective_impedance functions.
Various small improvements.

## Project management
Add pyproject.toml and pypi integration through poetry.
Reformat the code using the yapf and isort formatters.

# Bugfix
Fix Bunch.plot_phasespace for up to date version of seaborn.
Fix Bunch.emit calculation for off center beams.
Fix the sign of long wake in LongRangeResistiveWall.
Fix Hermite mode to include normalisation by the mode number.
Fix various typo and docstrings.

# Authors who took part in this commit
Alexis Gamelin, Naoto Yamamoto, Vadim Gubaidulim