-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add twiss parameter calculations #63
Conversation
So this seems to work now. Here are a couple points we might need to think about:
@property
def emittance_x(self) -> torch.Tensor:
return torch.sqrt(
self.sigma_x**2 * self.sigma_xp**2
- torch.mean((self.xs - self.mu_x) * (self.xps - self.mu_xp)) ** 2
) the second part of this after the tws.xpx = np.mean((x - tws.x) * (px - tws.px)) which I thought is the same as
|
Now this is correct. where
I think it is sufficient for now.
|
But this term cov=torch.tensor(
[
[sigma_x**2, cor_x, 0, 0, 0, 0, 0],
[cor_x, sigma_xp**2, 0, 0, 0, 0, 0],
[0, 0, sigma_y**2, cor_y, 0, 0, 0],
[0, 0, cor_y, sigma_yp**2, 0, 0, 0],
[0, 0, 0, 0, sigma_s**2, cor_s, 0],
[0, 0, 0, 0, cor_s, sigma_p**2, 0],
[0, 0, 0, 0, 0, 0, 0],
],
dtype=torch.float32,
), |
Make partial results of twiss parameter computations properties of their own Co-authored-by: Chenran Xu <[email protected]>
oops somehow the suggestion feature in GitHub messes up the indentation, now it's hopefully fixed |
Okay ... so I think all that's missing is to create beams from twiss parameters. |
Now the |
Adding twiss parameters of properties of the
Beam
class. This way they can easily be a computed from trackedParameterBeam
andParticleBeam
.