Skip to content

Commit

Permalink
Merge pull request #15 from desy-ml/14-confusing-variable-naming-in-m…
Browse files Browse the repository at this point in the history
…agnet-misalignment

Fix variable naming for misalignment treatment
  • Loading branch information
jank324 authored Jan 16, 2023
2 parents 1e6a4e4 + 7a91a06 commit a19f262
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cheetah/accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def transfer_map(self, energy):
if self.misalignment[0] == 0 and self.misalignment[1] == 0:
return R
else:
R_entry = torch.tensor(
R_exit = torch.tensor(
[
[1, 0, 0, 0, 0, 0, self.misalignment[0]],
[0, 1, 0, 0, 0, 0, 0],
Expand All @@ -280,7 +280,7 @@ def transfer_map(self, energy):
dtype=torch.float32,
device=self.device,
)
R_exit = torch.tensor(
R_entry = torch.tensor(
[
[1, 0, 0, 0, 0, 0, -self.misalignment[0]],
[0, 1, 0, 0, 0, 0, 0],
Expand All @@ -293,8 +293,7 @@ def transfer_map(self, energy):
dtype=torch.float32,
device=self.device,
)
R = torch.matmul(R_entry, R)
R = torch.matmul(R, R_exit)
R = torch.matmul(R_exit, torch.matmul(R, R_entry))
return R

@property
Expand Down

0 comments on commit a19f262

Please sign in to comment.