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 and can be passed directly to
LaserDrivenSimulation’s drive parameter.
- 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}.\]For
direction="y",k_parallel_auis mapped to the normalized fractional-coordinate phase byky_norm = pi * k_parallel_au / cavity.delta_omega_y_au.- 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) – Physical in-plane wave-vector contribution in atomic units, in the same units as
delta_omega_x_au/delta_omega_y_au.direction (str) – In-plane propagation direction:
"x","y","+x","-x","+y", or"-y".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 including
target,excited_grid_list,excited_mode_list,spatial_window,spatial_phase, andk_order.- Return type:
callable