Extend with dipole traps, level dynamics, GPU backend, diagnostics and recapture - #2
Open
alexlegoshin wants to merge 9 commits into
Open
Extend with dipole traps, level dynamics, GPU backend, diagnostics and recapture#2alexlegoshin wants to merge 9 commits into
alexlegoshin wants to merge 9 commits into
Conversation
- __init__.py: use PyYAML (import yaml) instead of removed ruamel_yaml
- setup.py: switch distutils->setuptools (distutils gone in 3.12),
fix find_packages(), add full install_requires and package_data
- parameters.yml: populate default Rb-87 D2 atom block (file was fully
commented, which made load_parameters() return None and crash
maxwell_boltzmann at import); use PyYAML-safe float literals (6.0666e+6)
- plotting.py: colorbar title -> {'title':{'text':..,'side':..}} for plotly 6.x
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- dipole.py: DipoleTrap / OpticalLattice, AC-Stark potential (Grimm review form, red-detuned U<0), Gaussian beam + retro-reflected lattice, force and acceleration compatible with integration.solve, depth and trap frequencies - levels.py: LevelDynamics, 3-level (F=2/e/F=1) rate equations + repumper; two-level limit reproduces the textbook saturated scattering rate - diagnostics.py: cloud temperature (total/per-axis), rms size, distributions, matplotlib plots, temperature series over a trajectory - recapture.py: classical MOT->dipole recapture (E<0 capture criterion + trajectory integration), thermal_cloud helper, trapped/retained fractions - expose all of the above via __init__.py Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GPU acceleration: - backend.py: array-agnostic CPU/GPU selection (NumPy or CuPy) with auto detection, runtime use_gpu()/use_cpu() override and MOTORNOT_BACKEND env var - make numeric kernels dispatch on their input arrays via get_array_module: beams (Uniform/Gaussian), LinearQuadrupole field, MOT force/scattering rate, dipole potential/force, diagnostics, recapture energy criterion - integration.integrate(): backend-aware fixed-step RK4 that keeps the whole ensemble on-device (scipy solve_ivp stays CPU-only). Also improves energy conservation vs the default-tolerance adaptive path - CPU and GPU results verified identical to floating-point precision High-level API (api.py): - built-in atoms (Rb87/Rb85/Na23/K39/Cs133), six_beam_mot(), dipole_trap(), thermal_cloud(), set_backend() and an Experiment orchestrator (load_cloud -> cool -> recapture -> diagnostics) Docs/packaging: - rewrite README with quick start, GPU notes and physics caveats - setup.py: optional [gpu] extra (cupy-cuda12x[ctk]) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a detailed "The physics" section: MOT scattering force (Doppler + Zeeman + polarisation), magnetic field, AC-Stark dipole potential, level rate equations, recapture energy criterion and the integrators. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mark tutorial notebooks as linguist-documentation so GitHub reports this repo's language as Python instead of Jupyter Notebook (the notebooks are mostly embedded output/plot images by byte count, which otherwise dominates linguist's stats). Also removes a stray Python 3.7 __pycache__ file that got committed before .gitignore covered it.
Marks the first release since the fork's rewrite: CPU/GPU (CuPy) backend, dipole traps, multi-level rate-equation dynamics, ensemble diagnostics, MOT-to-dipole recapture and a high-level API, on top of the original scattering-force MOT model.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fork extends the original scattering-force MOT model with several additional components, built on top of it:
The branch is 9 commits ahead of
masterand merges cleanly (0 behind). Full details are in the README and release notes.Note
This is a substantial change in scope, not a small patch, so I understand if reviewing or merging it isn't practical. I'm opening this PR mainly to make the extension available here and to credit the original work it builds on — not with any expectation attached. Thank you for the original library.