Interface
Creation
ElectricFields.@field
— Macro@field(name) do ... end
Frontend macro for creating an electric field and storing it in the variable name
.
Example
julia> @field(F) do
I₀ = 2.0
T = 2.0
σ = 3.0
Tmax = 3.0
end
Linearly polarized field with
- I₀ = 2.0000e+00 au = 7.0188904e16 W cm⁻² =>
- E₀ = 1.4142e+00 au = 727.2178 GV m⁻¹
- A₀ = 0.4502 au
– a Fixed carrier @ λ = 14.5033 nm (T = 48.3777 as, ω = 3.1416 Ha = 85.4871 eV)
– and a Gaussian envelope of duration 170.8811 as (intensity FWHM; ±2.00σ)
Time-dependent quantities
ElectricFields.field_amplitude
— Functionfield_amplitude(f, t)
Compute the field amplitude from the vector_potential
$A(t)$ using automatic differentiation according to
\[F(t) = -\partial_t A(t).\]
field_amplitude(f, a, b)
Compute the time integral of the field amplitude according to
\[\int_a^b\diff{t}F(t) = -[A(b) - A(a)],\]
where $A(t)$ is the vector_potential
.
ElectricFields.vector_potential
— Functionvector_potential(f, t)
Compute the vector potential $\vec{A}(t)$ of the field f
.
ElectricFields.instantaneous_intensity
— Functioninstantaneous_intensity(f, t)
Compute the instantaneous intensity of the field f
as
\[I_i(t) = \abs{F(t)}^2 = \abs{-\partial_t A(t)}^2.\]
ElectricFields.intensity
— Methodintensity(f, t)
Compute the time-dependent intensity of the field f
by phase-shifting the carrier continuously until the maximum instantaneous_intensity
is achieved.
ElectricFields.field_envelope
— Functionfield_envelope(f, t)
Compute the field amplitude envelope as the square root of intensity
.
ElectricFields.span
— Functionspan(f)
Return the end-points for the envelope
of the field f
.
span(f::ApodizedField)
The span of f
is given by the intersection of span(parent(f))
and the apodizing interval a .. b
.
ElectricFields.timeaxis
— Functiontimeaxis(f[, fs])
Construct a time axis for the field f
, covering the span
of the envelope in the number of steps
given by the sample frequency fs
.
timeaxis(f, (N,dt))
Alternate interface that constructs the time axis with N
steps starting from first(span(f))
, with intervals of dt
.
ElectricFields.steps
— Functionsteps(f[, fs])
Return number of time steps for the field f
, optionally supplying a sampling frequency.
We construct the time axis such that the highest frequency component of the field is resolved. By the Nyquist sampling theorem, we need minimum $f_s>2f_{\textrm{max}}$, but to be on the safe side, we use, as default, $f_s=100f_{\textrm{max}}$. This also makes plots nicer.
If fs<:Integer
, the sampling frequency is computed as fs/T
, i.e. fs
steps per cycle.
Spectra
ElectricFields.spectrum
— Functionspectrum(env::AbstractGaussianEnvelope)
Gaussians belong to the Schwartz class, i.e. functions who, under Fourier transform, are mapped back to the same space. That is to say, the Fourier transform of a Gaussian is a Gaussian:
\[\exp(-\alpha t^2) \leftrightarrow \frac{1}{\sqrt{2\alpha}} \exp\left(-\frac{\omega^2}{4\alpha}\right).\]
Comparing with the above, we find that the spectral standard deviation
\[\Omega = \sqrt{2\alpha} = \frac{2\sqrt{\ln 2}}{\tau},\]
and the Gaussian function in the spectral domain is thus
\[E(\omega) = \frac{E_0\tau}{2\sqrt{\ln 2}} \exp\left[-\frac{(\omega\tau)^2}{8\ln2}\right].\]
ElectricFields.field_amplitude_spectrum
— Functionfield_amplitude_spectrum(f::AbstractField, ω)
Compute the analytic Fourier transform of the field_amplitude
of the field f
at the angular frequency ω
, using the Fourier identity
\[\vec{F}(t) = -\partial_t \vec{A}(t) \iff \hat{\vec{F}}(\omega) = -\im\omega \hat{\vec{A}}(\omega)\]
ElectricFields.vector_potential_spectrum
— Functionvector_potential_spectrum(f::AbstractField, ω)
Compute the analytic Fourier transform of the vector_potential
of the field f
at the angular frequency ω
.
AbstractFFTs.fft
— Functionfft(f::AbstractField, t::AbstractRange)
Compute the FFT of the field_amplitude
of the field f
sampled on the uniform temporal grid t
.
ElectricFields.nfft
— Functionnfft(y, ts...)
Normalized FFT of y
with respect to the axes ts
. We use the symmetric normalization $(2\pi)^{-N/2}$ where $N$ is the number of dimensions.
nfft(f::AbstractField, t::AbstractRange)
Compute the symmetrically normalized FFT of the field_amplitude
of the field f
sampled on the uniform temporal grid t
.
ElectricFields.fft_vector_potential
— Functionfft_vector_potential(f::AbstractField, t::AbstractRange)
Compute the FFT of the vector_potential
of the field f
sampled on the uniform temporal grid t
.
ElectricFields.nfft_vector_potential
— Functionnfft_vector_potential(f::AbstractField, t::AbstractRange)
Compute the symmetrically normalized FFT of the vector_potential
of the field f
sampled on the uniform temporal grid t
.
ElectricFields.fftω
— Functionfftω(t::AbstractRange)
Return the angular frequency grid corresponding to uniform sampling in time with the tempolar grid t
.
AbstractFFTs.rfft
— Functionrfft(f::AbstractField, t::AbstractRange)
Compute the RFFT of the field_amplitude
of the field f
sampled on the uniform temporal grid t
, in the case of real-valued signals.
AbstractFFTs.irfft
— Functionirfft(F, t)
Compute the IRFFT of the spectral amplitudes F
, with the end-result resolved on the time axis t
, in the case of real-valued signals.
ElectricFields.rfft_vector_potential
— Functionrfft_vector_potential(f::AbstractField, t::AbstractRange)
Compute the RFFT of the vector_potential
of the field f
sampled on the uniform temporal grid t
, in the case of real-valued signals.
ElectricFields.rfftω
— Functionrfftω(t::AbstractRange)
Return the angular frequency grid corresponding to uniform sampling in time with the tempolar grid t
, in the case of real-valued signals.