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

Question about electron beam parameters #580

Closed
zhangli28 opened this issue Apr 12, 2024 · 12 comments
Closed

Question about electron beam parameters #580

zhangli28 opened this issue Apr 12, 2024 · 12 comments
Assignees
Labels
component: distributions beam distributions question Further information is requested

Comments

@zhangli28
Copy link

zhangli28 commented Apr 12, 2024

Hi @n01r ,

I have a question about retrieving the electron beam parameter information.

In the plot_chicane.py example, does the following give electron beam transverse size and emittance evolution with propagation distance ?

sigx = list(map(lambda step_val: step_val[1][0] * millimeter, moments))
sign = list(map(lambda step_val: step_val[1][1] * millimeter, moments))
sigt = list(map(lambda step_val: step_val[1][2] * millimeter, moments))
emittance_x = list(map(lambda step_val: step_val[1][3] * nm_rad, moments))
emittance_y = list(map(lambda step_val: step_val[1][4] * nm_rad, moments))
emittance_t = list(map(lambda step_val: step_val[1][5] * nm_rad, moments))

here, x & y denotes the transverse direction (right ?)
but what is "t" for ?

Is it possible to get the same way twiss parameters of the electron beam ?

@n01r
Copy link
Member

n01r commented Apr 12, 2024

Hi @zhangli28,

Yes, x and y are the transverse directions and t denotes the canonical variable for the difference between arrival time of the beam particle and the reference particle. All coordinates in ImpactX are expressed in relation to a beam reference particle. See Coordinates & Units for more details.

The reference particle coordinates are written out in diags/ref_particle.*.

We also provide diagnostics directly for the Twiss parameters and other beam characteristics: See Reduced Beam Characteristics. :)

@zhangli28
Copy link
Author

Hi @n01r , thank you so much for prompt reply.

I will check the links you provided and see if I can understand what I am looking for.
I will come back if I will get confused at any point.

Thank you.

@n01r
Copy link
Member

n01r commented Apr 12, 2024

Yea, no worries, sounds good. :)

@zhangli28
Copy link
Author

Hi @n01r , I have some question about preparing the input electron beam parameters for impactX chicane file.

I tried to make 2 slides for putting my question. Please, can you see the attached file and say something what I should do.

chicane_input_parameters.pdf

@zhangli28
Copy link
Author

Hi @n01r , do you have any suggestion how to give input beam parameters ?

@n01r
Copy link
Member

n01r commented Apr 15, 2024

Hi @zhangli28, thank you for your slides! If I interpret them correctly then there may be a misunderstanding with the $\beta$ and $\gamma$.

It is unfortunate that in beam physics $\beta$ and $\gamma$ are the names for both the relativistic Lorentz parameters as well as the Courant-Snyder / Twiss parameters

In the theory section here we make that distinction in the text. Perhaps we could put a bigger note box there.
If you only have the $\sigma_x$, $\sigma_{p_x}$, etc. available you can use the relation ${\displaystyle \epsilon ^{2}=\langle x^{2}\rangle \langle x'^{2}\rangle -\langle xx'\rangle ^{2}}$ to get the emittance because ${\sigma_x}^2 = \langle x^2 \rangle$.

We have two methods for beam distribution input from analytical parameters at the moment:

  • one is via the axis intercepts of the phase space ellipse, which we called $\lambda$, where in, e.g., $\lambda_x = \sqrt{\epsilon_x / \gamma}$ and the $\gamma$ is the Courant-Snyder variable, not the Lorentz parameter.
  • the other is via the Courant-Snyder / Twiss parameters themselves

@zhangli28
Copy link
Author

Hi @n01r , thanks for clearing the confusion. I strongly support or recommend to use the beta_twiss, gamma_twiss for Twiss parameters and normal beta, gamma for relativistic factors. This way is self consistent.

I also strongly request to add (in the documentation) an example input file based on Courant-Snyder / Twiss parameters. This will really help the user.

The Courant-Snyder / Twiss parameters approach looks straight forward, but if you have any example file based on Courant-Snyder / Twiss parameters, can you give me.

Thank you.

@n01r
Copy link
Member

n01r commented Apr 16, 2024

We still need to document the distribution_generation or distgen example, but here is an input file: https://github.com/ECP-WarpX/impactx/blob/development/examples%2Fdistgen%2Finput_kvdist_twiss.in

@zhangli28
Copy link
Author

Hi @n01r , wow ! thank you for so kind and helpful. Thank you so many times.

@zhangli28 zhangli28 reopened this Apr 16, 2024
@zhangli28
Copy link
Author

zhangli28 commented Apr 16, 2024

Hi @n01r , one final question

"T" still not clear to me, if you help me to understand what alphaT, betaT and emittT are ? And how to find there values.

# is there any formula to calculate these values

beam.alphaT = 0.0          
beam.betaT = 0.5
beam.emittT = 2e-06

@ax3l ax3l added the question Further information is requested label Apr 16, 2024
@ax3l ax3l added the component: distributions beam distributions label Apr 16, 2024
@cemitch99
Copy link
Member

In ImpactX, the parameter T denotes the longitudinal coordinate of a particle within the beam. For beam output at a monitor location s, T represents the difference in the arrival-time between the particle and the arrival-time of the reference particle. It is always normalized by (multiplied by) the speed of light c, so that it has units of meters.

The momentum conjugate to T is denoted Pt, and it represents the beam energy (with a minus sign, which is required to make these coordinates canonical). It is measured relative to the reference particle, and normalized by c*p, where p here is the magnitude of the reference momentum.

For a beam at high energy (in the ultrarelativistic limit), (T,Pt) coincides with (-Z,-delta), where delta is the relative energy deviation.

alphaT, betaT, and emittT are related to (T,Pt) in the same way that alphaX, betaX, and emittX are related to (X,Px). For example, sigma_T = sqrt(betaT*emittT), etc.

@zhangli28
Copy link
Author

zhangli28 commented Apr 17, 2024

Dear @n01r @cemitch99 @ax3l thank you so much. I am also looking forward to the extension of input deck as mentioned above by @ax3l .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: distributions beam distributions question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants