Skip to content

Support for offset and dispersion in initial beam distributions#984

Merged
ax3l merged 15 commits intoBLAST-ImpactX:developmentfrom
cemitch99:add_centroid_distribution_input
Jun 24, 2025
Merged

Support for offset and dispersion in initial beam distributions#984
ax3l merged 15 commits intoBLAST-ImpactX:developmentfrom
cemitch99:add_centroid_distribution_input

Conversation

@cemitch99
Copy link
Member

@cemitch99 cemitch99 commented Jun 6, 2025

This PR adds support for the following features:

  1. the user may specify a nonzero initial centroid offset for the beam distribution by setting e.g. meanx = 0.1, with corresponding inputs for all six phase space coordinates
  2. the user may specify a nonzero initial correlation between coordinate pairs (x,pt), (px,pt), (y,pt), or (py,pt), allowing the generation of a beam that is matched to a region with nonzero dispersion
  • add new user inputs
  • update beam generation routines
  • update Python bindings
  • update documentation
  • add benchmark example(s)

This closes Issues #922 and #970 .

@cemitch99 cemitch99 requested a review from RemiLehe June 10, 2025 23:18
@cemitch99 cemitch99 requested a review from ax3l June 18, 2025 17:49
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

This looks great!

I will apply a small patch in docs and then it can go in. There is a general issue with named args in the Python docs that we need to fix, but it is not related to this PR per se.

.. autofunction:: impactx.twiss

.. py:class:: impactx.distribution.Gaussian(lambdax, lambday, lambdat, lambdapx, lambdapy, lambdapt, muxpx=0.0, muypy=0.0, mutpt=0.0)
.. py:class:: impactx.distribution.Gaussian(lambdax, lambday, lambdat, lambdapx, lambdapy, lambdapt, muxpx=0.0, muypy=0.0, mutpt=0.0, meanx=0.0, meany=0.0, meant=0.0, meanpx=0.0, meanpy=0.0, meanpt=0.0, dispx=0.0, disppx=0.0, dispy=0.0, disppy=0.0)
Copy link
Member

Choose a reason for hiding this comment

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

I think the spelling of all those parameters in src/python/distribution.cpp (even before this PR) is actually case sensitive and has some uppercase letters, but we can fix that separately of this PR (and we try to automate the pick-up eventually via PRs like #699 )

Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

Implementation LGTM!

I think when we do the follow-up, we could rename a few parameters/variables to use _ between components for easier readability, e.g., m_meanpx as m_mean_px, etc.

@ax3l ax3l enabled auto-merge (squash) June 24, 2025 02:34
@ax3l ax3l merged commit 0ce2298 into BLAST-ImpactX:development Jun 24, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants