gasfir — public API
All symbols below are importable directly from gasfir:
from gasfir import create_pulse, get_diabatic_ionization_probability, get_parameters
Ionization calculations
- gasfir.get_diabatic_ionization_probability(pulse, param_dict, dt=2.0, dT=0.25, filterTreshold=0.0, kernel_type='GASFIR', ret_Rate=False, ret_electron_density=False)[source]
Compute ionization probability for a defined pulse.
- Parameters:
pulse (
Pulse) – Pulse object defining the pulseparam_dict (
Dict[str,float]) – Dictionary containing kernel parametersdt (
float) – Time step for rate calculation (default: 2.0)dT (
float) – Time step for kernel integration (default: 0.25)filterTreshold (
float) – Threshold for filtering rates (default: 0.0)kernel_type (
str) – Type of kernel to use (“GASFIR” or “exact_SFA”)ret_Rate (
bool) – Whether to return rates array (default: False)
- Return type:
Union[float,Tuple[float,ndarray[tuple[Any,...],dtype[float64]],ndarray[tuple[Any,...],dtype[float64]]]]- Returns:
If
ret_Rateis False, the total ionization probability (float). Ifret_Rateis True, a tuple(probability, t_grid, rates).
- gasfir.get_diabatic_ionization_rate(t_grid, pulse, param_dict, dT=0.25, kernel_type='GASFIR', ret_tgrid=False)[source]
Compute ionization rates for a defined pulse.
- Parameters:
t_grid (
ndarray[tuple[Any,...],dtype[float64]]) – Time grid for ionization momentspulse (
Pulse) – Pulse object defining the laser fieldparam_dict (
Dict[str,float]) – Dictionary containing kernel parametersdT (
float) – Time step for integration (default: 0.25)kernel_type (
str) – Type of kernel to use (“GASFIR” or “exact_SFA”)ret_tgrid (
bool) – Whether to return the time grid (default: False)
- Return type:
Union[ndarray[tuple[Any,...],dtype[float64]],Tuple[ndarray[tuple[Any,...],dtype[float64]],ndarray[tuple[Any,...],dtype[float64]]]]- Returns:
If
ret_tgridis False, an array of ionization rates at each time point. Ifret_tgridis True, a tuple(time_grid, rates).
Notes
The function handles various input formats for t_grid:
None: Uses laser field’s default time grid
pandas Series: Converts to numpy array
list: Converts to numpy array
numpy array: Used as is
- gasfir.get_diabatic_ionization_probability_vec(pulses, param_dict, dt=2.0, dT=0.25, kernel_type='GASFIR', ret_electron_density=False)[source]
- gasfir.get_probability_quasi_static_limit(pulse, param_dict, dt=2.0)[source]
Calculate the quasi-static ionization probability.
- gasfir.get_rate_quasi_static_limit(t_grid, pulse, param_dict, type='GASFIR', Z=1, l=0, m=None)[source]
Calculate the quasi-static ionization rate.
- Parameters:
t_grid (
ndarray[tuple[Any,...],dtype[float64]]) – Time grid for the calculationpulse (
Pulse) – Pulse object defining the laser fieldparam_dict (
Dict[str,float]) – Dictionary containing the parameterstype – Type of rate to compute (“GASFIR” or “ADK” or “Tong-Lin”) default is “GASFIR”
Z – Charge of the residual ion (default: 1 for neutral atoms, relevant for ADK)
l – Orbital angular momentum quantum number (default: 0, relevant for ADK)
m – Magnetic quantum number (default: None, if None, sums over all m for given l, relevant for ADK)
- Return type:
- Returns:
Array of ionization rates at each time point
- gasfir.get_quasi_static_rate_for_field(field, param_dict, type='GASFIR', Z=1, l=0, m=None)[source]
return the ionization rate for a define pulse computed with provided parameters :type field:
float|ndarray[tuple[Any,...],dtype[float64]] :param field: the grid of electric field strengths :type field: float64/np.ndarray :type param_dict:Dict[str,float] :param param_dict: dictionary defining the medium’s parameters :type type: :param type: GASFIR or ADK or Tong-Lin (default: GASFIR) :type Z: :param Z: charge of the residual ion (default: 1 for neutral atoms) :type l: :param l: orbital angular momentum quantum number (default: 0) :type m: :param m: magnetic quantum number (default: None, if None, sums over all m for given l)- Returns:
the ionization rates for given array of electric field strengths
- Return type:
np.ndarray, shape=(field.size)
Pulse creation
- gasfir.create_pulse(wavel, intens, cep, fwhmCyc, N=8, t0=0.0)[source]
Create a cos8 pulse with specified parameters.
- Parameters:
wavel – Central wavelength in nm
intens – Peak intensity in W/cm^2
cep – Carrier-envelope phase in radians
fwhmCyc – Full-width at half-maximum in optical cycles
N – Envelope parameter for CosNPulse
- Returns:
An instance of the CosNPulse class with the specified parameters.
- Return type:
Parameters
- gasfir.get_parameters(medium_name=None)[source]
Return parameters for a medium, or list all available medium names.
- Parameters:
medium_name (
Optional[str]) – Case-insensitive name of the medium (e.g."Hydrogen_SFA"). PassNoneto get a list of all available medium names.- Return type:
- Returns:
A copy of the parameter dict when medium_name is given, or a list of all known medium name strings when medium_name is
None.- Raises:
ValueError – If medium_name is not found in the parameter store.
Example
>>> params = get_parameters("Hydrogen_SFA") >>> names = get_parameters() # list all available media
- gasfir.get_ionization_potential(element)[source]
Return the first ionization potential of an element in atomic units.
- Parameters:
element (
str) – Element symbol (e.g."Ar","He") or full name (e.g."argon","helium"). Case-insensitive.- Return type:
- Returns:
Ionization potential in atomic units (Hartree), or
Noneif the element is not recognised.
Example
>>> get_ionization_potential("Ar") # argon 0.5791... >>> get_ionization_potential("helium") 0.9035...
Classes
- class gasfir.Pulse[source]
Bases:
ABC- get_central_wavelength()[source]
Get the central wavelength of the pulse.
- Return type:
- Returns:
Central wavelength in nm
- get_fft(omega=None, center_of_pulse=None)[source]
Get the Fourier transform of the pulse.
- Return type:
Union[ndarray[tuple[Any,...],dtype[float64]],Tuple[ndarray[tuple[Any,...],dtype[float64]],ndarray[tuple[Any,...],dtype[float64]]]]- Returns:
If
omegais None, a tuple(frequencies, amplitudes)in atomic units. Ifomegais an array, the amplitude at the given frequency(ies) in atomic units.
- get_intensity()[source]
Calculate the peak intensity of the pulse.
- Return type:
- Returns:
Peak intensity in W/cm^2
- get_keldysh_parameter(Ip)[source]
Calculate the Keldysh parameter γ for this pulse and ionization potential.
The Keldysh parameter separates the tunnel (γ ≪ 1) and multiphoton (γ ≫ 1) ionization regimes:
\[\gamma = \sqrt{\frac{I_p}{2 U_p}} = \frac{\omega_0 \sqrt{2 I_p}}{E_0}\]where \(U_p = E_0^2 / (4\omega_0^2)\) is the ponderomotive energy.
- Parameters:
Ip (
float) – Ionization potential in atomic units.- Return type:
- Returns:
Dimensionless Keldysh parameter. γ < 1 → tunnel ionization regime. γ > 1 → multiphoton ionization regime. γ ≈ 1 → intermediate regime.
Example
>>> laser = create_pulse(800, 1e14, 0, 30) >>> laser.get_keldysh_parameter(0.5) # hydrogen, ~0.5 a.u. IP 1.0...
- get_max_field_strength()[source]
Get the maximum electric field strength of the pulse.
- Return type:
- Returns:
Maximum electric field strength in atomic units
- get_ponderomotive_energy()[source]
Calculate ponderomotive energy.
- Return type:
- Returns:
Ponderomotive energy in atomic units
- class gasfir.CosNPulse(central_wavelength, peak_intensity, cep, FWHM, envelope_N=8, t0=0.0)[source]
Bases:
Pulse
- class gasfir.DataPulse(t, *, E=None, A=None, t0=0.0)[source]
Bases:
PulsePulse constructed from a user-supplied numerical field on a time grid.
Accepts either the electric field E(t) or the vector potential A(t) sampled on a uniform (or non-uniform) time grid in atomic units.
- Physical requirement:
A(t) must vanish at both ends of the time window (no net momentum kick). When E(t) is supplied, A is derived by integration
A(t) = −∫ E(t') dt'; the integration constant is chosen so that A = 0 at t = t[0], and the field should be essentially zero at both boundaries for this to be accurate.
All four cumulative-integral splines (∫A, ∫A², ∫E²) are precomputed once at construction time from the supplied data grid.
- Parameters:
t (
ndarray[tuple[Any,...],dtype[float64]]) – 1-D time array in atomic units, must be strictly increasing.E (
ndarray[tuple[Any,...],dtype[float64]] |None) – Electric field array E(t) in atomic units. Mutually exclusive withA.A (
ndarray[tuple[Any,...],dtype[float64]] |None) – Vector potential array A(t) in atomic units. E is derived asE(t) = −dA/dtvia the cubic-spline derivative. Mutually exclusive withE.t0 (
float) – Time offset (default 0).get_electric_field(t)evaluates att − t0.
- Raises:
ValueError – If neither or both of
EandAare given.
Example — from A(t):
t = np.linspace(-200, 200, 3200) A = sum_pulse.get_vector_potential(t) dp = DataPulse(t, A=A) prob = get_diabatic_ionization_probability(pulse=dp, param_dict=params)
Example — from E(t):
E = sum_pulse.get_electric_field(t) dp = DataPulse(t, E=E)
- class gasfir.TIPTOE(pump, probe)[source]
Bases:
objectTwo-pulse delay scanner for pump–probe TIPTOE spectroscopy.
Generates
SumOfPulsesobjects at arbitrary pump–probe delays and provides a Nyquist-sampled delay grid for scanning experiments.The pump pulse is held fixed; the probe is shifted in time by the requested delay using a lightweight
_DelayedPulsewrapper that adds no computational overhead beyond the underlying pulse’s own caching.- Parameters:
Example:
from gasfir import create_pulse from gasfir.pulse import TIPTOE pump = create_pulse(800, 3e14, 0, 6) probe = create_pulse(800, 1e13, 0, 2) # weak probe scanner = TIPTOE(pump, probe) # Scan over the Nyquist-sampled delay grid delays = scanner.return_delay_array() for tau in delays: field = scanner.at_delay(tau) prob = get_diabatic_ionization_probability(pulse=field, param_dict=params)
- at_delay(delay)[source]
Return a
SumOfPulseswith the probe delayed by delay a.u.- Parameters:
delay (
float) – Pump–probe delay in atomic units. Positive values place the probe after the pump; negative values place it before.- Return type:
SumOfPulses- Returns:
SumOfPulsesof the fixed pump and the shifted probe.
- return_delay_array(delay_min=None, delay_max=None, oversample=4)[source]
Nyquist-sampled delay grid covering the full pump–probe overlap region.
The sampling theorem requires at least 2 delay points per oscillation period of the highest-frequency field component. This method uses the maximum of the pump and probe carrier frequencies to set the step size:
Δτ = T₀ / oversample where T₀ = 2π / max(ω_pump, ω_probe)
The default range extends 1.5× beyond the point where the two pulses just touch (positive and negative), ensuring both fully-separated and fully-overlapping configurations are included.
- Parameters:
delay_min (
float|None) – Start of the delay range in atomic units.None(default) sets it to −1.5 × (pump_half_duration + probe_half_duration).delay_max (
float|None) – End of the delay range in atomic units.None(default) mirrorsdelay_min.oversample (
int) – Number of delay samples per optical cycle of the highest-frequency component (default 4 — 2× Nyquist margin). Use 8 or more for carrier-envelope resolved scans.
- Return type:
- Returns:
1-D NumPy array of delay values in atomic units.
Example:
delays = scanner.return_delay_array() # auto range delays = scanner.return_delay_array(-500, 500, oversample=8)
- class gasfir.EllipticalCosNPulse(central_wavelength, peak_intensity, FWHM, cep, peak_intensity2=0.0, envelope_N=8, t0=0.0)[source]
Bases:
CosNPulse
The gasfir.AtomicUnits unit-conversion helper is documented on the
gasfir.utils — unit conversion page.