-
Notifications
You must be signed in to change notification settings - Fork 10
Update several parameters, element kinds #127
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
base: main
Are you sure you want to change the base?
Conversation
|
I just edited the PR description and removed the template text, so you can add a description specific to the changes in this PR. |
source/parameters/beambeam.md
Outdated
| 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). |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that looks good.
There was a problem hiding this comment.
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.
source/parameters/beambeam.md
Outdated
| xdisp # The horizontal displacement of the opposite beam (default: 0 m). | ||
| ydisp # The vertical displacement of the opposite beam (default: 0 m). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.
source/parameters/beambeam.md
Outdated
| sigx # The horizontal beam size of the opposite beam (default: 0 m). | ||
| sigy # The vertical beam size of the opposite beam (default: 0 m). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
There was a problem hiding this comment.
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.
source/parameters/initialparticle.md
Outdated
| The components of this group are: | ||
| ```{code} yaml | ||
| InitialParticleP: | ||
| Distype: "" # [string] name of initial distribution type |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
source/parameters/beambeam.md
Outdated
| sigx # The horizontal beam size of the opposite beam (default: 0 m). | ||
| sigy # The vertical beam size of the opposite beam (default: 0 m). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
source/parameters/tracking.md
Outdated
| The components of this group are: | ||
| ```{code} yaml | ||
| ReferenceP: | ||
| tracking_type: "" # [string] type of tracking |
There was a problem hiding this comment.
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.
source/element-kinds.md
Outdated
|
|
||
| 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
source/element-kinds.md
Outdated
| 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
source/element-kinds.md
Outdated
| It uses the hkick and vkick parameters to deflect the beam in | ||
| horizontal and vertical directions. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Co-authored-by: Chad Mitchell <[email protected]>
| 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> | ||
| ``` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.)?
Co-authored-by: Chad Mitchell <[email protected]>
Co-authored-by: Chad Mitchell <[email protected]>
source/element-kinds.md
Outdated
| t_offset: 0.1e-8 | ||
| scale_multipoles: = F | ||
| b1: = 0.27 | ||
| amplitude_vs_time: = {(-1.2e-6, 0.02), ... } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
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. |
| ```{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). | ||
| ``` |
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
source/element-kinds.md
Outdated
| cc1: | ||
| kind: CrabCavity | ||
| frequency: 394.0e6 | ||
| phase: 0.0 | ||
| voltage: 1.0e6 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DavidSagan fixed.
source/element-kinds.md
Outdated
| ## Kicker Element | ||
|
|
||
| Particle kicker element. | ||
| A kicker element is an element that can deflect a beam transversely in both planes. |
There was a problem hiding this comment.
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)?
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EZoni fixed.
| 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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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,...?
List of new or updated parameters:
List of new or updated element kinds: