atomsmltr.environment.lasers package#
The atomsmltr.environment.laserssubpackage provides definitions for lasers
It defines two main classes :
LaserBeam> to manage laser intensity, propagation, etc.Polarization> to specifically manage the polarization
Examples
Setup a Gaussian beam
from atomsmltr.environment.lasers import GaussianLaserBeam
from atomsmltr.environment.lasers.polarization import CircularLeft
beam = GaussianLaserBeam(
wavelength=399e-9,
waist=50e-6,
power=30e-3,
waist_position=(0, 0, 0),
direction=(0, 0, 1),
polarization=CircularLeft(),
)
- class atomsmltr.environment.lasers.CircularLeft[source]#
Bases:
PolarizationCircular Left polarization (observer point of vue)
- class atomsmltr.environment.lasers.CircularRight[source]#
Bases:
PolarizationCircular Right polarization (observer point of vue)
- class atomsmltr.environment.lasers.GaussianLaserBeam(wavelength: float = 3.99e-07, waist: float = 0.001, power: float = 0.001, waist_position: ~numpy.ndarray = (0, 0, 0), direction: ~numpy.ndarray = (0, 0, 1), direction_type: str = 'vector', polarization: ~atomsmltr.environment.lasers.polarization.Polarization = <atomsmltr.environment.lasers.polarization.Vertical object>, tag: str = None)[source]#
Bases:
LaserBeamA Gaussian laser beam
- Parameters:
wavelength (float, optional) – vacuum wavelength (m), by default 399e-9
waist (float, optional) – 1/e^2 waist radius (m), by default 1e-3
power (float, optional) – laser power (W), by default 1e-3
waist_position (array, shape (,3), optional) – cartesian coordinates of the waist / focus position, in meters and in the lab frame, by default (0, 0, 0)
direction (array, shape (,3) or (,2), optional) – depending on ‘direction type’, a vector or a (theta, phi) couple giving the propagation direction of the beam
direction_type (str, optional) – type of direction : “vector” or “thetaphi”, by default “vector”
polarization (Polarization, optional) – laser polarization, by default Vertical()
tag (str, optional) – laser tag, by default None
- property rayleigh_length: float#
the laser Rayleigh length
- Type:
float
- set_power_from_I(target_I: float) None[source]#
Sets the power to reach a target intensity
- Parameters:
target_I (float) – target intensity (W/m^2)
- set_waist_from_I(target_I: float) None[source]#
Sets the waist radius to reach a target intensity
- Parameters:
target_I (float) – target intensity (W/m^2)
- property type#
a description of the object type
- Type:
str
- class atomsmltr.environment.lasers.Horizontal[source]#
Bases:
PolarizationHorizontal polarization (along y in the laser frame)
- class atomsmltr.environment.lasers.LaserBeam(wavelength: float = 3.99e-07, waist: float = 0.001, power: float = 0.001, waist_position: ~numpy.ndarray = (0, 0, 0), direction: ~numpy.ndarray = (0, 0, 1), direction_type: str = 'vector', polarization: ~atomsmltr.environment.lasers.polarization.Polarization = <atomsmltr.environment.lasers.polarization.Vertical object>, tag: str = None)[source]#
Bases:
EnvObjectRepresenting laser beams
- Parameters:
wavelength (float, optional) – vacuum wavelength (m), by default 399e-9
waist (float, optional) – 1/e^2 waist radius (m), by default 1e-3
power (float, optional) – laser power (W), by default 1e-3
waist_position (array, shape (,3), optional) – cartesian coordinates of the waist / focus position, in meters and in the lab frame, by default (0, 0, 0)
direction (array, shape (,3) or (,2), optional) – depending on ‘direction type’, a vector or a (theta, phi) couple giving the propagation direction of the beam
direction_type (str, optional) – type of direction : “vector” or “thetaphi”, by default “vector”
polarization (Polarization, optional) – laser polarization, by default Vertical()
tag (str, optional) – laser tag, by default None
- property direction: ndarray#
either a vector or a (theta, phi) tuple describing the laser direction
- Type:
array
- property direction_type: str#
type of direction setting. Can be “vector” or “thetaphi”
- Type:
str
- get_polarization_quant(quantization_axis: ndarray, nocheck: bool = False) ndarray[source]#
Returns squared norm the projection of the polarization state |Ψ⟩ on |σ+⟩, |σ-⟩ and |π⟩, using the vector
quantization_axisas a quantification axis. See documentation for a derivation of this projection.- Parameters:
quantization_axis (array of shape (3,) or (n1, n2, ..., 3)) – cartesian coordinates of the quantization axis vector in the lab frame
nocheck (bool, optional) – if set to True, function will not check that the shape of position matches requirements, by default False
- Returns:
polar_norm – contains the polarization norm for π, σ+ and σ- components
- Return type:
array of shape (3,) or (n1, n2, …, 3)
Notes
The input
quantization_axisshould be an array of shape (3,) or (n1, n2, .., 3), where the cartesian coordinates of the quantization axis are stored in the last dimension (of size 3)the result
polar_normis an array whose size matches the one ofquantization_axis, where the last dimension of size 3 contains the projections of the polarization state on π, σ+ and σ-That is :
>>> pi_amp, sigmaplus_amp, sigma_minus_amp = polar_norm.T
With:
pi_amp= | 〈Ψ|π⟩ | ** 2sigmaplus_amp= | 〈Ψ|σ+⟩ | ** 2sigma_minus_amp= | 〈Ψ|σ-⟩ | ** 2
- get_polarization_quant_amplitude(quantization_axis: ndarray, nocheck: bool = False) ndarray[source]#
Returns the projection of the polarization state |Ψ⟩ on |σ+⟩, |σ-⟩ and |π⟩, using the vector
quantization_axisas a quantification axis. See documentation for a derivation of this projection.- Parameters:
quantization_axis (array of shape (3,) or (n1, n2, ..., 3)) – cartesian coordinates of the quantization axis vector in the lab frame
nocheck (bool, optional) – if set to True, function will not check that the shape of position matches requirements, by default False
- Returns:
polar_amp – contains the polarization amplitude for π, σ+ and σ- components
- Return type:
array of shape (3,) or (n1, n2, …, 3)
Notes
The input
quantization_axisshould be an array of shape (3,) or (n1, n2, .., 3), where the cartesian coordinates of the quantization axis are stored in the last dimension (of size 3)the result
polar_ampis an array whose size matches the one ofquantization_axis, where the last dimension of size 3 contains the projections of the polarization state on π, σ+ and σ-That is :
>>> pi_amp, sigmaplus_amp, sigma_minus_amp = polar_amp.T
With:
pi_amp= 〈Ψ|π⟩sigmaplus_amp= 〈Ψ|σ+⟩sigma_minus_amp= 〈Ψ|σ-⟩
- get_polarization_quant_amplitude_dict(quantization_axis: ndarray) dict[source]#
Returns the projection of the polarization state |Ψ⟩ on |σ+⟩, |σ-⟩ and |π⟩, using the vector
quantization_axisas a quantification axis. See documentation for a derivation of this projection.- Parameters:
quantization_axis (array of shape (3,) or (n1, n2, ..., 3)) – cartesian coordinates of the quantization axis vector in the lab frame
- Returns:
res – dict containing the polarization amplitude for π, σ+ and σ- components
- Return type:
dict
Notes
The result is returned as a dictionnary res, such as :
res["sigma+"]= 〈Ψ|σ+⟩res["sigma-"]= 〈Ψ|σ-⟩res["pi"]= 〈Ψ|π⟩
- get_polarization_quant_dict(quantization_axis)[source]#
Returns the squared norm of projection of the polarization state |Ψ⟩ on |σ+⟩, |σ-⟩ and |π⟩, using the magnetic field vector
quantization_axisas a quantification axis. See documentation for a derivation of this projection.- Parameters:
quantization_axis (array of shape (3,) or (n1, n2, ..., 3)) – cartesian coordinates of the quantization axis vector in the lab frame
- Returns:
res – dict containing the polarization norm for π, σ+ and σ- components
- Return type:
dict
Notes
The result is returned as a dictionnary res, such as :
res["sigma+"]= | 〈Ψ|σ+⟩ | ** 2res["sigma-"]= | 〈Ψ|σ-⟩ | ** 2res["pi"]= | 〈Ψ|π⟩ | ** 2
- get_polarization_vector_in_lab_frame() ndarray[source]#
Returns the polarization vector describing the current polarization state, in the LAB frame
- Returns:
p_vec – cartesian coordinates of the polarization vector (lab frame)
- Return type:
array of shape (,3)
Notes
See documentation for the exact definition of the vector. In short :
> p_vec = (1, 0, 0): linear polarization along x (vertical)> p_vec = (0, 1, 0): linear polarization along y (horizontal)> p_vec = (0, 0, 1): circular right polarization> p_vec = (0, 0, -1): circular left polarization
- get_polarization_vector_in_laser_frame() ndarray[source]#
Returns the polarization vector describing the current polarization state, in the LASER frame
- Returns:
p_vec – cartesian coordinates of the polarization vector (laser frame)
- Return type:
array of shape (,3)
Notes
See documentation for the exact definition of the vector. In short :
> p_vec = (1, 0, 0): linear polarization along x (vertical)> p_vec = (0, 1, 0): linear polarization along y (horizontal)> p_vec = (0, 0, 1): circular right polarization> p_vec = (0, 0, -1): circular left polarization
- get_value(position: ndarray, nocheck=False) ndarray[source]#
Returns laser intensity at a given position in the lab frame
- Parameters:
position (array of shape (3,) or (n1, n2, ..., 3)) – cartesian coordinates in the lab frame
nocheck (bool, optional) – if set to True, function will not check that the shape of position matches requirements, by default False
- Returns:
intensity – laser intensity at position
- Return type:
float or array of shape (n1, n2, …, 1)
Notes
position is an array_like object, with shape (3,) or (n1, n2, .., 3). In all cases, the last dimension contains cordinates (x, y, z), in meter and in the lab frame
- property k: float#
laser wavenumber k = 2π / λ (m^-1)
- Type:
float
- property kvec: ndarray#
vector version of the laser wavenumber k = 2π / λ (m^-1)
- Type:
array
- plot2D(limits: ndarray, Npoints: ndarray, cut: float = 0, ax=None, plane: str = 'XY', cmap=None, show: bool = False, space_scale: float = 1.0)[source]#
Plots a 2D cut of the laser intensity, using Matplotlib pcolormesh()
- Parameters:
limits (array, shape (4,)) – an array of size 4, providing (xmin, xmax, ymin, ymax).
Npoints (int or array of shape (2,)) – number of points for each dimension, either a int or an array of two ints (Nx, Ny).
cut (float, optional) – coordinate of the third axis for the cut. Defaults to 0.
ax (Matplotlib Axes, optional) – the matplotlib axis on which to plot. If None is given a new figure is created. Defaults to None.
plane (str, optional) – the plane for the cut. Accepted values are “XY”, “YZ” and “ZX”. Defaults to “XY”.
cmap (Matplotlib cmap, optional) – passed to matplotlib pcolormesh() function
show (bool, optional) – whether to show the figure after calling the method. Defaults to False.
space_scale (float, optional) – space coordinates will be multiplied by this when plotting. Defaults to 1.
- Returns:
ax – the axis on which the plot was performed.
- Return type:
Matplotlib Axes
Notes
The limits are given via an array of size 4 ‘limits’, providing providing (xmin, xmax, ymin, ymax) Number of points are given with ‘Npoints’, either as an integer (same value for x and y) or an array of size 2 the coordinate of the cut axis is given by ‘cut’
Examples
>>> beam.plot2D(limits=(-5, 5, -4, 4), Npoints=200) >>> beam.plot2D(limits=(-5, 5, -4, 4), Npoints=200, cut=-5) >>> beam.plot2D(limits=(-5, 5, -4, 4), Npoints=(200, 100))
- plot3D(ax=None, color: str = None, name: str = None, vscale: float = None, show: bool = False)[source]#
- plots a 3D reprensentation of the laser beam, including:
a line : laser axis
an arrow along the propagation direction
a point : laser focus position
a dotted arrow : laser polarization vector
- Parameters:
ax (custom Axes3D, optional) – the axis in which to plot. If None is given (default value) a new ax is generated
color (str, optional) – a matplotlib compatible color. Defaults to None.
name (str, optional) – the name of the laser, passed as a label when plotting. If none is given, use the laser tag
vscale (float, optional) – A scaling factor. Use it to tweak the arrow size if needed. Defaults to None.
show (bool, optional) – Whether the show the figure after calling the method. Defaults to False.
- Returns:
ax – the figure axis in which the laser is plotted.
- Return type:
custom Axes3D
Note
When providing an axis via the
axparameter, make sure to use our custom implementation of matplotlibAxes3D, as this function uses custom arrow drawing methods. The class can be imported viafrom atomsmltr.utils.plotter import Axes3D
- property polarization: Polarization#
laser polarization object
- Type:
- property power: float#
laser power (W)
- Type:
float
- abstractmethod set_power_from_I(target_I: float)[source]#
Sets the power to reach a target intensity
- Parameters:
target_I (float) – target intensity (W/m^2)
- abstractmethod set_waist_from_I(target_I: float)[source]#
Sets the waist radius to reach a target intensity
- Parameters:
target_I (float) – target intensity (W/m^2)
- property unit_vector: ndarray#
unit vector describing laser propagation
- Type:
array of shape (,3)
- property vector#
True it the object value is vectorial, False if scalar
- Type:
bool
- property waist: float#
laser 1/e^2 radius (m)
- Type:
float
- property waist_position: ndarray#
cartesian coordinates of the laser focus / waist position in the lab frame (m)
- Type:
array of shape (,3)
- property wavelength: float#
laser vacuum wavelength (m)
- Type:
float
- class atomsmltr.environment.lasers.Linear(angle: float)[source]#
Bases:
PolarizationArbitrary linear polarization.
Here,
angleis the angle of the linear polarization with respect to the x axis. Henceangle = 0corresponds to a linear polarization along x, andangle = pi/2to a linear polarization along y- Parameters:
angle (float) – angle of the arbitrary linear polarization w.r.t the x axis (radians)
- property angle: float#
angle of the arbitrary linear polarization w.r.t the x axis (radians)
- Type:
float
- class atomsmltr.environment.lasers.PlaneWaveLaserBeam(wavelength: float = 3.99e-07, waist: float = 0.001, power: float = 0.001, waist_position: ~numpy.ndarray = (0, 0, 0), direction: ~numpy.ndarray = (0, 0, 1), direction_type: str = 'vector', polarization: ~atomsmltr.environment.lasers.polarization.Polarization = <atomsmltr.environment.lasers.polarization.Vertical object>, tag: str = None)[source]#
Bases:
LaserBeamImplements a plane wave. For convenience, we still define the waist and power, and the intensity is constant and corresponds to the peak intensity of a Gaussian beam with same power and waist.
- set_power_from_I(target_I: float) None[source]#
Sets the power to reach a target intensity
- Parameters:
target_I (float) – target intensity (W/m^2)
- set_waist_from_I(target_I: float) None[source]#
Sets the waist radius to reach a target intensity
- Parameters:
target_I (float) – target intensity (W/m^2)
- property type#
a description of the object type
- Type:
str
- class atomsmltr.environment.lasers.Polarization[source]#
Bases:
ABCAn object to handle laser polarization.
- get_polarization_vector_angles() tuple[source]#
Returns the angles describing the current polarization vector.
(see documentation for thorough description)
- Returns:
u, v – the u (polar) and v (azimuthal) angles
- Return type:
floats
Notes
The polarization is decribed in the Poincarré/Bloch-like sphere as a vector. This function yields the angles u (polar) and v (azimuthal)
Note that we do not use theta or phi as those angles are already used to describe the orientation of the laser propagation vector in the
LaserBeamclass
- get_polarization_vector_projection(target: str) complex[source]#
Returns the scalar projection of the current polarization vector on a target polarization state
- Parameters:
target (str) – the state on which to project (see docstring Notes)
- Returns:
proj – the projection
- Return type:
complex
Notes
The polarization Psi is defined as :
with |R⟩, |L⟩ the right- and left-handed circular polarization states. We also have
Target should refer to the special polarization states defined in the class :
>>> 'vertical', 'horizontal', 'circular left', 'circular right'
and corresponding shorthands:
>>> 'V' or 'x', 'H' or 'y', 'R', 'L'
- get_polarization_vector_projection_norm(target: str) float[source]#
Returns the squared norm of scalar projection of the current polarization vector on a target polarization state
- Parameters:
target (str) – the state on which to project (see docstring Notes)
- Returns:
norm – the squared norm of the projection
- Return type:
float
Notes
The polarization Psi is defined as :
with |R⟩, |L⟩ the right- and left-handed circular polarization states. We also have
Target should refer to the special polarization states defined in the class :
>>> 'vertical', 'horizontal', 'circular left', 'circular right'
and corresponding shorthands:
>>> 'V' or 'x', 'H' or 'y', 'R', 'L'
- class atomsmltr.environment.lasers.Vector(vector: ndarray)[source]#
Bases:
PolarizationAllows to define an arbitrary polarization.
The polarization vector has to be given with the
vectorargument.vectorare the cartesian coordinates of the vector in the (x,y,z) basis.For instance :
> vec = (1, 0, 0): linear polarization along x> vec = (0, 1, 0): linear polarization along y> vec = (0, 0, 1): circular right polarization> vec = (0, 0, -1): circular left polarizationATTENTION : for ease of use, the vector does not have to be normalized, but the resulting one will be.
- Parameters:
vector (array of shape (,3)) – polarization vector cartesian coordinates in laser frame (see documentation for its exact definition)
- property vector#
polarization vector cartesian coordinates in laser frame
- Type:
array of shape (3,)
- class atomsmltr.environment.lasers.Vertical[source]#
Bases:
PolarizationVertical polarization (along x in the laser frame)
Submodules#
- Laser Beams
GaussianLaserBeamLaserBeamLaserBeam.directionLaserBeam.direction_typeLaserBeam.gen_infostring_obj()LaserBeam.get_polarization_quant()LaserBeam.get_polarization_quant_amplitude()LaserBeam.get_polarization_quant_amplitude_dict()LaserBeam.get_polarization_quant_dict()LaserBeam.get_polarization_vector_in_lab_frame()LaserBeam.get_polarization_vector_in_laser_frame()LaserBeam.get_value()LaserBeam.kLaserBeam.kvecLaserBeam.plot2D()LaserBeam.plot3D()LaserBeam.polarizationLaserBeam.powerLaserBeam.print_info()LaserBeam.set_power_from_I()LaserBeam.set_waist_from_I()LaserBeam.unit_vectorLaserBeam.vectorLaserBeam.waistLaserBeam.waist_positionLaserBeam.wavelength
PlaneWaveLaserBeam- Polarization
CircularLeftCircularRightHorizontalLinearPolarizationVectorVertical