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.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.

Examples

For a general overview of how unit-based input works, take a look at the following examples:

API

The formulary subpackage contains commonly used formulae from plasma science.

Sub-Packages & Modules

braginskii

Functions to calculate classical transport coefficients.

collisions

The collisions subpackage contains commonly used collisional formulae from plasma science.

densities

Functions to calculate plasma density parameters.

dielectric

Functions to calculate plasma dielectric parameters.

dimensionless

Module of dimensionless plasma parameters.

distribution

Common distribution functions for plasmas, such as the Maxwellian or Kappa distributions.

drifts

Functions for calculating particle drifts.

frequencies

Functions to calculate fundamental plasma frequency parameters.

ionization

Functions related to ionization states and the properties thereof.

lengths

Functions to calculate fundamental plasma length parameters.

magnetostatics

Define MagneticStatics class to calculate common static magnetic fields as first raised in issue #100.

mathematics

Mathematical formulas relevant to plasma physics.

misc

Functions for miscellaneous plasma parameter calculations.

quantum

Functions for quantum parameters, including electron degenerate gases and warm dense matter.

radiation

Functions for calculating quantities associated with electromagnetic radiation.

relativity

Functionality for calculating relativistic quantities.

speeds

Functions to calculate fundamental plasma speed parameters.

Classes

CircularWire(normal, center, radius, current)

Circular wire (coil) class.

ClassicalTransport(T_e, n_e, T_i, n_i, ion, m_i)

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, momentum, *, ...)

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 test particles (labeled 'a') and field particles (labeled 'b').

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.

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.

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.

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.

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.

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 Lundquist number.

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.

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, taken from Maruca et al. [2013] and Johnson et al. [2023].

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.

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.

Ef_(n_e)

Alias to Fermi_energy.

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.

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.

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.