Laser Beams#

Here we implement the generic LaserBeam class, as well as some actual laser beam classes

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.beams.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: LaserBeam

A 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

gen_infostring_obj(show_polar=True)[source]#

Generates an info string object

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.beams.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: EnvObject

Representing 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

gen_infostring_obj(show_polar=True)[source]#

Generates an info string object

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_axis as 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_axis should 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_norm is an array whose size matches the one of quantization_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 = | 〈Ψ|π⟩ | ** 2
sigmaplus_amp = | 〈Ψ|σ+⟩ | ** 2
sigma_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_axis as 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_axis should 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_amp is an array whose size matches the one of quantization_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_axis as 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_axis as 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+"] = | 〈Ψ|σ+⟩ | ** 2
res["sigma-"] = | 〈Ψ|σ-⟩ | ** 2
res["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 ax parameter, make sure to use our custom implementation of matplotlib Axes3D, as this function uses custom arrow drawing methods. The class can be imported via from atomsmltr.utils.plotter import Axes3D

property polarization: Polarization#

laser polarization object

Type:

Polarization

property power: float#

laser power (W)

Type:

float

print_info(show_polar=True)[source]#

prints the atom infostring

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.beams.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: LaserBeam

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

gen_infostring_obj(show_polar=True)[source]#

Generates an info string object

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