Skip to content
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 space-charge to Cheetah #142

Merged
merged 127 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
2a02165
save test
Mar 21, 2024
8c0cbd3
first commit
Apr 5, 2024
610f706
maj1
greglenerd Apr 5, 2024
99f3c53
commit2
greglenerd Apr 5, 2024
7900034
com
greglenerd Apr 5, 2024
96e7fa3
c
greglenerd Apr 5, 2024
f25065e
c
greglenerd Apr 5, 2024
f914e2b
c
greglenerd Apr 5, 2024
b01d4fe
c
greglenerd Apr 5, 2024
357840e
Update of charge deposition. First draft of poisson solver
greglenerd Apr 5, 2024
e1f8785
added space_cherge_deposition_vec for faster computation. First draft…
greglenerd Apr 10, 2024
4565920
First version of the whole IGF solver. Works with one particle, but s…
greglenerd Apr 11, 2024
27632d7
Update cheetah/accelerator.py
greglenerd Apr 11, 2024
1b5535e
vectorized version of the code
greglenerd Apr 11, 2024
d7846c4
first "complete" version of the code, with the track method implement…
greglenerd Apr 25, 2024
61f6723
version that runs correctly, need to be quantitatively tested
greglenerd Apr 26, 2024
0e57d2a
Draft version of the code, tested with the test_space_charge_kick.py …
greglenerd Apr 30, 2024
8c9c3fc
minor written chqnges to accelerator.py
greglenerd May 3, 2024
1c18884
Update cheetah/accelerator.py
greglenerd May 6, 2024
342e162
Update cheetah/accelerator.py
greglenerd May 6, 2024
6821781
Update cheetah/accelerator.py
greglenerd May 6, 2024
3263513
Update cheetah/accelerator.py
greglenerd May 6, 2024
1b8b60d
Update cheetah/accelerator.py
greglenerd May 6, 2024
6220fb7
Update cheetah/accelerator.py
greglenerd May 6, 2024
f90cef1
Update cheetah/accelerator.py
greglenerd May 6, 2024
be0b706
before pulling the suggested changes
greglenerd May 6, 2024
cfecc6c
Merge branch 'space_charge' of https://github.com/greglenerd/cheetah …
greglenerd May 6, 2024
6ed5a74
Update cheetah/accelerator.py
greglenerd May 6, 2024
6bc41e7
.
greglenerd May 6, 2024
ff4ae36
Merge branch 'space_charge' of https://github.com/greglenerd/cheetah …
greglenerd May 6, 2024
db5876d
Update cheetah/accelerator.py
greglenerd May 6, 2024
96a6220
Update cheetah/accelerator.py
greglenerd May 6, 2024
5da3b8f
Update cheetah/accelerator.py
greglenerd May 6, 2024
7d12f0f
Update cheetah/accelerator.py
greglenerd May 6, 2024
4dcf3cb
Update tests/test_space_charge_kick.py
greglenerd May 6, 2024
3534a5b
Update cheetah/accelerator.py
greglenerd May 6, 2024
304c445
Update cheetah/accelerator.py
greglenerd May 6, 2024
2b787d3
Update cheetah/accelerator.py
greglenerd May 6, 2024
ea8bac2
Update cheetah/accelerator.py
greglenerd May 6, 2024
d9bb152
cleaning
greglenerd May 6, 2024
10d1bbb
Merge branch 'space_charge' of https://github.com/greglenerd/cheetah …
greglenerd May 6, 2024
85a6edd
new test, little change in accelerator.py
greglenerd May 7, 2024
86247e1
Merge branch 'desy_master' into space_charge_merged
greglenerd May 7, 2024
ed861b8
start adapting to PR 116
greglenerd May 7, 2024
1ea0d51
Fix bugs associated with array shapes
RemiLehe May 8, 2024
d456418
Fix initialization of the Green function
RemiLehe May 9, 2024
d8bbc5d
Fix errors with shapes
RemiLehe May 9, 2024
9b2d4f1
Fix remaining bugs
RemiLehe May 9, 2024
86c7d89
Fix test
RemiLehe May 9, 2024
4c9c94a
Merge pull request #1 from RemiLehe/space_charge_merged
greglenerd May 10, 2024
8f03a20
Merge branch 'master' into space_charge
jank324 May 14, 2024
28febad
Reformat code with `black`
RemiLehe May 23, 2024
5e86219
Merge remote-tracking branch 'public/master' into space_charge
RemiLehe May 28, 2024
975d4db
Merge branch 'master' into space_charge
jank324 May 29, 2024
7b555b8
Fix CI
RemiLehe May 31, 2024
d2de1fc
Fix CI
RemiLehe May 31, 2024
0da8484
Apply isort corrections
RemiLehe May 31, 2024
cf5119f
Apply flake8 corrections
RemiLehe May 31, 2024
a607d8d
Apply suggestions from code review
cr-xu Jun 4, 2024
527e416
black formatting
cr-xu Jun 4, 2024
0dc127f
Apply suggestions from code review
cr-xu Jun 4, 2024
68cb8ee
Merge branch 'master' into space_charge
jank324 Jun 6, 2024
71f421c
Set the random seed in space charge test
RemiLehe Jun 9, 2024
0b64405
Apply suggestions from code review
RemiLehe Jun 9, 2024
42c390c
Update test file
RemiLehe Jun 9, 2024
4a756de
Add docstrings
RemiLehe Jun 9, 2024
e38111b
Change a few names
RemiLehe Jun 9, 2024
ed7c924
Reformat files
RemiLehe Jun 9, 2024
665aabc
Apply suggestions from code review
RemiLehe Jun 11, 2024
bcd9703
Update name: n_batch -> batch_size
RemiLehe Jun 11, 2024
9947d97
Update formatting
RemiLehe Jun 11, 2024
5e87d63
Merge branch 'master' into space_charge
jank324 Jun 13, 2024
3db651b
Move random seed to individual test functions
jank324 Jun 15, 2024
bbb3057
Add test for space charge gradient computation
jank324 Jun 15, 2024
f7dd7a2
Minor formating changes
jank324 Jun 15, 2024
fd0be7a
Replace obvious in-place operations with out-of-place alternatives
jank324 Jun 15, 2024
98cbaf5
Fix in-place gradient error
jank324 Jun 15, 2024
27e58ab
Revert "Replace obvious in-place operations with out-of-place alterna…
jank324 Jun 15, 2024
e9a1f47
Add test to check if space charge works vectorised accroding to #116
jank324 Jun 15, 2024
cf629ca
Implement mostly functional vectorisation for space charge
jank324 Jun 16, 2024
d505d57
First `index_put_` location where vectorisation didn't work
jank324 Jun 18, 2024
81921ba
Add test to check that vectorisation doesn't just not crash but also …
jank324 Jun 18, 2024
78da8c5
Fix test name for better test selection
jank324 Jun 18, 2024
b9725ff
Fix shape issue in vectorised beam expansion test and add segment len…
jank324 Jun 18, 2024
ae1de55
Fix gradient issue
jank324 Jun 18, 2024
161e759
Refactor `gammaref`
jank324 Jun 18, 2024
20d4db0
Refactor `betaref`
jank324 Jun 18, 2024
83e2b6b
Refactor moments computations
jank324 Jun 18, 2024
e66a08e
Remove unused constants
jank324 Jun 18, 2024
c447667
Fix length computation
jank324 Jun 18, 2024
7b57805
Remove out-of-date todo
jank324 Jun 18, 2024
cc225bb
Add `SpaceChargeKick` to documentation
jank324 Jun 18, 2024
bab431d
Merge branch 'master' into space_charge
jank324 Jun 18, 2024
35d80c4
Fix issues in `_compute_forces_`
cr-xu Jun 19, 2024
396d840
Fix index out of range issue
cr-xu Jun 19, 2024
043c7b0
Merge branch 'master' into space_charge
jank324 Jun 19, 2024
2b15344
Add entry to changelog
jank324 Jun 19, 2024
2fe41b1
Merge branch 'space_charge' of github.com:greglenerd/cheetah into spa…
jank324 Jun 19, 2024
16d3b77
Remove not-needed `atol` as per comment by @ax3l
jank324 Jun 19, 2024
3d8b97d
Remove `try_batched` notebook
jank324 Jun 19, 2024
fea6c83
Implement plotting for `SpaceChargeKick`
jank324 Jun 19, 2024
fd9ee34
Use int instead of long
RemiLehe Jun 19, 2024
922417b
Updates to and from moments conversion method names
jank324 Jun 20, 2024
2a47899
Merge branch 'space_charge' of github.com:greglenerd/cheetah into spa…
jank324 Jun 20, 2024
b00784c
Merge branch 'master' into space_charge
jank324 Jun 20, 2024
86ffa53
Change `SpaceChargeKick` plotting to a single line
jank324 Jun 20, 2024
61cd0b4
Implement `SpaceChargeKick.defining_features`
jank324 Jun 20, 2024
a53a450
Implement `SpaceChargeKick.__repr__`
jank324 Jun 20, 2024
2ca6cf8
Move grid extent sigma comment up by one line
jank324 Jun 20, 2024
4092d82
Improve docstring and comments
cr-xu Jun 21, 2024
5e3df78
Update cheetah/particles/particle_beam.py
cr-xu Jun 21, 2024
f3aea76
Slight change to comment formatting
jank324 Jun 21, 2024
1e8235a
Fix flake8 warning
jank324 Jun 21, 2024
3e2503a
Improve docstring for `from_xyz_pxpypz` as well
jank324 Jun 21, 2024
c813416
Tiny formating improvement
jank324 Jun 21, 2024
d0ccaa7
Fix main docstring
jank324 Jun 21, 2024
daa08b9
Another fix to the docstring
jank324 Jun 21, 2024
595ab2c
Attempt to fix docstring bullet point rendering
jank324 Jun 21, 2024
4d9b311
Another bullet point docstring fix
jank324 Jun 22, 2024
ee07a52
Some refactoring
RemiLehe Jun 25, 2024
1a0131c
Simplify division by cell volume
RemiLehe Jun 25, 2024
913e1a8
Update a few docstrings
RemiLehe Jun 25, 2024
42e4faf
Reduce length of lines
RemiLehe Jun 25, 2024
ee2096e
Update name from moments to xp_coordinates
RemiLehe Jun 25, 2024
1e1888f
Use rfft and irfft
RemiLehe Jun 25, 2024
b2e45c0
Change from moments to xp_coords
RemiLehe Jun 25, 2024
f31034f
Merge branch 'master' into space_charge
jank324 Jun 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- `CustomTransferMap` elements created by combining multiple other elements will now reflect that in their `name` attribute (see #100) (@jank324)
- Add a new class method for `ParticleBeam` to generate a 3D uniformly distributed ellipsoidal beam (see #146) (@cr-xu, @jank324)
- Add Python 3.12 support (see #161) (@jank324)
- Implement space charge using Green's function in a `SpaceChargeKick` element (see #142) (@greglenerd, @RemiLehe, @ax3l, @cr-xu, @jank324)

### 🐛 Bug fixes

Expand Down
1 change: 1 addition & 0 deletions cheetah/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Screen,
Segment,
Solenoid,
SpaceChargeKick,
Undulator,
VerticalCorrector,
)
Expand Down
1 change: 1 addition & 0 deletions cheetah/accelerator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
from .screen import Screen # noqa: F401
from .segment import Segment # noqa: F401
from .solenoid import Solenoid # noqa: F401
from .space_charge_kick import SpaceChargeKick # noqa: F401
from .undulator import Undulator # noqa: F401
from .vertical_corrector import VerticalCorrector # noqa: F401
2 changes: 1 addition & 1 deletion cheetah/accelerator/quadrupole.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def plot(self, ax: plt.Axes, s: float) -> None:
def defining_features(self) -> list[str]:
return super().defining_features + ["length", "k1", "misalignment", "tilt"]

def __repr__(self) -> None:
def __repr__(self) -> str:
return (
f"{self.__class__.__name__}(length={repr(self.length)}, "
+ f"k1={repr(self.k1)}, "
Expand Down
Loading