Skip to content

Conversation

@qianglbl
Copy link

@qianglbl qianglbl commented Nov 17, 2025

List of new or updated parameters:

  • BeamBeamP
  • InitialParticleP
  • TrackingP

List of new or updated element kinds:

  • ACKicker
  • BeamBeam
  • BeginningEle
  • Converter
  • CrabCavity
  • EGun
  • Feedback
  • Fiducial
  • Foil
  • Fork
  • Girder
  • Instrument
  • kicker
  • Mask
  • Match
  • Patch
  • RFCavity
  • Taylor
  • Wiggler

@EZoni
Copy link
Member

EZoni commented Nov 17, 2025

@qianglbl

I just edited the PR description and removed the template text, so you can add a description specific to the changes in this PR.

sigy # The vertical beam size of the opposite beam (default: 0 m).
xdisp # The horizontal displacement of the opposite beam (default: 0 m).
ydisp # The vertical displacement of the opposite beam (default: 0 m).
charge # The charge of the opposite beam (default: 1 for proton).
Copy link
Member

Choose a reason for hiding this comment

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

Better would be
"charge: 0 # [unitless] Charge of particles of the opposite beam."
Also see the syntax used parameters (Example: https://pals-project.readthedocs.io/en/latest/element-parameters.html#bodyshiftp-element-body-orientation-and-position-parameters)

Copy link
Member

@EZoni EZoni Nov 19, 2025

Choose a reason for hiding this comment

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

@DavidSagan

Can you remind me/us, what syntax or style convention do we use to list parameters that don't have a default?

Is this it?

MyParameterGroupP:
  param1: 12.3  # [eV] A parameter with default value 12.3 in units of eV.
  param2:       # [eV] A parameter without default value in units of eV.
  param3:       # [unitless] A parameter without default value, unitless.

Or do we follow a different convention?

Also, how do you write the default specification if it's more intricate than a single value (e.g., with the for protons extra condition in this case)? Like this maybe?

MyParameterGroupP:
  param1: 12.3 (for protons)  # [eV] A parameter with default value 12.3 (conditional) in units of eV.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, so based on #129, this would be

MyParameterGroupP:
  param1: 12.3  # [eV] A parameter with default value 12.3 in units of eV.
  param2: null  # [eV] A parameter without default value in units of eV.
  param3: null  # [unitless] A parameter without default value, unitless.

correct?

Copy link
Member

Choose a reason for hiding this comment

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

I just put in a PR to clarify that null can be used to signify a lack of a default.

As for the syntax to use when there are multiple defaults, I have not thought about it.

Copy link
Member

Choose a reason for hiding this comment

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

Perfect.

So, @qianglbl, for now I think we would need to rewrite the lists in this PR following the convention described in my comment above, #127 (comment), namely again

MyParameterGroupP:
  param1: 12.3  # [eV] A parameter with default value 12.3 in units of eV.
  param2: null  # [eV] A parameter without default value in units of eV.
  param3: null  # [unitless] A parameter without default value, unitless.

Please let me know if you want to push a commit with this change or if I shall do it.

Copy link
Member

Choose a reason for hiding this comment

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

Yes that looks good.

Copy link
Author

Choose a reason for hiding this comment

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

@EZoni I can push a commit with this change.

Comment on lines 12 to 13
xdisp # The horizontal displacement of the opposite beam (default: 0 m).
ydisp # The vertical displacement of the opposite beam (default: 0 m).
Copy link
Member

Choose a reason for hiding this comment

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

Displacement and orientation can be handled by the BodyShiftP parameter group and do not need to be duplicated.

Copy link
Author

Choose a reason for hiding this comment

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

Agree.

Comment on lines 10 to 11
sigx # The horizontal beam size of the opposite beam (default: 0 m).
sigy # The vertical beam size of the opposite beam (default: 0 m).
Copy link
Member

Choose a reason for hiding this comment

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

For hourglass effect will be beta and alpha Twiss parameters.

Copy link
Author

Choose a reason for hiding this comment

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

The sigma is used to calculate beam-beam force kicks. For the hourglass effect, do you mean in beam-beam kick or luminosity?

Copy link
Member

Choose a reason for hiding this comment

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

The hourglass effect is the change in beam size due to changing Twiss beta as a function of longitudinal position.

Copy link
Author

Choose a reason for hiding this comment

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

It looks like you are thinking about 3D beam-beam instead of 2D beam-beam effects. In that case, one should add sigma_z too.

Copy link
Member

Choose a reason for hiding this comment

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

Correct.

Copy link
Author

Choose a reason for hiding this comment

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

@DavidSagan I updated the beambeam.md following the above discussion and pushed it back.

The components of this group are:
```{code} yaml
InitialParticleP:
Distype: "" # [string] name of initial distribution type
Copy link
Member

Choose a reason for hiding this comment

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

To be portable, the possible settings of distype (I think better is distribution_type) need to be documented.

Copy link
Author

Choose a reason for hiding this comment

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

Agreed.

Comment on lines 10 to 11
sigx # The horizontal beam size of the opposite beam (default: 0 m).
sigy # The vertical beam size of the opposite beam (default: 0 m).
Copy link
Member

Choose a reason for hiding this comment

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

This brings up the question as to whether the standard should use fuller names like sigma_x and sigma_y or shortened names like we have here.

Copy link
Author

Choose a reason for hiding this comment

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

@DavidSagan If we have used fuller names in the other parts of the standard, we should probably use the fuller names to be consistent.

The components of this group are:
```{code} yaml
ReferenceP:
tracking_type: "" # [string] type of tracking
Copy link
Member

Choose a reason for hiding this comment

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

This is in contrast to https://github.com/pals-project/pals/pull/119/files#diff-b31d07bf5b91fc4d9071400bebdba5dfa63f852f178f80b23d1612e1892b05f1 where the type of tracking can be set on a per-program basis. This raises the question as to whether a overall tracking method setting is useful.

@EZoni EZoni changed the title modified three files Update BeamBeamP, InitialParticleP, TrackingP Nov 19, 2025

An RFCavity element is an RF cavity without acceleration generally used in a storage ring. The main difference
between an rfcavity and an lcavity is that, unlike an lcavity, the reference energy through
an rfcavity is constant.
Copy link
Contributor

@cemitch99 cemitch99 Nov 20, 2025

Choose a reason for hiding this comment

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

Note: This is how things are done in the BMAD manual, but I'm not sure we should do this in PALS. Note that David didn't add a separate LCavity element or parameters, so I suspect he intended to combine the functionality into one element kind.

Copy link
Member

Choose a reason for hiding this comment

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

This should be discussed. The only difference in Bmad between RFCavity and Lcavity is the reference energy change.

Copy link
Author

Choose a reason for hiding this comment

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

I agree a combination one might be better.

Copy link
Author

Choose a reason for hiding this comment

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

I modified the description of the RFCavity element as follows:
An RFCavity element represents an RF cavity that accelerates or decelerates, and focuses or defocuses, a charged particle beam longitudinally and transversely using RF fields.

Element for simulating colliding beams.

Under Construction...
A BeamBeam element defines the parameters of a oppositely moving "strong" beam that generates electromagnetic fields at the interaction point. This strong beam is assumed to have a three-dimensional (3D) Gaussian density distribution.
Copy link
Member

Choose a reason for hiding this comment

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

Do we really want to have the assumption that the strong beam is Gaussian. If a program does not make this assumption then what kind of lattice element should it use?

Copy link
Author

Choose a reason for hiding this comment

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

If we don't assume a Gaussian distribution, then we might need more parameters than just sigmas for this element. On the other hand, without Gaussian assumption does allow more flexibility.

Global coordinate system fiducial point.
A Fiducial element is used to fix the position and orientation of the reference orbit within the global
coordinate system at the location of the fiducial element. A fiducial element will affect the global
floor coordinates (§16.2) of elements both upstream and downstream of the fiducial element.
Copy link
Member

Choose a reason for hiding this comment

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

Section numbers should not be hard coded.

Copy link
Author

Choose a reason for hiding this comment

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

Agreed.

Comment on lines 332 to 333
It uses the hkick and vkick parameters to deflect the beam in
horizontal and vertical directions.
Copy link
Member

Choose a reason for hiding this comment

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

Do we really want different names for kicks as opposed to zeroth order multipoles?

Copy link
Author

Choose a reason for hiding this comment

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

Probably not. I assume those two are parameters needed for this element.

Comment on lines 9 to 26
InitialParticleP:
distribution_type: "" # [string] name of initial distribution type
sigma_x: null # RMS x = sqrt(<x^2>)
sigma_px: null # RMS px = sqrt(<px^2>)
mu_xpx: null # <xpx>/(sigma_x*sigma_px) where <> denotes average over distribution
x_off: null # <x>
px_off: null # <px>
sigma_y: null # RMS y = sqrt(<y^2>)
sigma_py: null # RMS py = sqrt(<py^2>)
y_off: null # <y>
py_off: null # <py>
mu_ypy: null # <ypy>/(sigma_y*sigma_py)
sigma_z: null # RMS z = sqrt(<z^2>)
sigma_pz: null # RMS pz = sqrt(<pz^2>)
mu_zpz: null # <zpz>/(sigma_z*sigma_pz)
z_off: null # <z>
pz_off: null # <pz>
```
Copy link
Member

Choose a reason for hiding this comment

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

There are 21 moments so setting any should be available. How about something like sigma_xpy or sigma_14 for <x*py>. Also something like <xpx>/(sigma_x*sigma_px) will be singular if sigma_x or sigma_px are zero and these are redundant if sigma_14 notation is used.

Copy link
Author

Choose a reason for hiding this comment

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

@DavidSagan Agreed. I think that sigma_xpx might be better. I will add other moments.

Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to use a clearer notation for some of these quantities, e.g., <x p_x> instead of <xpx> (hence also <p_x> instead of <px>, etc.)?

Comment on lines 37 to 40
t_offset: 0.1e-8
scale_multipoles: = F
b1: = 0.27
amplitude_vs_time: = {(-1.2e-6, 0.02), ... }
Copy link
Member

Choose a reason for hiding this comment

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

This is derived from Bmad and I don't think this is a good fit for PALS. My feeling is that using an expression to define the AC waveform as a function of time is cleaner. In any case, all new parameters need to be well defined.

Copy link
Author

Choose a reason for hiding this comment

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

@DavidSagan Agreed. For an expression, we need to specify the form and number of parameters needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@DavidSagan This requires more discussion of how to support expressions. Maybe we should discuss during the PALS meeting.

@ax3l ax3l added the element parameters element parameters (properties, attributes) label Dec 3, 2025
@EZoni EZoni requested review from DavidSagan and EZoni December 3, 2025 17:35
@EZoni
Copy link
Member

EZoni commented Dec 3, 2025

@DavidSagan

When you have some time, could you resolve the conversations that you think have been resolved (I mean literally clicking the button to resolve them)? Just to understand better what remains to be done in this PR.

Comment on lines 8 to 20
```{code} yaml
BeamBeamP:
sigma_x: 0.001 # The horizontal beam size of the opposite beam (default: 1 mm).
sigma_y: 0.001 # The vertical beam size of the opposite beam (default: 1 mm).
sigma_z: 0.0 # The longitudinal beam size of the opposite beam (default: 0 m).
alpha_x: 0.0 # The horizontal Twiss parameter alpha at interaction point (default: 0).
beta_x: 1.0 # The horizontal Twiss parameter beta at interaction point (default 1 m).
alpha_y: 0.0 # The vertical Twiss parameter alpha at interaction point (default 0 m).
beta_y: 1.0 # The vertical Twiss parameter beta at interaction point (default 1 m).
charge: 1.0 # The charge of the opposite beam (default: 1 for proton).
energy: 1e12 # The total energy in eV of the opposite beam (default: 1e12.
N_particle: 0.0 # Number of particles in the opposite beam (default: 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 this doesn't follow the conventions we agreed on in #127 (comment), namely

MyParameterGroupP:
  param1: 12.3  # [eV] A parameter with default value 12.3 in units of eV.
  param2: null  # [eV] A parameter without default value in units of eV.
  param3: null  # [unitless] A parameter without default value, unitless.

Copy link
Member

Choose a reason for hiding this comment

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

Note that the comments here were meant to explain the meaning of the convention. For example, I don't think it's necessary to repeat the default values in the comment.

Copy link
Author

Choose a reason for hiding this comment

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

@EZoni I will clean up this a bit.

@EZoni EZoni changed the title Update BeamBeamP, InitialParticleP, TrackingP Update several parameters, element kinds Dec 3, 2025
Comment on lines 161 to 165
cc1:
kind: CrabCavity
frequency: 394.0e6
phase: 0.0
voltage: 1.0e6
Copy link
Member

Choose a reason for hiding this comment

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

Parameters like frequency are in the RFP group so a change is needed here.

Copy link
Author

Choose a reason for hiding this comment

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

@DavidSagan fixed.

## Kicker Element

Particle kicker element.
A kicker element is an element that can deflect a beam transversely in both planes.
Copy link
Member

Choose a reason for hiding this comment

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

Should this be Kicker (capital K)?

Suggested change
A kicker element is an element that can deflect a beam transversely in both planes.
A Kicker element is an element that can deflect a beam transversely in both planes.

Copy link
Author

Choose a reason for hiding this comment

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

@EZoni fixed.

Comment on lines +10 to +37
distribution_type: "" # [string] name of initial distribution type
x_off: null # <x>, <> denotes average over distribution
px_off: null # <px>
y_off: null # <y>
py_off: null # <py>
z_off: null # <z>
pz_off: null # <pz>
sigma_xx: null # <x^2>
sigma_pxpx: null # <px^2>
sigma_yy: null # <y^2>
sigma_pypy: null # <py^2>
sigma_zz: null # <z^2>
sigma_pzpz: null # <pz^2>
sigma_xpx: null # <xpx>
sigma_xy: null # <xy>
sigma_xpy: null # <xpy>
sigma_xz: null # <xz>
sigma_xpz: null # <xpz>
sigma_pxy: null # <pxy>
sigma_pxpy: null # <pxpy>
sigma_pxz: null # <pxz>
sigma_pxpz: null # <pxpz>
sigma_ypy: null # <ypy>
sigma_yz: null # <yz>
sigma_ypz: null # <ypz>
sigma_pyz: null # <pyz>
sigma_pypz: null # <pypz>
sigma_zpz: null # <zpz>
Copy link
Member

Choose a reason for hiding this comment

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

How about using numbers for subscripts? EG: sigma_24 instead of sigma_pypy? I could go either way but I just thought this should be considered.

Copy link
Author

Choose a reason for hiding this comment

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

@DavidSagan The reason that I used sigma_pypy instead of sigma_24 is because we have z_off and pz_off defined first. If we use sigma_24, should we change the first 6 centroid definition as off_1, off_2,... or mean_1, mean_2,...?

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

Labels

element parameters element parameters (properties, attributes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants