Interface

Creation

ElectricFields.@fieldMacro
@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σ)
source

Time-dependent quantities

ElectricFields.field_amplitudeFunction
field_amplitude(f, t)

Compute the field amplitude from the vector_potential $A(t)$ using automatic differentiation according to

\[F(t) = -\partial_t A(t).\]

source
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.

source
ElectricFields.spanFunction
span(f)

Return the end-points for the envelope of the field f.

source
span(f::ApodizedField)

The span of f is given by the intersection of span(parent(f)) and the apodizing interval a .. b.

source
ElectricFields.timeaxisFunction
timeaxis(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.

source
timeaxis(f, (N,dt))

Alternate interface that constructs the time axis with N steps starting from first(span(f)), with intervals of dt.

source
ElectricFields.stepsFunction
steps(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.

source

Spectra

ElectricFields.spectrumFunction
spectrum(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].\]

source
ElectricFields.field_amplitude_spectrumFunction
field_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)\]

source
ElectricFields.nfftFunction
nfft(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.

source
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.

source
ElectricFields.fftωFunction
fftω(t::AbstractRange)

Return the angular frequency grid corresponding to uniform sampling in time with the tempolar grid t.

source