Skip to content

Aperture modelling tools for Xtrack#753

Open
szymonlopaciuk wants to merge 79 commits intoxsuite:mainfrom
szymonlopaciuk:aperture-model
Open

Aperture modelling tools for Xtrack#753
szymonlopaciuk wants to merge 79 commits intoxsuite:mainfrom
szymonlopaciuk:aperture-model

Conversation

@szymonlopaciuk
Copy link
Copy Markdown
Collaborator

@szymonlopaciuk szymonlopaciuk commented Feb 19, 2026

Description

First prototype of the aperture modelling functionality. See the examples for usage and the associated physics manual PR xsuite/xsuite#809.

Needs: xsuite/xobjects#169.

Currently allows:

  • Loading an aperture model from a line with limits, a line with MAD-X metadata, or a line with associated_apertures defined on elements.
  • Calculation of the n1 using different methods: by bisecting the beam envelope on the aperture polygon (bisection), using a linear-complexity approximated rays method, and a more precise quadratic-in-rays exact method.
  • Calculation of the beam envelope at arbitrary sigmas and pipe cross sections.
  • Can interpolate cross sections, even in curved, arbitrarily transformed types, with arbitrarily transformed profiles.

Caveats:

  • GPU support not yet implemented.
  • Interpolation along curved types uses an approximation (that should be "good enough" but should be kept in mind).

Checklist

Mandatory:

  • I have added tests to cover my changes
  • All the tests are passing, including my new ones
  • I described my changes in this PR description

Optional:

  • The code I wrote follows good style practices (see PEP 8 and PEP 20).
  • I have updated the docs in relation to my changes, if applicable
  • I have tested also GPU contexts

@szymonlopaciuk szymonlopaciuk force-pushed the aperture-model branch 2 times, most recently from 1956e0c to 4d882db Compare March 17, 2026 12:05
@szymonlopaciuk szymonlopaciuk changed the title First prototype of aperture modelling functionality Aperture modelling tools for Xtrack Mar 30, 2026
@szymonlopaciuk szymonlopaciuk requested a review from giadarol March 30, 2026 07:16
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