Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
at.beam
again ! The present version processes either fully coupled 6x6 sigma matrices, or fully decoupled (3 2x2 independent matrices). But it misses two common cases:In both cases, 6x6 analysis fails and
at.beam
falls back the the uncoupled case, which is wrong.In this PR, we try in order the following cases:
(The coupled V-δ case where εx=0 is not handled but looks unrealistic).
The following figures show the improvement. We consider a simplified radiation source: equilibrium emittance in horizontal and longitudinal planes, zero vertical emittance. The Σ-matrix is built with
at.sigma_matrix
using thetwiss_in
keyword argument, looking at a dispersive region of the ring. Withat.beam
we generate a particle distribution (1000 particles), and we rebuild the Σ-matrix from the particle distribution (at.sigma_matrix
with thebeam
keyword argument).Figure 1: master branch
The original projection of the Σ-matrix on the x-δ plane shows the correlation. The particle distribution has the right σx and σδ but not the right correlation, so the rebuilt Σ-matrix is wrong.
Figure 2: this branch
Now the particle distribution has the right correlation, and the re-built Σ is very close to the initial one, even with only 1000 particles.
Note: the figures above make use of a
at.plot.plot_sigma()
function which appear in another pull request