These functions and scripts are for simulating optically-driven electron phase modulation. You can find a description the theory that this code is based on along with demonstration usage in NOTES-AND-DEMOS/electron-phase-modulation-technical-notes-and-demos.ipynb.
Calculates the energy spectra based on:
- A wavefunction at the entrance of a phase plate; and
- The oscillating potential energy step due to an oscillating electric field across the phase plate.
It assumes the wavefunction is defined by a pulsed electron wavepacket with a time-domain complex envelope given by A, and central energy E0. The slowly-varying envelope approximation is used throughout for these calculations.
For convenience, it outputs both an energy spectrum in eV, and the momentum spectrum where the k-vector is in the normalized eV units (see below).
For the calculations below, we use "eV" normalized units for convenience:
- Energy in eV
$\hbar = m = q = 1$
t
--> time axis (femtoseconds)A
--> complex amplitude of wavefunctionW0
--> central energy (in eV)V
--> time-dependent potential (eV)
k
--> momentum axis (normalized units)a_k
--> momentum amplitudeW
--> energy axis in eVP_W
--> energy spectrum
Propagates the wavefunction defined by k
and a_k
in time until it is centered around x_center
. It then reconstructs the wavefunction in time at that position.
The output in time is centered such that t=t_center
. This is to avoid aliasing and wrapping problems in the fft due to the limited number of data points provided to define the wavefunction.
For the calculations below, we use "eV" normalized units for convenience:
- Energy in eV
$hbar = m = q = 1$
x_center
--> spatial location to evaluate wavefunction (nanometers)t
--> vector of times giving time range to evaluate wavefunction overW0
--> central energy in eVk
--> k-vector (normalized units -- takes output from calc_energy_spec()).a_k
--> momentum spectrum amplitude (takes output from calc_energy_spec()).
t_center
--> central time of the time-axis in femtosecondsu_out
--> wavefunction amplitude in time centered around t_center
Propagates the wavefunction defined by 'k' and 'a_k' with central energy W0
forward to time t_prime
. It then reconstructs the wavefunction u_out
in real-space x
around the position x_center
.
Based on the central energy W0
, it reconstructs the wavefunction in the moving frame. The output x
is centered such that x=0
is at x_center
. This is to avoid aliasing and wrapping problems in the fft due to the limited number of data points provided to define the wavefunction.
For the calculations below, we use "eV" normalized units for convenience:
- Energy in eV
$hbar = m = q = 1$
t_prime
--> time to evaluate the wavefunction (femtoseconds; can be vector)W0
--> central energy in eVk
--> k-vector (normalized units -- takes output fromcalc_energy_spec()
).a_k
--> momentum spectrum amplitude (takes output fromcalc_energy_spec()
).
x_center
--> central position of thex
-axis (x=0
) in nmx
--> x-axis centered such thatx=0
is atx_center
in the moving frame of the wavepacketu_out
--> wavefunction amplitude in real space overx
in the moving frame for eacht_prime
Function for generating a Gaussian pulse form with given intensity FWHM. Outputs electric field profile and intensity envelope, both normalized to peak of 1. Units need to be self-consistent between t
, fwhm
, and wc
. While this was intended to be used to create electric field waveforms, it can generally be used to create Gaussian pulses.
t
--> timefwhm
--> full width at half max of the intensity envelopewc
--> central frequency (rad/unit time)phi_ce
--> carrier envelope phase offset (rad)
E
--> Electric field profile (peak of 1)A
--> Intensity envelope (peak of 1)
A test script run_modulation_test.m
is provided that demonstrates each element of the code for convenience.