simulate_trace

Submodules

simulate_trace.make_pulse module

class simulate_trace.make_pulse.SpectralAmplitude[source]

Bases: object

A base for all spectral amplitudes.

class simulate_trace.make_pulse.SpectralPhase[source]

Bases: object

A base for all spectral phases

class simulate_trace.make_pulse.GaussianAmplitude(amplitude: numpy.ndarray | tuple | float | int, central_frequency: numpy.ndarray | tuple | float | int, fwhm: numpy.ndarray | tuple | float | int, p: numpy.ndarray | tuple | float | int | NoneType = None)[source]

Bases: SpectralAmplitude

amplitude: ndarray | tuple | float | int

scales the gaussian by a factor

central_frequency: ndarray | tuple | float | int

the position of the maximum on the frequency axis

fwhm: ndarray | tuple | float | int

the Full-Width-Half-Maximum of the gaussian

p: ndarray | tuple | float | int | None = None

defines a super-gaussian (needs to be bigger or equal to one), if None a normal gaussian is assumed.

class simulate_trace.make_pulse.LorentzianAmplitude(amplitude: numpy.ndarray | tuple | float | int, central_frequency: numpy.ndarray | tuple | float | int, fwhm: numpy.ndarray | tuple | float | int, p: numpy.ndarray | tuple | float | int | NoneType = None)[source]

Bases: SpectralAmplitude

amplitude: ndarray | tuple | float | int

scales the lorentzian by a factor

central_frequency: ndarray | tuple | float | int

the position of the maximum on the frequency axis

fwhm: ndarray | tuple | float | int

the Full-Width-Half-Maximum of the lorentzian

p: ndarray | tuple | float | int | None = None

defines a super-lorentzian (needs to be bigger or equal to one), if None a normal lorentzian is assumed.

class simulate_trace.make_pulse.PolynomialPhase(central_frequency: float | int | NoneType, coefficients: numpy.ndarray | tuple | float | int)[source]

Bases: SpectralPhase

central_frequency: float | int | None

the central frequency, if None it will be calculated from the spectral amplitude.

coefficients: ndarray | tuple | float | int

the taylor coefficients in fs, need to include all orders. (e.g. for a TOD pulse the input needs to be (0,0,0,TOD))

class simulate_trace.make_pulse.SinusoidalPhase(amplitude: numpy.ndarray | tuple | float | int, central_frequency: numpy.ndarray | tuple | float | int, periodicity: numpy.ndarray | tuple | float | int, phase_shift: numpy.ndarray | tuple | float | int)[source]

Bases: SpectralPhase

amplitude: ndarray | tuple | float | int

the amplitude of the sinusoid (in units of 2*pi)

central_frequency: ndarray | tuple | float | int

the base-shift of the sinusoid (in PHz)

periodicity: ndarray | tuple | float | int

the periodicity of the sinusoid (in fs)

phase_shift: ndarray | tuple | float | int

the phase of the sinusoid

class simulate_trace.make_pulse.RandomPhase(number_of_points: int = 10, minval_phase: float | int = -1.5707963267948966, maxval_phase: float | int = 1.5707963267948966, sigma: float | int = 10)[source]

Bases: SpectralPhase

Generates a random continuous phase in the frequency domain.

number_of_points: int = 10
minval_phase: float | int = -1.5707963267948966
maxval_phase: float | int = 1.5707963267948966
sigma: float | int = 10
class simulate_trace.make_pulse.CustomPulse(frequency: numpy.ndarray, amplitude: numpy.ndarray | simulate_trace.make_pulse.SpectralAmplitude, phase: numpy.ndarray | simulate_trace.make_pulse.SpectralPhase)[source]

Bases: object

frequency: ndarray

the frequency axis

amplitude: ndarray | SpectralAmplitude

the spectral amplitude

phase: ndarray | SpectralPhase

the spectral phase

class simulate_trace.make_pulse.TemporalAmplitude(gaussian_or_lorentzian: str, amplitude: float | int, duration: float | int, central_frequency: float | int, p: float | int | NoneType = None)[source]

Bases: object

gaussian_or_lorentzian: str

defines the envelope shape, needs to be gaussian or lorentzian.

amplitude: float | int

the amplitude

duration: float | int

the duration

central_frequency: float | int

the central_frequency

p: float | int | None = None

the super-gaussian/lorentzian exponent

class simulate_trace.make_pulse.MultiPulse(gaussian_or_lorentzian: list | tuple | numpy.ndarray | str, amplitude: list | tuple | numpy.ndarray | float | int, delay: list | numpy.ndarray | tuple | float | int, duration: list | tuple | numpy.ndarray | float | int, central_frequency: list | tuple | numpy.ndarray | float | int, p: list | tuple | numpy.ndarray | float | int | NoneType, phase: list[simulate_trace.make_pulse.SpectralPhase] | tuple[simulate_trace.make_pulse.SpectralPhase] | simulate_trace.make_pulse.SpectralPhase)[source]

Bases: object

gaussian_or_lorentzian: list | tuple | ndarray | str

only “G” for gaussian or “L” for lorentzian are accepted

amplitude: list | tuple | ndarray | float | int

the relative scale of the envelopes

delay: list | ndarray | tuple | float | int

the relative delay (not position) of each pulse, has to be one less than the total number of pulses

duration: list | tuple | ndarray | float | int

the FWHM of each envelope in the time domain

central_frequency: list | tuple | ndarray | float | int

the central frequency of each pulse

p: list | tuple | ndarray | float | int | None

the super-gaussian/lorentzian of each pulse in the time domain

phase: list[SpectralPhase] | tuple[SpectralPhase] | SpectralPhase

the spectral phase of each pulse

envelope: list[TemporalAmplitude] | tuple[TemporalAmplitude] | TemporalAmplitude

is constructed from the given attributes

simulate_trace.make_pulse.check_and_correct_if_scalar(parameters)[source]
class simulate_trace.make_pulse.MakePulse(N=256, f_max=None, df=None)[source]

Bases: object

Is supposed to generate pulses based on input parameters from GaussianAmplitude, PolynomialPhase, SinusoidalPhase, RandomPhase, CustomPulse or MultiPulse.

N

the number of points on the time/frequency-grid

Type:

int

f_max

the frequency range which is used. Extends from -f_max to +f_max (so it should actually be named f_max?)

Type:

float

gaussian(x, amp, fwhm, shift, p)[source]
lorentzian(x, amp, fwhm, shift, p)[source]
generate_gaussian_lorentzian_amplitude(x, parameters, amp_func)[source]
generate_polynomial_phase(frequency, parameters, amp_f)[source]
generate_sinusoidal_phase(frequency, phase_parameters)[source]
get_spectral_phase(phase_parameters, amp_f)[source]
get_spectral_amplitude(amp_parameters)[source]
get_multi_pulse(parameters, shift)[source]
init_generation(parameters)[source]
generate_pulse(parameters)[source]

Returns a pulse in time and frequency domain, on a discretized grid,

Parameters:

parameters (tuple[SpectralAmplitude, SpectralPhase], CustomPulse, MultiPulse) – the input parameters

Returns:

tuple[jnp.array, jnp.array, jnp.array, jnp.array], the pulse and correspnding axes (time, frequency, pulse_t, pulse_f)

plot_envelopes()[source]

simulate_trace.make_trace module

simulate_trace.make_trace.apply_noise(trace, scale_val=0.01, additive_noise=False, multiplicative_noise=False)[source]

Applies additive and/or multiplicative gaussian noise to a trace.

class simulate_trace.make_trace.MakeTrace(N=256, f_max=1, df=None)[source]

Bases: MakePulse

Simulates measurement traces based in input pulses. Inherits from make_pulse.MakePulse.

maketrace

default is None, defined via respective method

Type:

MakeTraceFROG, MakeTraceCHIRPSCAN, MakeTrace2DSI, MakeTraceTDP, or MakeTraceVAMPIRE

generate_frog(time, frequency, pulse_t, pulse_f, nonlinear_method, delay, cross_correlation=False, interferometric=False, gate=(None, None), real_fields=False, frequency_range=None, f_range_fields=None, N=256, cut_off_val=0.001, interpolate_fft_conform=False, plot_stuff=True)[source]

Generates a FROG trace using the provide pulse/gate.

Parameters:
  • time (jnp.array) – the time axis of pulse_t

  • frequency (jnp.array) – the frequency axis of pulse_f

  • pulse_t (jnp.array) – the input pulse in the time domain

  • pulse_f (jnp.array) – the input pulse in the frequency domain

  • nonlinear_method (str) – the nonlinear method

  • delay (jnp.array) – the delays

  • cross_correlation (bool) – whether cross_correlation should be used

  • interferometric (bool) – whether interferometric setup should be used

  • gate (tuple[jnp.array, jnp.array]) – a tuple containing the frequency axis and the gate-pulse in the frequency domain. Is used as gate if cross_correlation=True

  • real_fields (bool) – whether the nonlinear signal should be generated using real fields

  • frequency_range (tuple[Scalar,Scalar]) – defines the frequenyc range of the trace

  • f_range_fields (tuple[Scalar,Scalar]) – defines the frequency range of the nonlinear signals to consider

  • N (int) – defines the number of points along the frequency axis of the trace

  • cut_off_val (float) – defines how far the trace is zoomed in. Should be between zero and one.

  • interpolate_fft_conform (bool) – whether the time axis of the trace is interpolated to conform to the fft requirements.

  • plot_stuff (bool) – whether the trace and pulse should be plotted

Returns:

tuple[jnp.array, jnp.array, jnp.array, Pytree], the time and frequency axis, the trace, the spectra

generate_tdp(time, frequency, pulse_t, pulse_f, nonlinear_method, delay, spectral_filter, cross_correlation=False, interferometric=False, gate=(None, None), real_fields=False, frequency_range=None, f_range_fields=None, N=256, cut_off_val=0.001, interpolate_fft_conform=False, plot_stuff=True)[source]

Generates a TDP trace using the provide pulse/gate.

Parameters:
  • time (jnp.array) – the time axis of pulse_t

  • frequency (jnp.array) – the frequency axis of pulse_f

  • pulse_t (jnp.array) – the input pulse in the time domain

  • pulse_f (jnp.array) – the input pulse in the frequency domain

  • nonlinear_method (str) – the nonlinear method

  • delay (jnp.array) – the delays

  • spectral_filter (jnp.array) – the spectral filter used in the setup

  • cross_correlation (bool) – whether cross_correlation should be used

  • interferometric (bool) – whether interferometric setup should be used

  • gate (tuple[jnp.array, jnp.array]) – a tuple containing the frequency axis and the gate-pulse in the frequency domain. Is used as gate if cross_correlation=True

  • real_fields (bool) – whether the nonlinear signal should be generated using real fields

  • frequency_range (tuple[Scalar,Scalar]) – defines the frequenyc range of the trace

  • f_range_fields (tuple[Scalar,Scalar]) – defines the frequency range of the nonlinear signals to consider

  • N (int) – defines the number of points along the frequency axis of the trace

  • cut_off_val (float) – defines how far the trace is zoomed in. Should be between zero and one.

  • interpolate_fft_conform (bool) – whether the time axis of the trace is interpolated to conform to the fft requirements.

  • plot_stuff (bool) – whether the trace and pulse should be plotted

Returns:

tuple[jnp.array, jnp.array, jnp.array, Pytree], the time and frequency axis, the trace, the spectra

generate_chirpscan(time, frequency, pulse_t, pulse_f, nonlinear_method, theta, phase_type, chirp_parameters, real_fields=False, frequency_range=None, f_range_fields=None, N=256, cut_off_val=0.001, plot_stuff=True)[source]

Generates a Chirp-Scan trace using the provide pulse/gate.

Parameters:
  • time (jnp.array) – the time axis of pulse_t

  • frequency (jnp.array) – the frequency axis of pulse_f

  • pulse_t (jnp.array) – the input pulse in the time domain

  • pulse_f (jnp.array) – the input pulse in the frequency domain

  • nonlinear_method (str) – the nonlinear method

  • theta (jnp.array) – defines the shift arr of the chirp scan. (e.g. material thickness, phase_shift in MIIPS, …)

  • phase_type (str, Callable) – defines how the applied phase is created, (e.g. material, MIIPS, … )

  • parameters (tuple) – defines further necessary input parameters to the function that calculates phase_matrix

  • real_fields (bool) – whether the nonlinear signal should be generated using real fields

  • frequency_range (tuple[Scalar,Scalar]) – defines the frequenyc range of the trace

  • f_range_fields (tuple[Scalar,Scalar]) – defines the frequency range of the nonlinear signals to consider

  • N (int) – defines the number of points along the frequency axis of the trace

  • cut_off_val (float) – defines how far the trace is zoomed in. Should be between zero and one.

  • plot_stuff (bool) – whether the trace and pulse should be plotted

Returns:

tuple[jnp.array, jnp.array, jnp.array, Pytree], the shift and frequency axis, the trace, the spectra

generate_2dsi(time, frequency, pulse_t, pulse_f, nonlinear_method, delay, spectral_filter1=None, spectral_filter2=None, tau_pulse_anc1=0, material_thickness=0, refractive_index=<refractiveindex.refractiveindex.RefractiveIndexMaterial object>, cross_correlation=False, gate=(None, None), real_fields=False, frequency_range=None, f_range_fields=None, N=256, cut_off_val=0.001, interpolate_fft_conform=False, plot_stuff=True)[source]

Generates a 2DSI trace using the provide pulse/gate.

Parameters:
  • time (jnp.array) – the time axis of pulse_t

  • frequency (jnp.array) – the frequency axis of pulse_f

  • pulse_t (jnp.array) – the input pulse in the time domain

  • pulse_f (jnp.array) – the input pulse in the frequency domain

  • nonlinear_method (str) – the nonlinear method

  • delay (jnp.array) – the delays

  • spectral_filter1 (jnp.array) – the first spectral filter in the interferometer

  • spectral_filter2 (jnp.array) – the second spectral filter in the interferometer

  • tau_pulse_anc1 (int, float) – the delay of the fixed interferometer arm and the external pulse

  • material_thickness (int, float) – material thickness in the interferometer

  • refractive_index (refractiveindex.RefractiveIndexMaterial) – refractive index of the material in the interferometer

  • cross_correlation (bool) – whether cross_correlation should be used

  • gate (tuple[jnp.array, jnp.array]) – a tuple containing the frequency axis and the gate-pulse in the frequency domain. Is used as gate if cross_correlation=True

  • real_fields (bool) – whether the nonlinear signal should be generated using real fields

  • frequency_range (tuple[Scalar,Scalar]) – defines the frequenyc range of the trace

  • f_range_fields (tuple[Scalar,Scalar]) – defines the frequency range of the nonlinear signals to consider

  • N (int) – defines the number of points along the frequency axis of the trace

  • cut_off_val (float) – defines how far the trace is zoomed in. Should be between zero and one.

  • interpolate_fft_conform (bool) – whether the time axis of the trace is interpolated to conform to the fft requirements.

  • plot_stuff (bool) – whether the trace and pulse should be plotted

Returns:

tuple[jnp.array, jnp.array, jnp.array, Pytree], the time and frequency axis, the trace, the spectra

generate_vampire(time, frequency, pulse_t, pulse_f, nonlinear_method, delay, tau_interferometer=0, material_thickness=0, refractive_index=<refractiveindex.refractiveindex.RefractiveIndexMaterial object>, cross_correlation=False, gate=(None, None), real_fields=False, frequency_range=None, f_range_fields=None, N=256, cut_off_val=0.001, interpolate_fft_conform=False, plot_stuff=True)[source]

Generates a VAMPIRE trace using the provide pulse/gate.

Parameters:
  • time (jnp.array) – the time axis of pulse_t

  • frequency (jnp.array) – the frequency axis of pulse_f

  • pulse_t (jnp.array) – the input pulse in the time domain

  • pulse_f (jnp.array) – the input pulse in the frequency domain

  • nonlinear_method (str) – the nonlinear method

  • delay (jnp.array) – the delays

  • tau_interferometer (int, float) – the delay inside the interferometer

  • material_thickness (int, float) – material thickness in the interferometer

  • refractive_index (refractiveindex.RefractiveIndexMaterial) – refractive index of the material in the interferometer

  • cross_correlation (bool) – whether cross_correlation should be used

  • gate (tuple[jnp.array, jnp.array]) – a tuple containing the frequency axis and the gate-pulse in the frequency domain. Is used as gate if cross_correlation=True

  • real_fields (bool) – whether the nonlinear signal should be generated using real fields

  • frequency_range (tuple[Scalar,Scalar]) – defines the frequenyc range of the trace

  • f_range_fields (tuple[Scalar,Scalar]) – defines the frequency range of the nonlinear signals to consider

  • N (int) – defines the number of points along the frequency axis of the trace

  • cut_off_val (float) – defines how far the trace is zoomed in. Should be between zero and one.

  • interpolate_fft_conform (bool) – whether the time axis of the trace is interpolated to conform to the fft requirements.

  • plot_stuff (bool) – whether the trace and pulse should be plotted

Returns:

tuple[jnp.array, jnp.array, jnp.array, Pytree], the time and frequency axis, the trace, the spectra

generate_streaking(time, frequency, nir_pulse, euv_pulse, delay, Ip_eV=Array([[0]], dtype=int32), DTME=(None, None), energy_range=None, N=2048, cut_off_val=0.001, interpolate_fft_conform=False, plot_stuff=True)[source]

Generates an Attosecond-Streaking trace using the provide pulse and gate. Assumes the pulse to be the femtosecond pulse and gate the EUV-pulse.

Parameters:
  • time (jnp.array) – the time axis of pulse_t

  • frequency (jnp.array) – the frequency axis of pulse_f

  • nir_pulse (tuple[jnp.array, jnp.array]) – a tuple containing the nir pulse in the time and frequency domain

  • euv_pulse (tuple[jnp.array, jnp.array]) – a tuple containing the euv pulse in the time and frequency domain

  • delay (jnp.array) – the delays

  • Ip_eV (jnp.array) – the ionization potential in eV

  • DTME (tuple[jnp.array, jnp.array]) – a tuple containing the momentum axis in atomic units and the Dipole-Transition-Matrix-Elements

  • energy_range (tuple[Scalar,Scalar]) – defines the energy range of the trace (in eV)

  • N (int) – defines the number of points along the frequency axis of the trace

  • cut_off_val (float) – defines how far the trace is zoomed in. Should be between zero and one.

  • interpolate_fft_conform (bool) – whether the time axis of the trace is interpolated to conform to the fft requirements.

  • plot_stuff (bool) – whether the trace and pulse should be plotted

Returns:

tuple[jnp.array, jnp.array, jnp.array, Pytree], the time and frequency axis, the trace, the spectra

simulate_trace.make_trace.interpolate_spectrum(frequency, pulse_f, N, do_interpolation)[source]
class simulate_trace.make_trace.MakeTraceBASE(time, frequency, pulse_t, pulse_f, nonlinear_method, N, cut_off_val, interpolate_fft_conform, frequency_range, f_range_fields, f_range_pulse, cross_correlation, interferometric, *args, **kwargs)[source]

Bases: object

generate_trace()[source]
interpolate_trace(is_delay_based=True)[source]
plot_trace(time, pulse_t, frequency, pulse_f, x_arr, frequency_trace, trace, spectra)[source]
get_gate_pulse(frequency_gate, gate_f)[source]
class simulate_trace.make_trace.MakeTraceFROG(time, frequency, pulse_t, pulse_f, nonlinear_method, delay, cross_correlation, interferometric, frequency_range, f_range_fields, f_range_pulse, N, cut_off_val, interpolate_fft_conform)[source]

Bases: MakeTraceBASE, RetrievePulsesFROG

get_parameters_to_make_signal_t()[source]
class simulate_trace.make_trace.MakeTraceTDP(time, frequency, pulse_t, pulse_f, nonlinear_method, delay, spectral_filter, cross_correlation, interferometric, frequency_range, f_range_fields, f_range_pulse, N, cut_off_val, interpolate_fft_conform)[source]

Bases: MakeTraceBASE, RetrievePulsesTDP

get_parameters_to_make_signal_t()[source]
class simulate_trace.make_trace.MakeTraceCHIRPSCAN(time, frequency, pulse_t, pulse_f, nonlinear_method, theta, phase_type, chirp_parameters, frequency_range, f_range_fields, f_range_pulse, N, cut_off_val)[source]

Bases: MakeTraceBASE, RetrievePulsesCHIRPSCAN

get_parameters_to_make_signal_t()[source]
interpolate_trace()[source]
class simulate_trace.make_trace.MakeTrace2DSI(time, frequency, pulse_t, pulse_f, nonlinear_method, delay, spectral_filter1, spectral_filter2, tau_pulse_anc1, material_thickness, refractive_index, cross_correlation, frequency_range, f_range_fields, f_range_pulse, N, cut_off_val, interpolate_fft_conform)[source]

Bases: MakeTraceBASE, RetrievePulses2DSI

get_parameters_to_make_signal_t()[source]
class simulate_trace.make_trace.MakeTraceVAMPIRE(time, frequency, pulse_t, pulse_f, nonlinear_method, delay, tau_interferometer, material_thickness, refractive_index, cross_correlation, frequency_range, f_range_fields, f_range_pulse, N, cut_off_val, interpolate_fft_conform)[source]

Bases: MakeTraceBASE, RetrievePulsesVAMPIRE

get_parameters_to_make_signal_t()[source]
class simulate_trace.make_trace.MakeTraceSTREAKING(time, frequency, pulse_t, pulse_f, delay, Ip_eV, energy_range, N, cut_off_val, interpolate_fft_conform)[source]

Bases: MakeTraceBASE, RetrievePulsesSTREAKING

get_gate_pulse(frequency_gate, gate_f)[source]

For crosscorrelation=True the actual gate pulse has to be provided.

get_DTME(momentum_au, dtme_momentum)[source]
get_parameters_to_make_signal_t()[source]
generate_trace()[source]
interpolate_trace()[source]
plot_trace(time, frequency, pulse_nir, pulse_euv, delay, energy, trace, spectra)[source]
class simulate_trace.make_trace.MakeTraceFROGReal(*args, **kwargs)[source]

Bases: MakeTraceFROG, RetrievePulsesFROGwithRealFields

class simulate_trace.make_trace.MakeTraceTDPReal(*args, **kwargs)[source]

Bases: MakeTraceTDP, RetrievePulsesTDPwithRealFields

class simulate_trace.make_trace.MakeTraceCHIRPSCANReal(*args, **kwargs)[source]

Bases: MakeTraceCHIRPSCAN, RetrievePulsesCHIRPSCANwithRealFields

class simulate_trace.make_trace.MakeTrace2DSIReal(*args, **kwargs)[source]

Bases: MakeTrace2DSI, RetrievePulses2DSIwithRealFields

class simulate_trace.make_trace.MakeTraceVAMPIREReal(*args, **kwargs)[source]

Bases: MakeTraceVAMPIRE, RetrievePulsesVAMPIREwithRealFields

Module contents