Skip to content

Add convenience method to get total phase advances from TEAPOT_MATRIX_Lattice + reformatting - #147

Draft
austin-hoover wants to merge 5 commits into
PyORBIT-Collaboration:mainfrom
austin-hoover:matrix-lattice-tune
Draft

austin-hoover wants to merge 5 commits into
PyORBIT-Collaboration:mainfrom
austin-hoover:matrix-lattice-tune

Conversation

@austin-hoover

Copy link
Copy Markdown
Contributor

Added method TEAPOT_MATRIX_Lattice.getTunes() which returns the tunes $\nu_x, \nu_y$. It just calls the method trackTwissDataX, which integrates through the lattice to get the phase advance as a function of position, and takes the phase advance at the last integration step.

Note that getRingParametersDict() returns the fractional phase advance from the one-turn matrix, not the total phase advance.

I also added type hints to this file.

@austin-hoover

Copy link
Copy Markdown
Contributor Author

Verified that the reformatting does not affect calculations. Before:

{'Ekin [GeV]': 1.2999999999999996,
 'alpha x': 0.04170263505574618,
 'alpha y': 0.03250788492204014,
 'beta x [m]': 11.484241377667265,
 'beta y [m]': 14.711577053277404,
 'dispersion prime x': 0.0029994494463154594,
 'dispersion prime y': 0.0,
 'dispersion x [m]': -0.09888446210253576,
 'dispersion y [m]': 0.0,
 'eta': -0.13892488592900948,
 'fractional tune x': 0.2301327537383606,
 'fractional tune y': 0.16037073821882294,
 'frequency [Hz]': 1097458.3265571904,
 'gamma transition': 5.212902355810395,
 'gamma x [m^-1]': 0.08722727754065196,
 'gamma y [m^-1]': 0.06804550993797799,
 'mass [GeV]': 0.938272029,
 'momentum [GeV/c]': 2.0321189127115566,
 'momentum compaction': 0.03679940695030118,
 'period [sec]': 9.111963304675772e-07,
 'transition energy [GeV]': 3.952848441365099}

After:

{'Ekin [GeV]': 1.2999999999999996,
 'alpha x': 0.04170263505574618,
 'alpha y': 0.03250788492204014,
 'beta x [m]': 11.484241377667265,
 'beta y [m]': 14.711577053277404,
 'dispersion prime x': 0.0029994494463154594,
 'dispersion prime y': 0.0,
 'dispersion x [m]': -0.09888446210253576,
 'dispersion y [m]': 0.0,
 'eta': -0.13892488592900948,
 'fractional tune x': 0.2301327537383606,
 'fractional tune y': 0.16037073821882294,
 'frequency [Hz]': 1097458.3265571904,
 'gamma transition': 5.212902355810395,
 'gamma x [m^-1]': 0.08722727754065196,
 'gamma y [m^-1]': 0.06804550993797799,
 'mass [GeV]': 0.938272029,
 'momentum [GeV/c]': 2.0321189127115566,
 'momentum compaction': 0.03679940695030118,
 'period [sec]': 9.111963304675772e-07,
 'transition energy [GeV]': 3.952848441365099}

@austin-hoover
austin-hoover marked this pull request as draft September 9, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant