Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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. FreeSpaceSimulation 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
pip install "levisim[fast]"      # optional: numba, compiled stochastic-simulation loops
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 1.0.0rc1

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 1.0.0rc1
File Size Uploaded Provenance Actions
levisim-1.0.0rc1.tar.gz 766.5 kB With provenance Details for levisim-1.0.0rc1.tar.gz

Built distribution (wheel)

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

Total release size: 1.4 MB

Release files / levisim-1.0.0rc1.tar.gz

Download URL levisim-1.0.0rc1.tar.gz
Size 766.5 kB
Tags Source
SHA-256 checksum
How to use checksums
05016662483d00ad68f02e3361f384aa43f0a57f16829b276f0a7f13e4b79a0a
BLAKE2b-256 checksum
How to use checksums
3af7081f446453bb144f3686e6e86d9e33903d9840c42e396320865a4794d53c
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 27, 2026.

Transparency log

Release files / levisim-1.0.0rc1-py3-none-any.whl

Download URL levisim-1.0.0rc1-py3-none-any.whl
Size 602.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72365ef7f7e70412f7e56c14d4f8c8d6c3c6e631bb056c79394d5d3ff2cd8873
BLAKE2b-256 checksum
How to use checksums
b2c04f446ba0cb37d9086fac8367c3bd269facfac6db0b98ca160b5e3ab5d943
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 27, 2026.

Transparency log

Security for levisim 1.0.0rc1

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-1.0.0rc1.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 27, 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