Skip to main content

levisim

levisim simulates optically levitated nanoparticles.

  • Several particles, one cavity. MultiTrap solves the linearised quantum Langevin equations of N levitated particles, each moving in up to three dimensions, coupled by coherent scattering to one shared cavity mode. It returns the homodyne and heterodyne spectra of the cavity output and the power and cross spectral densities of every motion. Seven independent calculation routes are provided (linear-amplifier models, numerical and power-series hybridisation, and an exact closed form that inverts no N×N matrix), which agree with each other to within 5e-13 (relative) on every system in the test suite and notebooks.
  • One particle, free space. Simulation integrates the stochastic (Langevin) dynamics of a bead in a Gaussian-beam tweezer with gas damping, feedback cold damping, a directed force, kicks and an optional detection floor, photon recoil and gravity; SpectralDensityEstimate and SpectralDensityTheory analyse the traces.
  • Entanglement. Covariance-matrix dynamics, an exact multi-tone (Floquet) drive and Gaussian-state measures (log-negativity, discord, Duan and Hillery–Zubairy witnesses) for two-tone schemes.
pip install levisim              # or: pip install --upgrade levisim
import numpy as np
from levisim.core.units import kHz, degrees
from levisim.multiphysics.enums import QuantumLinearTheoryMethod
from levisim.multiphysics.multitrap import MultiTrap
from levisim.multiphysics.utils.shelf import DEFAULT_cavity_kwargs, DEFAULT_gas_kwargs

mtrap = MultiTrap(
    num_traps=2,
    Cartesian_axes_per_trap=2,
    gas_kwargs=DEFAULT_gas_kwargs,
    cavity_kwargs=DEFAULT_cavity_kwargs,
    φn_dict={2: 30*degrees},                 # second tweezer's phase
    ω_range=np.arange(125, 165, 0.02) * kHz,  # angular units: kHz is 2π × 10³ rad/s
)
S_hh = mtrap.homodyne_spectrum(QuantumLinearTheoryMethod.LINEAR_AMPLIFIER_MODEL)

Documentation: https://julianiacoponi.github.io/levisim/ — user guide, the calculation methods (with a flowchart), conventions, logging, an API reference, and a gallery of demo notebooks and reproductions of published experiments.

Optional extras: levisim[elk] (logs to Elasticsearch/Kibana via the levisim-logs command), levisim[notebooks], levisim[docs], levisim[dev], levisim[video], levisim[notify].

levisim is licensed under the GNU GPL v3 or later. Parts of it were written with an LLM at the author's request; DISCLAIMER.md in the source distribution records which.

Metadata

Release files for levisim 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for levisim 0.1.1
File Size Uploaded Provenance Actions
levisim-0.1.1.tar.gz 413.7 kB With provenance Details for levisim-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for levisim 0.1.1
File Interpreter ABI Platform Actions
levisim-0.1.1-py3-none-any.whl Python 3 none any Details for levisim-0.1.1-py3-none-any.whl

Total release size: 759.2 kB

Release files / levisim-0.1.1.tar.gz

Download URL levisim-0.1.1.tar.gz
Size 413.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1da53ca28fd37a239b1b63e0d50b10001cb3c1b0578268949b6b84b2d2690997
BLAKE2b-256 checksum
How to use checksums
882595261019e1690e617d819ae666e78e5a22d020e815d6eafae0ea25b8d8ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / levisim-0.1.1-py3-none-any.whl

Download URL levisim-0.1.1-py3-none-any.whl
Size 345.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d854948f3a2850cec39f8897492bb5c8369e83bb24c92aa217e1fce28439dc2
BLAKE2b-256 checksum
How to use checksums
2e4bdf90a2bafddfa59cd35e1061c73054565d74b4379595685f216a225769ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for levisim 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for levisim-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page