Skip to content

Commit

Permalink
Update README to match new broadcasting semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
jank324 committed Oct 3, 2024
1 parent dcb6318 commit e35c7d1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ from cheetah import BPM, Drift, HorizontalCorrector, Segment, VerticalCorrector
segment = Segment(
elements=[
BPM(name="BPM1SMATCH"),
Drift(length=torch.tensor([1.0])),
Drift(length=torch.tensor(1.0)),
BPM(name="BPM6SMATCH"),
Drift(length=torch.tensor([1.0])),
VerticalCorrector(length=torch.tensor([0.3]), name="V7SMATCH"),
Drift(length=torch.tensor([0.2])),
HorizontalCorrector(length=torch.tensor([0.3]), name="H10SMATCH"),
Drift(length=torch.tensor([7.0])),
HorizontalCorrector(length=torch.tensor([0.3]), name="H12SMATCH"),
Drift(length=torch.tensor([0.05])),
Drift(length=torch.tensor(1.0)),
VerticalCorrector(length=torch.tensor(0.3), name="V7SMATCH"),
Drift(length=torch.tensor(0.2)),
HorizontalCorrector(length=torch.tensor(0.3), name="H10SMATCH"),
Drift(length=torch.tensor(7.0)),
HorizontalCorrector(length=torch.tensor(0.3), name="H12SMATCH"),
Drift(length=torch.tensor(0.05)),
BPM(name="BPM13SMATCH"),
]
)
Expand All @@ -58,7 +58,7 @@ segment = Segment.from_ocelot(cell)
All elements can be accesses as a property of the segment via their name. The strength of a quadrupole named _AREAMQZM2_ for example, may be set by running

```python
segment.AREAMQZM2.k1 = torch.tensor([4.2])
segment.AREAMQZM2.k1 = torch.tensor(4.2)
```

In order to track a beam through the segment, simply call the segment like so
Expand Down

0 comments on commit e35c7d1

Please sign in to comment.