PyOpticL - Code-to-CAD optical system engineering
Discord Server: https://discord.gg/vV4NP6rXmp
ReadMe
Wiki
Modular baseplate examples:
- Laser - Extended Cavity Diode Laser (with optical isolator)
- Doublepass AOM Baseplate
- Singlepass AOM Baseplate
- Saturation Absorption Spectroscopy Baseplate
- Periscope
- CoverBox
Modular Subsystems based on baseplates:
AMO Apparatus based on modular subsystems:
3D Models and Technical Drawings
About PyOpticL (Python Optics Layout)
PyOpticL is a Python library for optics layout which uses beam-path simulation and dynamic beam-path routing for quick and easy optical layout by placing optical elements along the beam path without a priori specification, enabling dynamic layouts with automatic routing and connectivity. The beam paths are automatically calculated as components are placed in the layout. Component placement can be defined "along beam" to remove the need for hard-coded coordinates. Beam calculations include reflection, transmission, refraction, and diffraction (limited). This library enables a new paradigm of optical engineering using modular sub-systems of modular baseplates with commerical optical elements (see abstraction layers below).
Demonstration with Trapped Ion Qubits:
See our recent preprint for more details about our results using these laser sources and baseplates in our lab:
arXiv:2501.14957 - Qubit operations using a modular optical system engineered with PyOpticL: a code-to-CAD optical layout tool
Getting Setup
-
Install FreeCAD, Python, and Git
-
Add PyOpticL as a custom addon repository in FreeCAD
Under Edit>Preferences>Addon Manager>Custom Repositories, click the plus icon and enter the following information:
Repository URL: https://github.com/UMassIonTrappers/PyOpticL.git
Branch: main
Press OK to save settings -
Install the PyOpticL library In the Addon Manager (Tools>Addon Manager), search for "PyOpticL" and click install.
Note: if you get an error related to git, try disabling it - Edit>Preferences>Addon Manager>Disable git -
Check everything is setup correctly
You should now be able to re-launch FreeCAD and see the "PyOpticL" workbench in the workbench dropdown -
Check out the wiki for guides on how to get started and examples
-
Read the docs library documentation
Pre-made Layouts
Macro files for pre-made layouts can be found in the PyOpticL directory. This can be found in:
<FreeCAD User Data Directory>/Mod/PyOpticL/Design
On windows this is:
%APPDATA%\FreeCAD\Mod\PyOpticL\Design
Example - Laser cooling and detection:
from PyOpticL import layout, optomech from ECDL import ECDL from Rb_SAS_V2 import Rb_SAS from modular_doublepass import doublepass from modular_singlepass import singlepass def laser_cooling_subsystem(): layout.table_grid(dx=36, dy=22) ECDL(x=27, y=20, angle=180) Rb_SAS(x=20, y=1, angle=90) singlepass(x=14, y=12, angle=90) doublepass(x=1, y=21, angle=270)
Dynamic layouts:
Rb_SAS(0, 16, optic_type=one_inch_mounted) Rb_SAS(0, 8, optic_type=half_inch_mounted) Rb_SAS(0, 3, optic_type=half_inch_unmounted) Rb_SAS(0, 0, optic_type=mini_optics)
Same code compiled with different optical elements at different scales:

Design abstraction layers applied to a strontium trapped ion quantum computer:
from PyOpticL import layout, optomech from SPAM_subsystem import subsystem_spam from Laser_cooling_subsystem import laser_cooling_subsystem from Raman_subsystem import Raman_subsystem from Photoionization_subsystem import PI_subsystem_ECDL, PI_subsystem_commercial layout.table_grid(dx=52, dy=92) laser_cooling_subsystem(x=-1, y=0, thumbscrews=True) Raman_subsystem(x=1 , y=26.5, thumbscrews=True) PI_subsystem_commercial(x=29 , y=8, angle = 0, thumbscrews=True) #405 for sr88+ PI_subsystem_ECDL(x=38 , y=8, thumbscrews=True) # 461 for sr88+ subsystem_spam(x=32 , y=50, thumbscrews=True)
PyOpticL Community Members:
- MIT QUANTA LAB (Prof. Isaac Chuang created the initial C4PO library which inspired this project)
- MIT Quantum Photonics & AI Group (Prof. Dirk Englund)
- UCONN - Prof. Simone Colombo
- Montana St. - Prof. Matt Jaffe
- UC Berkeley - Prof. Aziza Suleymanzade
- UW Madison - Prof. Josiah Sinclair
- NUS - Prof. Dzmitry Matsukevich
- Stanford - Prof. Jonathan Simon
- Quera
- Durham University
