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

Track Covariance Map #814

Draft
wants to merge 9 commits into
base: development
Choose a base branch
from

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)
  • documentation

@ax3l ax3l added the component: core Core ImpactX functionality label Jan 27, 2025
src/ImpactX.cpp Fixed Show fixed Hide fixed
@ax3l ax3l force-pushed the topic-track-covariance-map branch 3 times, most recently from 3b71d60 to a91748a Compare January 27, 2025 23:34
src/ImpactX.cpp Outdated Show resolved Hide resolved
@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core Core ImpactX functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants