Add MagSpec to the simulation/experiment comparison - #26
Merged
Conversation
aeriforme
added a commit
that referenced
this pull request
Jul 8, 2025
* extract magn spec data - first attempt * train params passed as arguments to initialize the beam, added comments to calculate sim spectrum * finalize inclusion of MagSpec * Remove unused file * Update environment requirement --------- Co-authored-by: ariannaformenti@lbl.gov <aforment@login32.chn.perlmutter.nersc.gov> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
RemiLehe
added a commit
that referenced
this pull request
Jul 9, 2025
* Add Aline screens * Use formula for r56 in microns (#18) * Updates to chicane (angle from R56, angle signs, degrees in ExactSbend) * Update lattice so that it works with torch * Add possibility to run lattice with Cheetah linear model (#19) * Add current-dependence of EMQ quads. (#21) * Add current-dependence of EMQ quads. * Separate current dependence for short and long EMQs. * Minor changes to the code Update interface --------- Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Add notebook demonstrating Bayesian optimization with Xopt (#20) * Add new file for optimization * Use Xopt for optimization * Make calculation faster * Add optimization with prior mean * Add prior mean * Add README and environment file * Update notebook * Add documentation * Feed current as input * Various improvements: - Use NL model - Use differentiability in prior - Better potting * Fix random seed * extract magn spec data - first attempt * train params passed as arguments to initialize the beam, added comments to calculate sim spectrum * finalize inclusion of MagSpec * ImpactX: Silent Run Silent run, holy run. All is calm, all is bright. * Add Scripts for RL_Controller Development (#15) * Add gitignore * Add Scripts for RL Development * Update environment * Remove unused files --------- Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Fix Conda Env (#27) On Ubuntu 24.04, Conda has issues resolving some of the explicitly pinned packages. Relaxing them to write a more general environment file that works better across platforms. * RL Training: Fix Missing Import See #30 * Rename `HTUCheetah` to `HTUSimulation` with new `kwarg` named `code="cheetah"` * Use SI units for quad magnetic field gradient. * Modify kicker inputs * Modify dipole inputs. * Undo comment hash. * Notebook containing both Cheetah and ImpactX, draft. * Update notebook to include additional figures, etc. * Specify number of macroparticles consistently in both codes. * Access ImpactX output without going through files. * RL Training: ImpactX Init * RL Training: ImpactX Magnet Control * RL Training: ImpactX Track Particles * RL Training: Beam Init * RL Training: get_beam_parameters * RL Training: get_magnets * RL Training: get_incoming_parameters * RL Training: reset_accelerator * Cleanup unused comment line Co-authored-by: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> * Optimize Lattice Files (#38) This adds two optimizations for the HTU lattice files. For many workflows, e.g., training, we do not need to create screens and can save diags/IO time. The new `get_lattice(..., screens_as_markers=True/False)` option adds this optimization. By default, screens are `True`, as before this PR. For the non-linear maps we use for tracking, we do not need to apply slicing, since we do not calculate collective effects. (Sets `nslice=1` for ImpactX.) * Notebook containing both Cheetah and ImpactX, draft. * Update notebook to include additional figures, etc. * Specify number of macroparticles consistently in both codes. * Add MagSpec to the simulation/experiment comparison (#26) * extract magn spec data - first attempt * train params passed as arguments to initialize the beam, added comments to calculate sim spectrum * finalize inclusion of MagSpec * Remove unused file * Update environment requirement --------- Co-authored-by: ariannaformenti@lbl.gov <aforment@login32.chn.perlmutter.nersc.gov> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Set manual seed * add Alines, first attempt * finalize alines * Add notebook back --------- Co-authored-by: Chad Mitchell <ChadMitchell@lbl.gov> Co-authored-by: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Co-authored-by: ariannaformenti@lbl.gov <aforment@login32.chn.perlmutter.nersc.gov> Co-authored-by: Arianna Formenti <ariannaformenti@lbl.gov> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: dwang2-github <61247286+dwang2-github@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Include the MagSpec experimental diagnostic (distribution of electrons in energy or in longitudinal momentum) to the training.
Must use Cheetah PR #488.