maxwelllink.tools.pulses module¶
Predefined laser electric-field profiles for MaxwellLink simulations.
These helpers return callables f(t_au) that evaluate the electric field
in atomic units at time t_au.
- maxwelllink.tools.pulses.cosine_drive(amplitude_au=1.0, omega_au=0.1, phase_rad=0.0, t_start_au=0.0, t_end_au=1e10)[source]¶
Return a continuous cosine drive.
\[E(t) = A \cos(\omega t + \phi)\]- Parameters:
amplitude_au (float, default: 1.0) – Oscillation amplitude in atomic units.
omega_au (float, default: 0.1) – Angular frequency in atomic units.
phase_rad (float, default: 0.0) – Phase offset in radians.
t_start_au (float, default: 0.0) – Time before which the drive is zero (atomic units).
t_end_au (float, default: 1e10) – Time after which the drive is zero (atomic units).
- Returns:
A cosine drive suitable for steady-state excitation.
- Return type:
callable
- maxwelllink.tools.pulses.gaussian_enveloped_cosine(amplitude_au=1.0, t0_au=0.0, sigma_au=10.0, omega_au=0.1, phase_rad=0.0, t_start_au=0.0, t_end_au=1e10)[source]¶
Return a Gaussian-enveloped cosine drive.
\[E(t) = A \exp\left(-\frac{(t - t_0)^2}{2 \sigma^2}\right) \cos\bigl(\omega (t - t_0) + \phi\bigr)\]- Parameters:
amplitude_au (float, default: 1.0) – Peak field amplitude in atomic units.
t0_au (float, default: 0.0) – Temporal center of the pulse in atomic units.
sigma_au (float, default: 10.0) – Temporal sigma in atomic units.
omega_au (float, default: 0.1) – Angular frequency of the cosine wave in atomic units.
phase_rad (float, default: 0.0) – Phase of the cosine wave (radians).
t_start_au (float, default: 0.0) – Time before which the pulse is zero (atomic units).
t_end_au (float, default: 1e10) – Time after which the pulse is zero (atomic units).
- Returns:
A function
f(t_au)for use as a time-dependent electric field.- Return type:
callable
- maxwelllink.tools.pulses.gaussian_pulse(amplitude_au=1.0, t0_au=0.0, sigma_au=10.0, t_start_au=0.0, t_end_au=1e10)[source]¶
Return a Gaussian pulse drive.
\[E(t) = A \exp\left(-\frac{(t - t_0)^2}{2 \sigma^2}\right)\]- Parameters:
amplitude_au (float, default: 1.0) – Peak field amplitude in atomic units.
t0_au (float, default: 0.0) – Temporal center of the pulse in atomic units.
sigma_au (float, default: 10.0) – Temporal sigma in atomic units.
t_start_au (float, default: 0.0) – Time before which the pulse is zero (atomic units).
t_end_au (float, default: 1e10) – Time after which the pulse is zero (atomic units).
- Returns:
A function
f(t_au)that evaluates the Gaussian pulse att_au.- Return type:
callable
- maxwelllink.tools.pulses.k_parallel_pulse(cavity, envelope, omega_au, k_parallel_au, direction='y', center=(0.5, 0.5), size=(0.1, 0.1), amplitude_au=1.0, phase_rad=0.0, target='molecule', projection_axis=None)[source]¶
Build a multimode pulse with a selected in-plane wave vector.
The returned object is a callable
source(t_au)with shape(len(source.excited_grid_list),)fortarget="molecule"or(len(source.excited_mode_list),)fortarget="photon". It can be passed directly tomaxwelllink.MultiModeSimulationas eithermolecule_pulse_driveorphoton_pulse_drive.The physical in-plane wave-vector scale is the one used by
maxwelllink.FabryPerotCavity’s planar dispersion:\[\omega_k = \sqrt{\omega_c^2 + k_{\parallel,x}^2 + k_{\parallel,y}^2}.\]direction="x"and"y"are shorthands for the in-plane wave vectors[k_parallel_au, 0]and[0, k_parallel_au], whiledirection="xy"takes a length-2 sequence[kx_au, ky_au]. In all cases the spatial phase over the fractional coordinates is\[\phi(x, y) = \pi k_{x,\mathrm{au}} (x - x_0) / \Delta\omega_x + \pi k_{y,\mathrm{au}} (y - y_0) / \Delta\omega_y.\]- Parameters:
cavity – A
FabryPerotCavityinstance. It must exposegrid_xyand the relevantdelta_omega_*_auvalue.envelope (Callable[[float], float] | float) – Time-domain envelope callable
envelope(t_au)or constant scalar multiplier. Use helpers such asgaussian_pulse(); the carriercos(omega_au * t - k*r)is supplied by this function. Passing1.0gives a continuous cosine source with grid-dependent phases.omega_au (float) – Carrier angular frequency in atomic units.
k_parallel_au (float | Sequence[float]) – Physical in-plane wave-vector contribution in atomic units, in the same units as
delta_omega_x_au/delta_omega_y_au. Fordirection="x"or"y", this must be a scalar. Fordirection="xy", this must be a length-2 sequence[kx_au, ky_au].direction (str) – In-plane propagation direction:
"x","y","xy","+x","-x","+y","-y","+xy", or"-xy". For"xy", the optional sign is applied to both sequence components.center (Sequence[float]) – Source center
(x, y)in fractional cavity coordinates.size (Sequence[float]) – Full source window size
(size_x, size_y)in fractional cavity coordinates. A smooth Hann window is applied inside this rectangle.amplitude_au (float) – Additional peak amplitude multiplier.
phase_rad (float) – Global carrier phase in radians.
target (str) – Source target, either
"molecule"or"photon". Molecule-targeted sources return one value per selected molecular grid point. Photon- targeted sources project the same spatial source onto cavity modes and return one value per selected mode.projection_axis (str | None) – Mode-function component used for photon-target projection. Defaults to
"y"fortarget="photon"and is ignored fortarget="molecule".
- Returns:
Callable source object with attributes
target,excited_grid_list,excited_mode_list,grid_xy,spatial_window,spatial_phase,mode_complex_amplitude, andk_order.k_orderis always a length-2 array holding the in-plane wave vector in units of the mode spacing along each axis.- Return type:
callable
- maxwelllink.tools.pulses.k_parallel_pulse_with_seed(cavity, envelope, omega_au, k_parallel_au, direction='y', center=(0.5, 0.5), size=(0.1, 0.1), amplitude_au=1.0, phase_rad=0.0, target='molecule', projection_axis=None)[source]¶
Build a k-parallel pulse that accepts additional vortex seeds.
This function takes the same arguments as
k_parallel_pulse(). After construction, calladd_vortex_seed()one or more times. The returned object can then be passed directly toMultiModeSimulationas its photon or molecule pulse drive.- Parameters:
envelope (Callable[[float], float] | float)
omega_au (float)
k_parallel_au (float | Sequence[float])
direction (str)
center (Sequence[float])
size (Sequence[float])
amplitude_au (float)
phase_rad (float)
target (str)
projection_axis (str | None)
- Return type:
KParallelPulseWithSeed