Generation of potentials and waveforms for trapped ions
Project description
pytrans: potentials and waveforms for trapped ions
Pytrans is a python package for creating static and dynamic potentials for ion traps. Starting from a description of the trap geometry and its electrical properties, it allows finding optimal sets of voltages (often called waveforms if time-dependent) producing the target trapping potential. It allows to evaluate the equilibrium configuration of an ensamble of ions trapped in the resulting potential and to simulate their classical dynamics.
While the solution depends on the specifics of the trap for which it has been generated, pytrans is trap-agnostic: it can model different types of ion traps, wrapping specific data into generic structures that implement waveform generation and analysis in a unified way.
It uses cvxpy as optimization backend, and numpy, scipy and matplotlib for analysis, simulation, and visualization. Pytrans is open source and tested for Python >= 3.10 on all Unix and Windows platforms.
Installation
pip
Pytrans is available on PyPI. You can install it via pip
by
pip install pytrans
Additionally, to use other solvers suported by cvxpy, it is necessary to install additional packages. Follow the installation instructions on https://www.cvxpy.org/install/.
poetry
When using pytrans as part of a project, including e.g. one or more trap models and other specific tools, we recommend using a project manager tool like poetry
. The pytrans-examples repo is a reference implementation of a poetry project dedicated to generating waveforms for specific ion traps.
Install from source
Clone a fresh copy of the source repository, perhaps within a virtual environment, and install it in editable mode including both the required and the optional dependencies for code linting and documentation.
git clone https://github.com/tiqi-group/pytrans
cd pytrans
pip install -e .[dev,docs]
Pytrans requires python >= 3.10.
Documentation
The latest documentation can be found on https://pytrans.readthedocs.io.
In pytrans-examples we provide numerous examples of waveform generation and potential analysis in two different types of ion traps.
Usage
A typical usage of pytrans involves:
- implementing a model for a specific ion trap
- defining a target potential and setting up an optimization problem to reproduce it in the trap
- analyzing and visualizing the results
Trapping Ca40 in a Paul trap
Here we find a set of voltages suitable for traping one Ca40 ion in a 3D, segmented, microfabricated Paul trap, in a potential well with an axial oscillation frequency of 1 MHz. Extract from the example notebook 01_static_potential.ipynb.
trap = SegmentedTrap()
n_samples = 1
waveform = init_waveform(n_samples, trap.n_electrodes)
r0 = (0, 0, trap.z0)
axial_curv = freq_to_curv(1e6, ion=Ca40)
objectives = [
obj.GradientObjective(waveform[0], trap, *r0, value=0, ion=Ca40),
obj.HessianObjective(waveform[0], trap, *r0, entries='xx', value=axial_curv, ion=Ca40),
obj.VoltageObjective(waveform, 10, constraint_type='<='),
obj.VoltageObjective(waveform, -10, constraint_type='>='),
]
res = solver(objectives, verbose=True)
waveform = res.waveform.value # optimal value, np array
Contributing
All contributions are welcome! Use the issues to report bugs or feature requests, or add your own code by forking the project and opening a pull request.
License
Pytrans is open source and released under the GNU Affero General Public License version 3 (AGPLv3).
Authors and history
The project has been developed in the Trapped Ion Quantum Information (TIQI) group at ETH Zurich. Started as a collection of python scripts for generating shuttling waveforms in a specific ion trap, it received contributions from numerous members of the group, ranging from students to PhDs and postdocs. It is currently used to model all the ion traps used in TIQI projects.
Contributors, in a non-strictly-cronological order:
- Vlad Negnevitsky
- Matteo Marinelli
- Francesco Lancellotti
- Robin Ostwald
- Sebastian Heinekamp
- Tobias Sagesser
- Carmelo Mordini
- Yuto Motohashi
- Michalis Theodorou
References
Articles or theses describing the projects through which this project has been developed, and further references.
- V. Negnevitsky, Feedback-stabilised quantum states in a mixed-species ion system, PhD thesis
- D. Leibfried et al., Quantum dynamics of single trapped ions, https://doi.org/10.1103/RevModPhys.75.281
- J. P. Home, Quantum science and metrology with mixed-species ion chains, https://arxiv.org/abs/1306.5950
The logic of the modular cost function was inspired by the electrode package by Robert Jordens.
About documentation:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytrans-2.1.0.tar.gz
.
File metadata
- Download URL: pytrans-2.1.0.tar.gz
- Upload date:
- Size: 69.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0f06c33b8576d62c2c578d810adecfab6a28d945729ff1b615ee41dcd0b3122 |
|
MD5 | 618ff59e5e98e27a7ec48f847e221db4 |
|
BLAKE2b-256 | f5bda984bbb52060eec0852ba9d58b01709a7beb4b2ba5d62ed75a2bb637bf50 |
File details
Details for the file pytrans-2.1.0-py3-none-any.whl
.
File metadata
- Download URL: pytrans-2.1.0-py3-none-any.whl
- Upload date:
- Size: 63.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a166ba2c53952eaa7cfed4fd4d9212b34c113d096fa70d12927bd183ee01c35e |
|
MD5 | 28944be7fb2618500df5d5dc41105b16 |
|
BLAKE2b-256 | 26a90eda775a31d1e9be0e5266589c71f6bb70a6ee6914282ddb3fa7963d4a72 |