diff --git a/py/orbit/matrix_lattice/MATRIX_Lattice.py b/py/orbit/matrix_lattice/MATRIX_Lattice.py index 22380391..35f808d4 100644 --- a/py/orbit/matrix_lattice/MATRIX_Lattice.py +++ b/py/orbit/matrix_lattice/MATRIX_Lattice.py @@ -9,7 +9,7 @@ """ import os import math - +import numpy as np # import bunch from orbit.core.bunch import Bunch @@ -112,6 +112,8 @@ def getRingParametersDict(self, momentum, mass): mt = self.oneTurnMatrix res_dict["fractional tune x"] = None res_dict["fractional tune y"] = None + res_dict["fractional tune 1"] = None + res_dict["fractional tune 2"] = None res_dict["alpha x"] = None res_dict["alpha y"] = None res_dict["beta x [m]"] = None @@ -138,6 +140,18 @@ def getRingParametersDict(self, momentum, mass): nuy = math.acos(cos_phi_y) / (2 * math.pi) * sign_y res_dict["fractional tune x"] = nux res_dict["fractional tune y"] = nuy + + # Eigentunes + M = np.array([[mt.get(i, j) for j in range(4)] for i in range(4)]) + eigvals, _ = np.linalg.eig(M) + eigvals = eigvals[[0, 2]] + cos_phi = np.real(eigvals) + phi = np.arccos(cos_phi) + nu = phi / (2.0 * np.pi) + nu %= 1.0 + res_dict["fractional tune 1"] = float(nu[0]) + res_dict["fractional tune 2"] = float(nu[1]) + # alpha, beta, gamma beta_x = mt.get(0, 1) / sin_phi_x beta_y = mt.get(2, 3) / sin_phi_y