Skip to content

Conversation

@ax3l
Copy link
Member

@ax3l ax3l commented Jan 27, 2025

Add a new runtime mode, tracking of 2nd moments in a covariance matrix.

  • generalize initialization Reorder Distribution Init #815
  • add map initialization to each element
  • add maps for core elements (drift, quad, bend, shortrf)
  • push loop
  • diagnostics
  • example(s): input file
  • example(s): Python
  • example(s): analysis / NaN pandas issue
  • documentation

Follow-up: add the implementation of space charge kicks (in envelope mode), following Issue #826

@ax3l ax3l added the component: core Core ImpactX functionality label Jan 27, 2025
@ax3l ax3l force-pushed the topic-track-covariance-map branch 3 times, most recently from 3b71d60 to a91748a Compare January 27, 2025 23:34
@ax3l ax3l force-pushed the topic-track-covariance-map branch from a91748a to ed344c9 Compare January 28, 2025 02:06
// small trick to force every derived class has to implement a method transport_map
// (w/o using a purely virtual function)
T_Element& element = *static_cast<T_Element*>(this);
cm *= element.transport_map(cm);
Copy link
Member

@cemitch99 cemitch99 Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this logic right? The function transport_map in each element takes the reference particle data as input, but this appears to call transport_map with the covariance matrix cm as input. Also, if the intent is to push the covariance matrix by the matrix R, then the math should look like cm = R * cm * R^T, which appears also ImpactX.cpp.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that is outdated. I only fixed it in ImpactX.cpp.

@cemitch99
Copy link
Member

Regarding user control of the run mode, I propose algo.envelope_mode = true/false, with false as the default (particle tracking).

@ax3l
Copy link
Member Author

ax3l commented Jan 31, 2025

We could also make it more general: algo.method =

  • envelope
  • reference_particle
  • tracking (default)

That way we have one flag for all planned modes and we can continue to add modes beyond 3 in the future :D (e.g., ensemble/batch variants of these modes or so)

@cemitch99
Copy link
Member

cemitch99 commented Jan 31, 2025

What about algo.mode = track_envelope, track_ref_part, track_particles, or similar? This could reflect the name of the function used in the push loop. I think "method" is maybe not descriptive enough, and could apply to any algorithm.

@ax3l
Copy link
Member Author

ax3l commented Jan 31, 2025

Perfect

@ax3l
Copy link
Member Author

ax3l commented Jan 31, 2025

Oh, or instead of mode we name it algo.track = envelope, ref_part, particles.

@cemitch99
Copy link
Member

That works, too. FYI: I used algo.mode = track_envelopes in the diagnostics PR, but it's a trivial change.

@ax3l ax3l force-pushed the topic-track-covariance-map branch from ed335ee to 9c39e1f Compare January 31, 2025 23:52
* Update DiagnosticOutput & Reduced Beam Diagnostics

---------

Co-authored-by: Axel Huebl <[email protected]>
@ax3l ax3l force-pushed the topic-track-covariance-map branch from 9c39e1f to fb58249 Compare January 31, 2025 23:55
Co-authored-by: Chad Mitchell <[email protected]>
ax3l added 4 commits February 6, 2025 14:04
Temporary/outdated from earlier code draft. Fix column headers.
@ax3l ax3l force-pushed the topic-track-covariance-map branch from 833c2fa to eb8a4f7 Compare February 6, 2025 23:07
cemitch99 and others added 4 commits February 6, 2025 17:02
Move the fields over as well, only used in particle tracking.
This continues to only push particles.
@ax3l ax3l enabled auto-merge (squash) February 7, 2025 01:22
@ax3l ax3l added this to the Advanced Methods (SciDAC-5) milestone Feb 7, 2025
@ax3l ax3l merged commit 9a721be into BLAST-ImpactX:development Feb 7, 2025
16 checks passed
@ax3l ax3l deleted the topic-track-covariance-map branch February 7, 2025 04:21
@ax3l ax3l mentioned this pull request Feb 7, 2025
if (compute_eigenemittances)
{
file_handler << " "
<< "emittance_xn" << " " << "emittance_yn" << " " << "emittance_tn";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-paste bug: Fix in #864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: core Core ImpactX functionality tracking: envelope

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants