Formulary (plasmapy.formulary)

plasmapy.formulary provides theoretical formulas for calculation of physical quantities helpful for plasma physics. 🧮

plasmapy.formulary.braginskii

plasmapy.formulary.collisions

plasmapy.formulary.densities

plasmapy.formulary.dielectric

plasmapy.formulary.dimensionless

plasmapy.formulary.distribution

plasmapy.formulary.drifts

plasmapy.formulary.frequencies

plasmapy.formulary.ionization

plasmapy.formulary.laser

plasmapy.formulary.lengths

plasmapy.formulary.magnetostatics

plasmapy.formulary.mathematics

plasmapy.formulary.misc

plasmapy.formulary.quantum

plasmapy.formulary.radiation

plasmapy.formulary.relativity

plasmapy.formulary.speeds

The subpackage makes heavy use of Quantity for handling conversions between different unit systems. This is especially important for electron-volts, commonly used in plasma physics to denote temperature, although it is technically a unit of energy.

Most functions expect Quantity objects as inputs, however some will use the validate_quantities decorator to automatically cast arguments to Quantity objects with the appropriate units. If that happens, you will be notified via a astropy.units.UnitsWarning.

Please note that well-maintained physical constant data with units and uncertainties can be found in astropy.constants.

Example notebooks

API

Commonly used formulas for plasma science.

Many of these formulas come from the NRL Plasma Formulary [Richardson, 2019].

Sub-Packages & Modules

braginskii

Classical transport coefficients.

collisions

Formulas related to particle collisions in plasmas.

densities

Formulas for plasma densities.

dielectric

Plasma dielectric parameters.

dimensionless

Dimensionless plasma parameters.

distribution

Distribution functions, including Maxwellian and Kappa distributions.

drifts

Particle drift velocities.

frequencies

Fundamental frequencies for a plasma.

ionization

Calculation of ionization equilibria.

laser

Functions for calculating quantities associated with laser pulses.

lengths

Characteristic length scales in plasmas.

magnetostatics

Calculation of static magnetic fields from known current configurations.

mathematics

Mathematical formulas relevant to plasma physics.

misc

Miscellaneous plasma parameters.

quantum

Quantum parameters, including electron degenerate plasmas and warm dense matter.

radiation

Quantities associated with electromagnetic radiation.

relativity

Calculation of quantities related to relativity.

speeds

Fundamental speeds in plasmas.

Classes

CircularWire(normal, center, radius, current)

Circular wire (coil) class.

ClassicalTransport(T_e, Unit], n_e, Unit], ...)

Classical transport coefficients (e.g. Braginskii, 1965).

FiniteStraightWire(p1, p2, current)

Finite length straight wire class.

GeneralWire(parametric_eq, t1, t2, current)

General wire class described by its parametric vector equation.

InfiniteStraightWire(direction, p0, current)

Infinite straight wire class.

MagneticDipole(moment, p0)

Simple magnetic dipole — two nearby opposite point charges.

MagnetoStatics()

Abstract class for magnetostatic fields.

MaxwellianCollisionFrequencies(...)

Compute collision frequencies between two slowly flowing Maxwellian populations.

RelativisticBody(particle, V, Unit] = None, ...)

A physical body that is moving at a velocity relative to the speed of light.

RotatingTensorElements(left, right, plasma)

Output type for cold_plasma_permittivity_LRP.

SingleParticleCollisionFrequencies(...)

Compute collision frequencies between particles.

StixTensorElements(sum, difference, plasma)

Output type for cold_plasma_permittivity_SDP.

Wire()

Abstract wire class for concrete wires to be inherited from.

Inheritance diagram of plasmapy.formulary.magnetostatics.CircularWire, plasmapy.formulary.braginskii.ClassicalTransport, plasmapy.formulary.magnetostatics.FiniteStraightWire, plasmapy.formulary.magnetostatics.GeneralWire, plasmapy.formulary.magnetostatics.InfiniteStraightWire, plasmapy.formulary.magnetostatics.MagneticDipole, plasmapy.formulary.magnetostatics.MagnetoStatics, plasmapy.formulary.collisions.frequencies.MaxwellianCollisionFrequencies, plasmapy.formulary.relativity.RelativisticBody, plasmapy.formulary.dielectric.RotatingTensorElements, plasmapy.formulary.collisions.frequencies.SingleParticleCollisionFrequencies, plasmapy.formulary.dielectric.StixTensorElements, plasmapy.formulary.magnetostatics.Wire

Functions

Alfven_speed(B, density[, ion, mass_numb, Z])

Calculate the Alfvén speed 🏎️💨.

beta(T, n, B)

Compute the ratio of thermal pressure to magnetic pressure.

Bethe_stopping(I, n, v, z)

The theoretical electronic stopping power for swift charged particles calculated from the Bethe formula.

Bethe_stopping_lite(I, n, v, z)

The lite-function version of Bethe_stopping.

Bohm_diffusion(T_e, B)

Return the Bohm diffusion coefficient.

Buchsbaum_frequency(B, n1, n2, ion1, ion2[, ...])

Return the Buchsbaum frequency for a two-ion-species plasma.

chemical_potential(n_e, T)

Calculate the ideal chemical potential.

cold_plasma_permittivity_LRP(B, species, n, ...)

Magnetized cold plasma dielectric permittivity tensor elements.

cold_plasma_permittivity_SDP(B, species, n, ...)

Magnetized cold plasma dielectric permittivity tensor elements.

collision_frequency(T, n, species[, z_mean, ...])

Collision frequency of particles in a plasma.

Coulomb_cross_section(impact_param)

Cross-section for a large angle Coulomb collision.

Coulomb_logarithm(T, n_e, species[, z_mean, ...])

Compute the Coulomb logarithm.

coupling_parameter(T, n_e, species[, ...])

Ratio of the Coulomb energy to the kinetic (usually thermal) energy.

critical_density(omega)

Calculate the plasma critical density for a radiation of a given frequency.

deBroglie_wavelength(V, particle)

Return the de Broglie wavelength.

Debye_length(T_e, n_e)

Calculate the exponential scale length for charge screening in an electron plasma with stationary ions.

Debye_number(T_e, n_e)

Return the number of electrons within a sphere with a radius of the Debye length.

diamagnetic_drift(dp, B, n, q)

Calculate the diamagnetic fluid perpendicular drift.

electric_field_amplitude(intensity)

Calculate the electric field amplitude \(E_0\) from the intensity \(I\) of a laser.

electron_thermal_conductivity(T_e, n_e, T_i, ...)

Calculate the thermal conductivity for electrons.

electron_viscosity(T_e, n_e, T_i, n_i, ion)

Calculate the electron viscosity.

em_angular_frequency(wavelength)

Calculate the angular frequency \(\omega\) of a laser given the the wavelength of the beam \(\lambda\).

em_wavelength(angular_frequency)

Calculate the wavelength of a laser \(\lambda\) given the angular frequency \(\omega\).

ExB_drift(E, B)

Calculate the "electric cross magnetic" particle drift.

Fermi_energy(n_e)

Calculate the kinetic energy in a degenerate electron gas.

Fermi_integral(x, j)

Calculate the complete Fermi-Dirac integral.

force_drift(F, B, q)

Calculate the general force drift for a particle in a magnetic field.

fundamental_electron_collision_freq(T_e, ...)

Average momentum relaxation rate for a slowly flowing Maxwellian distribution of electrons.

fundamental_ion_collision_freq(T_i, n_i, ion)

Average momentum relaxation rate for a slowly flowing Maxwellian distribution of ions.

Gaussian_beam_waist_radius(spot_size_FWHM)

Calculate the beam waist radius \(w_0\) for the intensity profile of a Gaussian beam given the Full Width at Half Maximum spot size \(FWHM\).

Gaussian_power(intensity, beam_waist_radius)

Calculate the total power of a Gaussian beam \(P_0\) from the intensity \(I\) and the beam waist radius \(w_0\).

Gaussian_Rayleigh_length(wavelength, ...)

Calculate the Rayleigh length \(z_R\) from the beam waist radius \(w_0\) and the wavelength \(\lambda\).

Gaussian_spot_size_FWHM(beam_waist_radius)

Calculate the Full Width at Half Maximum spot size \(FWHM\) at focus given the beam waist radius of a Gaussian beam \(w_0\).

gyrofrequency(B, particle[, signed, Z, ...])

Calculate the particle gyrofrequency in units of radians per second.

gyroradius(B, particle, *[, Vperp, T, ...])

Calculate the radius of circular motion for a charged particle in a uniform magnetic field (including relativistic effects by default).

Hall_parameter(n, T, B, ion, particle[, ...])

Calculate the particle Hall parameter for a plasma.

impact_parameter(T, n_e, species[, z_mean, ...])

Impact parameters for classical and quantum Coulomb collision.

impact_parameter_perp(T, species[, V])

Distance of the closest approach for a 90° Coulomb collision.

inertial_length(n, particle, *[, mass_numb, Z])

Calculate a charged particle's inertial length.

intensity(electric_field_amplitude)

Calculate the intensity \(I\) of a laser from the electric field amplitude \(E_0\).

ion_sound_speed(T_e, T_i, ion[, n_e, k, ...])

Return the ion sound speed for an electron-ion plasma.

ion_thermal_conductivity(T_e, n_e, T_i, n_i, ion)

Calculate the thermal conductivity for ions.

ion_viscosity(T_e, n_e, T_i, n_i, ion[, ...])

Calculate the ion viscosity.

ionization_balance(n, T_e)

Return the average ionization state of ions in a plasma assuming that the numbers of ions in each state are equal.

kappa_thermal_speed(T, kappa, particle[, ...])

Return the most probable speed for a particle within a kappa distribution.

kappa_velocity_1D(v, T, kappa[, particle, ...])

Return the probability density at the velocity v in m/s to find a particle particle in a plasma of temperature T following the Kappa distribution function in 1D.

kappa_velocity_3D(vx, vy, vz, T, kappa[, ...])

Return the probability density function for finding a particle with velocity components v_x, v_y, and v_z in m/s in a suprathermal plasma of temperature T and parameter kappa which follows the 3D Kappa distribution function.

Knudsen_number(characteristic_length, T, ...)

Knudsen number (dimensionless).

Lorentz_factor(V)

Return the Lorentz factor.

lower_hybrid_frequency(B, n_i, ion, *[, to_hz])

Return the lower hybrid frequency.

Lundquist_number(L, B, density, sigma[, ...])

Compute the ratio of the Alfén wave crossing timescale to the magnetic diffusion timescale.

Mag_Reynolds(U, L, sigma)

Compute the magnetic Reynolds number.

magnetic_energy_density(B)

Calculate the magnetic energy density.

magnetic_pressure(B)

Calculate the magnetic pressure.

mass_density(density, particle[, z_ratio])

Calculate the mass density from a number density.

Maxwellian_1D(v, T[, particle, v_drift, ...])

Probability distribution function of velocity for a Maxwellian distribution in 1D.

Maxwellian_speed_1D(v, T[, particle, ...])

Probability distribution function of speed for a Maxwellian distribution in 1D.

Maxwellian_speed_2D(v, T[, particle, ...])

Probability distribution function of speed for a Maxwellian distribution in 2D.

Maxwellian_speed_3D(v, T[, particle, ...])

Probability distribution function of speed for a Maxwellian distribution in 3D.

Maxwellian_velocity_2D(vx, vy, T[, ...])

Probability distribution function of velocity for a Maxwellian distribution in 2D.

Maxwellian_velocity_3D(vx, vy, vz, T[, ...])

Probability distribution function of velocity for a Maxwellian distribution in 3D.

mean_free_path(T, n_e, species[, z_mean, V, ...])

Collisional mean free path (m).

mobility(T, n_e, species[, z_mean, V, method])

Return the electrical mobility.

normalized_vector_potential(intensity, ...)

Calculate the normalized vector potential \(a_0\) from the intensity \(I\) and the wavelength \(\lambda\).

permittivity_1D_Maxwellian(omega, kWave, T, ...)

Compute the classical dielectric permittivity for a 1D Maxwellian plasma.

plasma_frequency(n, particle, *[, ...])

Calculate the particle plasma frequency.

quantum_theta(T, n_e)

Compare Fermi energy to thermal kinetic energy to check if quantum effects are important.

relativistic_energy(particle, V, *[, ...])

Calculate the sum of the mass energy and kinetic energy of a relativistic body.

resistivity(T_e, n_e, T_i, n_i, ion[, m_i, ...])

Calculate the resistivity.

Reynolds_number(rho, U, L, mu)

Compute the Reynolds number.

rot_a_to_b(a, b)

Calculates the 3D rotation matrix that will rotate vector a to be aligned with vector b.

Saha(g_j, g_k, n_e, E_jk, T_e)

Return the ratio of populations of two ionization states.

Spitzer_resistivity(T, n, species[, z_mean, ...])

Spitzer resistivity of a plasma.

temp_ratio(*, r_0, r_n, n_1, n_2, v_1, T_1, T_2)

Calculate the thermalization ratio for a plasma in transit.

thermal_bremsstrahlung(frequencies, n_e, T_e)

Calculate the bremsstrahlung emission spectrum for a Maxwellian plasma in the Rayleigh-Jeans limit \(ℏ ω ≪ k_B T_e\).

thermal_deBroglie_wavelength(T_e)

Calculate the thermal de Broglie wavelength for electrons.

thermal_pressure(T, n)

Return the thermal pressure for a Maxwellian distribution.

thermal_speed(T, particle[, method, mass, ndim])

Calculate the speed of thermal motion for particles with a Maxwellian distribution.

thermal_speed_coefficients(method, ndim)

Get the thermal speed coefficient corresponding to the desired thermal speed definition.

thermoelectric_conductivity(T_e, n_e, T_i, ...)

Calculate the thermoelectric conductivity.

Thomas_Fermi_length(n_e)

Calculate the exponential scale length for charge screening for cold and dense plasmas.

upper_hybrid_frequency(B, n_e, *[, to_hz])

Return the upper hybrid frequency.

Wigner_Seitz_radius(n)

Calculate the Wigner-Seitz radius, which approximates the inter-particle spacing.

Aliases

PlasmaPy provides aliases of the most common plasma functionality for user convenience. Aliases in PlasmaPy are denoted with a trailing underscore (e.g., alias_). For further details, please refer to the contributor guide’s section on aliases.

a0_(intensity, wavelength)

Alias to normalized_vector_potential.

betaH_(n, T, B, ion, particle[, ...])

Alias to Hall_parameter.

cs_(T_e, T_i, ion[, n_e, k, gamma_e, gamma_i, Z])

Alias to ion_sound_speed.

cwp_(n, particle, *[, mass_numb, Z])

Alias to inertial_length.

DB_(T_e, B)

Alias to Bohm_diffusion.

E0_(intensity)

Alias to electric_field_amplitude.

Ef_(n_e)

Alias to Fermi_energy.

I_(electric_field_amplitude)

Alias to intensity.

lambdaD_(T_e, n_e)

Alias to Debye_length.

lambdaDB_(V, particle)

Alias to deBroglie_wavelength.

lambdaDB_th_(T_e)

Alias to thermal_deBroglie_wavelength.

nD_(T_e, n_e)

Alias to Debye_number.

oc_(B, particle[, signed, Z, mass_numb, to_hz])

Alias to gyrofrequency.

omega_(wavelength)

Alias to em_angular_frequency.

pmag_(B)

Alias to magnetic_pressure.

pth_(T, n)

Alias to thermal_pressure.

rc_(B, particle, *[, Vperp, T, ...])

Alias to gyroradius.

Re_(rho, U, L, mu)

Alias to Reynolds_number.

rho_(density, particle[, z_ratio])

Alias to mass_density.

rhoc_(B, particle, *[, Vperp, T, ...])

Alias to gyroradius.

Rm_(U, L, sigma)

Alias to Mag_Reynolds.

ub_(B)

Alias to magnetic_energy_density.

va_(B, density[, ion, mass_numb, Z])

Alias to Alfven_speed.

vd_(dp, B, n, q)

Alias to diamagnetic_drift.

veb_(E, B)

Alias to ExB_drift.

vfd_(F, B, q)

Alias to force_drift.

vth_(T, particle[, method, mass, ndim])

Alias to thermal_speed().

vth_kappa_(T, kappa, particle[, method, ...])

Alias to kappa_thermal_speed.

w0_(spot_size_FWHM)

Alias to Gaussian_beam_waist_radius.

wc_(B, particle[, signed, Z, mass_numb, to_hz])

Alias to gyrofrequency.

wlh_(B, n_i, ion, *[, to_hz])

Alias to lower_hybrid_frequency.

wp_(n, particle, *[, mass_numb, Z, to_hz])

Alias to plasma_frequency.

wuh_(B, n_e, *[, to_hz])

Alias to upper_hybrid_frequency.

Z_bal_(n, T_e)

Alias for ionization_balance.

Lite-Functions

Lite-functions are optimized versions of existing PlasmaPy functions that are intended for applications where computational efficiency matters most. Lite-functions accept numbers and NumPy arrays that are implicitly assumed to be in SI units, and do not accept Quantity objects as inputs. For further details, please refer to the contributor guide’s section on lite-functions.

Caution

Lite-functions do not include the safeguards that are included in most plasmapy.formulary functions. When using lite-functions, it is vital to double-check your implementation!

permittivity_1D_Maxwellian_lite(omega, ...)

The lite-function for permittivity_1D_Maxwellian.

plasma_frequency_lite(n, mass, Z[, to_hz])

The lite-function for plasma_frequency.

thermal_speed_lite(T, mass, coeff)

The lite-function for thermal_speed.