wavepacket.special
Special functions for use in Wavepacket.
These mostly encompass typical pulse shapes or initial states.
Classes
Callable that defines a one-dimensional Gaussian function. |
|
Callable that defines a plane wave. |
|
Callable that returns a spherical harmonic Y_l^m(theta, phi=0). |
|
Shape function for a squared sinusoidal laser pulse. |
|
Shape function for a rectangular pulse with soft (cosine) turn-on. |
Package Contents
- class wavepacket.special.Gaussian(x: float = 0.0, p: float = 0.0, *, rms: float | None = None, fwhm: float | None = None)
Bases:
wavepacket.typing.GeneratorCallable that defines a one-dimensional Gaussian function.
This callable can be supplied wherever a callable is required. An example would be an initial wave function for
wavepacket.builder.product_wave_function(), or a potential wrapped in awavepacket.operator.Potential1D.- Parameters:
- xfloat, default=0
The center of the Gaussian.
- pfloat, default=0
The momentum of the Gaussian.
- rms, fwhmfloat
You must specify the width of the Gaussian using exactly one of these keyword parameters, either the root-mean-square width, or the full-width-at-half-maximum.
- Raises:
- wp.InvalidValueError
If the width of the Gaussian is not positive.
- wp.BadFunctionCall
If both rms and fwhm have either been set or not supplied.
Notes
Up to scaling, the functional form of the Gaussian is
.
Here, sigma is the rms width, which is connected to the FWHM by
.
- class wavepacket.special.PlaneWave(k: float)
Bases:
wavepacket.typing.GeneratorCallable that defines a plane wave.
You will typically use this callable for initial states. There are often better options, especially if your FBR already defines a plane wave basis, but sometimes you may just want to represent a reasonable plane wave and not count indices to get the correct wave vector.
- Parameters:
- kfloat
The wave vector of the plane wave.
- class wavepacket.special.SphericalHarmonic(l: int, m: int)
Bases:
wavepacket.typing.RealGeneratorCallable that returns a spherical harmonic Y_l^m(theta, phi=0).
Usually, this callable will be used for initial states. Note that the phi-dependence of a spherical harmonic is trivial exp(i m phi), and usually not needed (we fix m and the phi-integration yields a constant). For this reason, the functor takes only the theta-values as single parameters, and returns the spherical harmonic at phi = 0.
- Parameters:
- lint
The rotational quantum number / angular momentum
- mint
The minor rotational quantum number -l <= m <= l
- Raises:
- wp.InvalidValueError
If l is negative or if (-l <= m <= l) does not hold.
- class wavepacket.special.SinSquare(t0: float, half_width: float)
Shape function for a squared sinusoidal laser pulse.
Usually, you use this function to describe a smooth laser pulse with a definite start and end point (which a Gaussian does not have). The exact shape is
, and
zero outside the interval
.- Parameters:
- t0: float
The center of the pulse.
- half_width
The half-width of the laser pulse,
.
- Raises:
- wp.InvalidValueException
if the half-width is not positive.
- class wavepacket.special.SoftRectangularFunction(t0: float, half_width: float, border: float | None = None)
Shape function for a rectangular pulse with soft (cosine) turn-on.
This shape function is a rectangular function with a given half-width, with an added soft turn-on and turn-off of the form
with the border width B.- Parameters:
- t0: float
Center of the rectangular pulse.
- half_width: float
Half-width of the rectangular part of the pulse.
- border: float = half_width/10
Optional width of the turn-on / turn-off region.
- Raises:
- wp.InvalidValueError
If the half-width or the border region is not positive.