Last active
March 12, 2022 11:59
-
-
Save tmiethlinger/8bda645284ae8fbda1ef975c8357dc8b to your computer and use it in GitHub Desktop.
Lorentz factor from Smilei output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gamma(p_r, m_r = 1): | |
""" compute Lorentz factor from Smilei momentum and mass | |
Parameters | |
---------- | |
p_r : float | |
particle momentum in reduced units. | |
m_r : float, optional | |
particle mass in reduced units, default value is hydrogen mass. | |
Returns | |
------- | |
gamma | |
Lorentz factor, float. | |
""" | |
return np.sqrt(1 + (p_r / m_r)**2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment