MoleCool.Lasersystem.Lasersystem#
- class MoleCool.Lasersystem.Lasersystem(freq_pol_switch=5000000.0)[source]#
Bases:
objectSystem consisting of
Laserobjects and methods to add them properly. These respective objects can be retrieved and also deleted by using the normal item indexing of aLasersystemobject.Example
from MoleCool import Lasersystem lasers = Lasersystem() lasers.add(lamb=860e-9,P=20e-3,pol='lin') lasers.add(lamb=890e-9,I=1000,FWHM=2e-3) laser1 = lasers[0] # call first Laser object included in lasers del lasers[-1] # delete last added Laser object print(lasers[0]) print(lasers)
- Parameters:
freq_pol_switch (float, optional) – Specifies the frequency (without 2pi) with which the polarization is switched if the polarization switching is enabled. The default is 5e6.
Methods
DF(**kwargs)Create a pretty
pandas.DataFrameobject with all lasers and their attributes.I_tot(r, **kwargs)Calculate the total intensity of all lasers in this Lasersystem at a specific position r.
__init__([freq_pol_switch])System consisting of
Laserobjects and methods to add them properly.add([lamb, P, pol])Add a
Laserinstance to the laser system.add_sidebands([lamb, offset_freq, mod_freq, ...])Add multiple
Laserinstances as sidebands e.g. to drive multiple hyperfine transitions.check_config([raise_Error])Check the configuration for simulating internal dynamics using the OBEs or rate equations.
get_intensity_func([sum_lasers, use_jit])Generate a fast function which uses all the current parameters of all lasers in this Lasersystem for calculating the total intensity.
getarr(attr)Get an array with a specific attribute of all included
Laserobjects.make_retrorefl_beams([beam_config, P_tot, ...])Create all
Laserobjects for a realistic retroreflecting beam configuration for a long cooling interaction region in the experiment.plot_I_1D([ax, axshifts, limits, Npoints, label])Plot the 1D intensity distribution of all laser beams along an axis by using the method
get_intensity_func().plot_I_2D([ax, axshift, limits, Npoints])Plot the 2D intensity distribution of all laser beams along two axes by using the method
get_intensity_func().plot_spectrum([axs, unit, subplot_sep, std, ...])Plot the spectrum of
Laserobjects with their respective intensities.Attributes
Calculate the sum of the peak intensities of all laser beams
Calculate the sum of the powers of all laser beams
Display a short description with the number of included laser objects.
Calculate the number of included Laser objects.
Polarization switching frequency.
- add(lamb=8.6e-07, P=0.02, pol='lin', **kwargs)[source]#
Add a
Laserinstance to the laser system.Note
This is the same as:
from MoleCool import Laser lasers.entries.append(Laser())
- Parameters:
**kwargs – Arbitrary keyword arguments. Same as in the
__init__method of the classLaser.
- getarr(attr)[source]#
Get an array with a specific attribute of all included
Laserobjects.- Parameters:
attr (str) – Laser attribute, e.g.
lamborP.- Returns:
Array with the lasers’ attributes.
- Return type:
- add_sidebands(lamb=8.6e-07, offset_freq=0.0, mod_freq=1000000.0, ratios=None, sidebands=[-1, 1], **kwargs)[source]#
Add multiple
Laserinstances as sidebands e.g. to drive multiple hyperfine transitions. The individual sidebands are detuned from the center frequency by the modulation frequencymod_freqtimes the values in the listsidebands, i.e. formod_freq=1e6andsidebands=[-1,0,2], the sidebands are detuned by -1 MHz, 0 MHz and 2 MHz. The center frequency is given by the wavelength lamb and an additional general offset frequencyoffset_freq.- Parameters:
lamb (float) – wavelength of the main transition.
P (float) – Power, i.e. sum of the powers of all sidebands. Alternativley the sum of the intensities can be provided.
I (float) – Sum of all sideband intensities. Can be provided instead of power P.
offset_freq (float) – All Laser sidebands are all additionally detuned by the value of offset_freq (in Hz without 2 pi). Experimentally, this shift is often realized with an AOM. The default is 0.0.
mod_freq (float) – starting from the offset-shifted center frequency, sideband Laserobjects are added with the detunings sidebands`*`mod_freq (without 2 pi).
ratios (array_like, optional) – Power/ intensity ratios of the individual sidebands. Must be provided in the same order as the mod_freq parameter. (Will be normed to specify the individual sideband powers). The default is equally distributed power.
sidebands (array_like, optional) – determines the number of sidebands and their detuning in units of the mod_freq parameter.
**kwargs – optional arguments (see
Laser).
- make_retrorefl_beams(beam_config='oneside', P_tot=0.1, FWHM=0.0016, w_cylind=0.0, T_airglass=0.9962, R_mirror=0.9834, mirror_sep=0.463, reflections=34, int_length=0.2, x_offset=0.015, cut_flanks=True, printing=True, plotting=False, **laser_kwargs)[source]#
Create all
Laserobjects for a realistic retroreflecting beam configuration for a long cooling interaction region in the experiment.- Parameters:
beam_config (str, optional) – ‘oneside’ when only one laser beam is retro-reflected from one side. ‘twosides’ for two laser beams entering the interaction region from both sides, e.g. for Sisyphus cooling. The default is ‘oneside’.
P_tot (float, optional) – Total inital power (W) of the incoming laser beam or beams. The default is 100e-3.
FWHM (float, optional) – FWHM of the beams. The default is 1.6e-3.
w_cylind (float, optional) – width (m) of a cylindrical widened beam. The default is 0.0.
T_airglass (float, optional) – Single transmission air - glass. The default is 99.62e-2.
R_mirror (float, optional) – Reflectivity of the mirror. The default is 98.34e-2.
mirror_sep (float, optional) – Separation (m) between both retro-reflecting mirrors. The default is 463e-3.
reflections (int, optional) – number of reflections (counting all reflections of a single incoming beam on all mirrors). The default is 34.
int_length (float, optional) – Total length (m) of the interaction region, i.e. from first to last intensity peak along the centered axis. The default is 200e-3.
x_offset (float, optional) – Additional offset of the reflections, i.e. position of the first reflection on the centered axis. The default is 15e-3.
cut_flanks (bool, optional) – Whether the flanks of the beam profiles should be cutted which is usually the case on the mirror for two beams from both sides. The default is True.
printing (bool, optional) – Whether printing additional information. The default is True.
plotting (bool, optional) – Whether plotting the 1D and 2D intensity distributions. The default is False.
**laser_kwargs (kwargs, optional) – Further keyword arguments for the created laser objects such as e.g. wavelength.
- get_intensity_func(sum_lasers=True, use_jit=True)[source]#
Generate a fast function which uses all the current parameters of all lasers in this Lasersystem for calculating the total intensity. This function can also be called directly by calling the method
I_tot()with an input parameterras the position at which the total intensity is calculated.- Parameters:
sum_lasers (bool, optional) – If True, the returned intensity function evaulates the intensities of all laser instances for returning the local total intensity sum. If False, the returned intensity function only returns an array with the length of defined laser instances. This array contains the factors which corresponds to the local intensity of each laser divided by its maximum intensity at the center of the Gaussian distribution. The default is True.
use_jit (bool, optional) – The returned function can be compiled in time to a very fast C code using the numba package. However, the compilation time can be a few seconds long the first time the function is called. For all later calls it is then much faster. The default is True.
- Returns:
it’s the same function which is used in the method
I_tot()- Return type:
function
- I_tot(r, **kwargs)[source]#
Calculate the total intensity of all lasers in this Lasersystem at a specific position r. For this calculation the function generated by
get_intensity_func()is used.- Parameters:
r (1D array of size 3) – position at which the total intensity is calculated.
**kwargs (keywords) – optional keywords of the method
get_intensity_func()can be provided.
- Returns:
total intensity at the position r.
- Return type:
- plot_I_2D(ax='x', axshift=0, limits=([-0.05, 0.05], [-0.05, 0.05]), Npoints=201)[source]#
Plot the 2D intensity distribution of all laser beams along two axes by using the method
get_intensity_func().- Parameters:
ax (str, optional) – axis orthogonal to the plane to be plotted. Can be ‘x’,’y’ or ‘z’. The default is ‘x’.
axshift (float, optional) – shift along the axis ax which defines the absolute position of the plane to be plotted. The default is 0.
limits (tuple(list,list), optional) – determines the minimum and maximum limit for both axes which lies in the plane to be plotted. The default is ([-0.05,0.05],[-0.05,0.05]).
Npoints (int, optional) – Number of plotting points for each axis. The default is 201.
- plot_I_1D(ax='x', axshifts=[0, 0], limits=[-0.05, 0.05], Npoints=1001, label=None)[source]#
Plot the 1D intensity distribution of all laser beams along an axis by using the method
get_intensity_func().- Parameters:
ax (str, optional) – axis along which the intensity distribution is plotted. The default is ‘x’.
axshifts (list, optional) – shifts in m of the other two axes besides ax. The default is [0,0].
limits (list, optional) – determines the minimum and maximum limit for the axis ax. The default is [-0.05,0.05].
Npoints (int, optional) – Number of plotting points along the axis ax. The default is 1001.
label (str, optional) – label for the plotted curve. If None, the label shows the values of axshifts. The default is None.
- plot_spectrum(axs=[], unit='MHz', subplot_sep=1000000000.0, std=0, wavelengths=[], invert=False, N_points=500, xaxis_ext=5, cmap=None, relative_to_wavelengths=False, fill_between_kwargs={'alpha': 0.2, 'color': 'grey'}, plot_kwargs={'color': 'grey', 'ls': '-'})[source]#
Plot the spectrum of
Laserobjects with their respective intensities. Either as Gaussians for each single laser object or as vertical lines.Note
This method also supports plotting multiple detunings with different colors from
matplotlib.colormapinto a single subplot.- Parameters:
axs (list of
matplotlib.pyplot.axisobjects, optional) – axis/axes to put the plot(s) on. The default is [].unit (str, optional) – Unit of the x-axis to be plotted. Can be one of
['GHz','MHz','kHz','Hz']. Default is ‘MHz’.subplot_sep (float, optional) – Defines the range of the plotted x-axis and the separation for the automatic inclusion of all wavlengths (see parameter
wavelengths) in Hz. The default is 1e9.std (float, optional) – Standard deviation of the individual Gaussians to be drawn in MHz. The default is 0 meaning that instead of Gaussians, vertical lines are drawn.
wavelengths (list, optional) – wavelengths that should be plotted within the range
subplot_sep. By default all available laser wavelengths are used.invert (bool, optional) – Whether the plot y-axis should be inverted. The default is False.
N_points (int, optional) – number of points plotted. The default is 500.
xaxis_ext (TYPE, optional) – The range of the xaxis, given by the lowest and highest transition frequency, is extended by this factor multiplied by the sum of the Gaussian broadening (
std). The default is 5.cmap (std, optional) –
matplotlib.colormapfor plotting multiple spectra for multiple detunings. The default is None.relative_to_wavelengths (bool, optional) – Whether the x-axis should be plotted in absolute frequency units or relative to
wavelengths. The default is False.fill_between_kwargs (dict, optional) – kwargs for the method
matplotlib.pyplot.fill_between. For disabling this plotting, just provide an empty dictionary or False. The default is dict(alpha=0.2, color=’grey’).plot_kwargs (dict, optional) – kwargs for the method normal line plotting method
matplotlib.pyplot.plot. For disabling this plotting, just provide an empty dictionary or False. The default is dict(color=’grey’,ls=’-‘).
- Returns:
axs – Axes of the subplot(s).
- Return type:
list of
matplotlib.pyplot.axis
- DF(**kwargs)[source]#
Create a pretty
pandas.DataFrameobject with all lasers and their attributes. This method basically concatenates the individual laser dataframes fromLaser.DF(). This method is e.g. used when callingprint(lasers).- Parameters:
**kwargs (kwargs) – Keyword arguments of the respective method
Laser.DF().- Returns:
Dataframe with the lasers attributes.
- Return type:
pandas.DataFrame
- check_config(raise_Error=False)[source]#
Check the configuration for simulating internal dynamics using the OBEs or rate equations.
- property description#
Display a short description with the number of included laser objects.
- Returns:
description of the lasersystem.
- Return type:
- property I_sum#
Calculate the sum of the peak intensities of all laser beams
- Returns:
Sum of peak intensities.
- Return type:
- property P_sum#
Calculate the sum of the powers of all laser beams
- Returns:
Sum of all lasers’ powers.
- Return type: