gasfir.pulse — pulse classes

class gasfir.pulse.Pulse[source]

Bases: ABC

get_average_initial_KE_energy(Ip)[source]

Calculate initial kinetic energy.

Parameters:

Ip (float) – Ionization potential in atomic units

Return type:

float

Returns:

Initial kinetic energy in atomic units

get_central_wavelength()[source]

Get the central wavelength of the pulse.

Return type:

float

Returns:

Central wavelength in nm

get_cummulative_electric_field_squared(t)[source]
Return type:

float | ndarray[tuple[Any, ...], dtype[float64]]

get_cummulative_vector_potential(t)[source]
Return type:

float | ndarray[tuple[Any, ...], dtype[float64]]

get_cummulative_vector_potential_squared(t)[source]
Return type:

float | ndarray[tuple[Any, ...], dtype[float64]]

get_electric_field(t)[source]
Return type:

float | ndarray[tuple[Any, ...], dtype[float64]]

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 omega is None, a tuple (frequencies, amplitudes) in atomic units. If omega is an array, the amplitude at the given frequency(ies) in atomic units.

get_intensity()[source]

Calculate the peak intensity of the pulse.

Return type:

float

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:

float

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:

float

Returns:

Maximum electric field strength in atomic units

get_max_initial_KE_energy(Ip)[source]

Calculate maximum initial kinetic energy.

Parameters:

Ip (float) – Ionization potential in atomic units

Return type:

float

Returns:

Maximum initial kinetic energy in atomic units

get_ponderomotive_energy()[source]

Calculate ponderomotive energy.

Return type:

float

Returns:

Ponderomotive energy in atomic units

get_tgrid(dt=0.25)[source]

Get time grid for the pulse.

Parameters:

dt (float) – Time step in atomic units

Return type:

ndarray[tuple[Any, ...], dtype[float64]]

Returns:

Time grid as a numpy array

abstractmethod get_time_interval()[source]

Get time interval containing the pulse.

Return type:

Tuple[float, float]

Returns:

Tuple of (start_time, end_time) in atomic units

get_total_energy(Ip)[source]

Calculate total energy.

Parameters:

Ip (float) – Ionization potential in atomic units

Return type:

float

Returns:

Total energy in atomic units

get_vector_potential(t)[source]
Return type:

float | ndarray[tuple[Any, ...], dtype[float64]]

abstractmethod get_w0()[source]

Get the central wavelength of the pulse.

Return type:

float

Returns:

Central wavelength in nm

get_w_max(center_of_pulse=None)[source]

Get the maximum angular frequency of the pulse.

Returns:

angular frequency in atomic units This corresponds to the maximum photon energy.

Return type:

float

class gasfir.pulse.CosNPulse(central_wavelength, peak_intensity, cep, FWHM, envelope_N=8, t0=0.0)[source]

Bases: Pulse

get_time_interval()[source]

Get time interval containing the pulse.

Return type:

Tuple[float, float]

Returns:

Tuple of (start_time, end_time) in atomic units

get_w0()[source]

Get the central wavelength of the pulse.

Return type:

float

Returns:

Central wavelength in nm

class gasfir.pulse.EllipticalCosNPulse(central_wavelength, peak_intensity, FWHM, cep, peak_intensity2=0.0, envelope_N=8, t0=0.0)[source]

Bases: CosNPulse

get_cummulative_vector_potential_tuple(t)[source]
get_electric_field_tuple(t)[source]
get_vector_potential_tuple(t)[source]
class gasfir.pulse.DataPulse(t, *, E=None, A=None, t0=0.0)[source]

Bases: Pulse

Pulse 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 with A.

  • A (ndarray[tuple[Any, ...], dtype[float64]] | None) – Vector potential array A(t) in atomic units. E is derived as E(t) = −dA/dt via the cubic-spline derivative. Mutually exclusive with E.

  • t0 (float) – Time offset (default 0). get_electric_field(t) evaluates at t t0.

Raises:

ValueError – If neither or both of E and A are 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)
get_time_interval()[source]

Get time interval containing the pulse.

Return type:

Tuple[float, float]

Returns:

Tuple of (start_time, end_time) in atomic units

get_w0()[source]

Get the central wavelength of the pulse.

Return type:

float

Returns:

Central wavelength in nm

class gasfir.pulse.TIPTOE(pump, probe)[source]

Bases: object

Two-pulse delay scanner for pump–probe TIPTOE spectroscopy.

Generates SumOfPulses objects 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 _DelayedPulse wrapper that adds no computational overhead beyond the underlying pulse’s own caching.

Parameters:
  • pump (Pulse) – Fixed pump pulse (any Pulse subclass).

  • probe (Pulse) – Probe pulse to be delayed. The zero-delay configuration corresponds to the probe at its original position (t0).

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 SumOfPulses with 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:

SumOfPulses of 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) mirrors delay_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:

ndarray[tuple[Any, ...], dtype[float64]]

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)