Skip to main content

Laser cooling and trapping simulation tool

Project description

atomSmltr ⚛️ simulating laser cooling & trapping

Code style: black Read the Docs PyPI - Version

atomsmtlr logo

atomSmltr is a user-friendly and modular python package designed to simulate laser cooling in complex magnetic field and laser geometries.


🚨 Disclaimer: this package is still under active development.


📃 Full documentation | 🐍 PyPi

🚀 Installation notes

install latest stable release

just pip it

pip install atomsmtlr

install current version

In our git development workflow, we have three main branches: main for stable relases, testing for development versions that should work most of the time and devel for the implementation of new, more experimental features. If you want to benefit from the latest features, we encourage you to use the testing branch.

First, clone the repository

git clone https://github.com/adareau/atomSmltr.git
cd atomSmltr
git checkout testing

We strongly encourage you to use a virtual environment

python3 -m venv __venv__
source ./__venv__/bin/activate

Then you can use pip

pip install .

That's it, you should be good to go !!

✨ Try atomsmtlr

Below is a minimal example. You should also check the examples in the provided documentations, that contains a collection of jupyter notebooks that will guide you into using atomsmtlr.

⏩ checkout ./docs/_notebook_examples

""" Minimal example for testing atomstmltr"""

import numpy as np
import matplotlib.pyplot as plt

from atomsmltr.environment import PlaneWaveLaserBeam
from atomsmltr.atoms import Ytterbium
from atomsmltr.simulation import Configuration, ScipyIVP_3D

# - setup atom
atom = Ytterbium()
main = atom.trans["main"] # get transition, to help setting up lasers

# - setup laser
laser_1 = PlaneWaveLaserBeam()
laser_1.direction = (0, 0, 1)
laser_1.set_power_from_I(main.Isat) # set power to reach Isat
laser_1.tag = "las1"

laser_2 = laser_1.copy() # create a copy
laser_2.direction = (0, 0, -1)  # propagating in opposite direction
laser_2.tag = "las2"

# - config
config = Configuration()
config.atom = atom
config += laser_1, laser_2
config.add_atomlight_coupling("las1", "main", -0.5 * main.Gamma)
config.add_atomlight_coupling("las2", "main", -0.5 * main.Gamma)

# - simulation
sim = ScipyIVP_3D(config=config)
t = np.linspace(0, 0.1, 1000)  # timesteps for integration
u0 = (0, 0, 0, 0, 0, 100)  # atom starts with vz=100m/s
res = sim.integrate(u0, t)

# plot
fix, axes = plt.subplots(1, 2, figsize=(8, 3), tight_layout=True)
axes[0].plot(res.t * 1e3, res.y[2])
axes[0].set_ylabel("z (m)")
axes[1].plot(res.t * 1e3, res.y[5])
axes[1].set_ylabel("vz (m/s)")
for ax in axes:
    ax.set_xlabel("t (ms)")
    ax.grid()
plt.show()

🐍 How to contribute

atomsmltr is still under active development, and we would be more than happy to welcome contributions!

We encourage anyone willing to contribute to first have a look at the global architecture underlying atomsmtlr. Note that it is coded in a modular way.

The easiest way to contribute would then be to expand the collection of Environment objects (magnetic field profiles, laser beam types, etc.) or to add new types of integrators in simulation.simulator.

Contributions to the core structure of atomsmltr would also be welcome, but should be discussed with the main development team to ensure a good coordination of efforts.

In all cases, please make sure that you comply with our coding standards:

  • comment your code: always include docstrings, add comments to tricky code parts, etc.
  • add unit tests: whenever adding a new feature, please make sure that you write a corresponding unit test in the tests folder.
  • use black for code formatting.
  • use poetry for dependency management.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atomsmltr-0.1.4.tar.gz (75.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atomsmltr-0.1.4-py3-none-any.whl (97.7 kB view details)

Uploaded Python 3

File details

Details for the file atomsmltr-0.1.4.tar.gz.

File metadata

  • Download URL: atomsmltr-0.1.4.tar.gz
  • Upload date:
  • Size: 75.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.14.0-33-generic

File hashes

Hashes for atomsmltr-0.1.4.tar.gz
Algorithm Hash digest
SHA256 559163a40fdde949940863f711d65d3a531a747921be8a5f6ccc5f27567cb9bb
MD5 7535e04790c0dd9976d06bb508711cd5
BLAKE2b-256 59265badbc68d8cb36e84cce49f72360f0ec7546971c9a7cde4a2a3f643cfa12

See more details on using hashes here.

File details

Details for the file atomsmltr-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: atomsmltr-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 97.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.14.0-33-generic

File hashes

Hashes for atomsmltr-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 96617d5dd9952fa57ca862080ef004f9131dbec69a87071e073653baa4dae815
MD5 134972c29d8e8bb13929a2f67cb0c436
BLAKE2b-256 c5d96757e1dfbc9545d21aea1c184b93d0e188560933d553f3bdbd643fc27c07

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page