sqzcomb
sqzcomb is a free Python package for the quantum noise of light in
Kerr microcombs: small ring resonators that turn one pump laser into a
comb of evenly spaced lines. It started with one question: how much
squeezed light (noise below the quantum floor) does such a ring deliver
to a detector? It follows the light from the field circulating in the
ring, through the quantum noise around it, to the number a detector on
the output fiber would report. Squeezing inside the ring is not what an
experiment sees; only what leaves through the port is.
Since version 0.20 it also computes how much the glass itself adds to that noise: the Raman noise of the glass, which sets how steadily a soliton comb ticks, and how much it takes from squeezed light.
Every model is checked against an exact answer, a published number or an independent calculation, in tests you can run yourself. When an input cannot give a result you can trust, the package stops and says why instead of printing a number that only looks right.
What it can do
Squeezed light, from the ring to the detector
- The field in the ring (flat states, solitons, soliton crystals) from the Lugiato-Lefever equation, and the quantum noise around it.
- The squeezing a detector would see, at each analysis frequency, with the best local-oscillator angle found exactly, also the best single angle for a whole band.
- What loss, detector electronics and phase jitter take away, and the budget a target needs.
- Two coupled rings, rings with different line spacings, entangled pairs of lines, pulsed pumps, above-threshold and non-Gaussian states, and classical noise of the ring and the pump.
From the lab bench
- Linewidth, escape efficiency and coupling from a transmission scan (also split resonances, and the phase of the transmission).
- The Kerr shift per photon from the threshold power, raw spectrum-analyzer traces turned into dB relative to shot noise with error bars, fits of measured spectra, and what a measured pair of squeezed and antisqueezed levels says about the source.
- Planning: will the planned measurement pin down the numbers, and how hard to pump for a target squeezing.
The Raman noise of glass, and soliton timing (new in 0.20)
- The Raman response of silica (three published models), its noise from the fluctuation-dissipation theorem, and the simple law that turns a measured self-frequency shift into the size of that noise.
- The timing noise of a soliton microcomb, with the vacuum and the Raman parts, from the exact linear theory, with the full Raman drag: ratios, spectra in s^2/Hz, phase noise of a microwave carrier, temperature, and avoided mode crossings.
- The Raman noise added to any squeezing spectrum.
Install
pip install sqzcomb # needs NumPy and SciPy
pip install sqzcomb[interop] # adds QuTiP, for drift_from_qutip only
It needs Python 3.9 or newer, NumPy 1.22 or newer and SciPy 1.10 or
newer. For development: clone the repository and
pip install -e .[test].
A first look
The physics runs in the usual normalized units of the Lugiato-Lefever equation (rates in units of half the linewidth); a noise variance of 0.5 is the vacuum level. The reference page lists every convention.
Squeezing from a pumped ring, at four output couplings
import numpy as np
from sqzcomb import (lle_evolve, homogeneous_steady_states,
fluctuation_matrix, output_quadrature_variance,
squeezing_db)
F, alpha = 0.9, 0.3 # illustrative, below threshold
psi = lle_evolve(np.full(16, 0.05 + 0j), F=F, alpha=alpha, t_end=100.0)
print(f"|psi|^2 from the solver: {abs(psi[0]) ** 2:.6f}")
print(f"root of the cubic: {homogeneous_steady_states(F, alpha)[0]:.6f}")
M, modes = fluctuation_matrix(psi, alpha) # quantum noise around it
i0 = int(np.where(modes == 0)[0][0]) # the pumped line
phis = np.linspace(0.0, np.pi, 181)
for eta in (0.2, 0.5, 0.8, 1.0):
best = min(squeezing_db(output_quadrature_variance(
M, eta, 0.0, i0, modes.size, phi=p)) for p in phis)
print(f"eta = {eta}: best squeezing {best:6.3f} dB")
|psi|^2 from the solver: 0.698836
root of the cubic: 0.698836
eta = 0.2: best squeezing -0.730 dB
eta = 0.5: best squeezing -2.126 dB
eta = 0.8: best squeezing -4.194 dB
eta = 1.0: best squeezing -6.460 dB
eta is the fraction of the ring's loss that goes into the output
fiber. The more of the light that leaves through the port, the more
squeezing a detector can see.
How steadily a soliton comb ticks, and what the glass adds
import sqzcomb as sq
comb = sq.SolitonComb(fsr_hz=21.9e9, linewidth_hz=2.1e6,
detuning_hz=9.5 * 2.1e6, soliton_width_s=131e-15,
reference="device A of Table 1, Mahim et al. (2026)")
glass = sq.scaled_to_shock_time(sq.silica_response("hc"), 2.49e-15,
comb.width) # measured shock time
for t in sq.soliton_timing_noise(comb, temperature=[300.0, 77.0, 0.0],
response=glass):
print(f"{t.temperature:5.0f} K: Raman/vacuum {t.raman_to_vacuum:.2f}, "
f"total/vacuum-only {t.total_over_vacuum_only:.2f}")
print(f"self-frequency shift {t.frequency_shift_hz / 1e9:.1f} GHz, "
f"repetition rate {t.repetition_rate_shift_hz / 1e3:+.1f} kHz")
print(f"grid check {t.grid_change:.0e}, slowest decay "
f"{t.largest_growth_rate:.2f} (stable)")
300 K: Raman/vacuum 5.20, total/vacuum-only 5.18
77 K: Raman/vacuum 1.49, total/vacuum-only 2.08
0 K: Raman/vacuum 0.76, total/vacuum-only 1.47
self-frequency shift -226.7 GHz, repetition rate -132.5 kHz
grid check 2e-16, slowest decay -0.82 (stable)
A soliton's arrival time wanders because random kicks change its speed. The usual "fundamental" floor counts only the vacuum noise that enters through the ring's losses. The glass adds its own kicks: the vibrations that drag the soliton's spectrum to the red (here by 227 GHz) also flicker, and at room temperature they add about four times the vacuum noise for this silica ring. Cooling removes most of it.
Learn more
The details live in the docs folder:
- Examples: 34 worked examples, each with the output it prints, and three tutorials that go from synthetic measured data to results with error bars.
- Reference: a short guide to the words used, units and conventions, every function by topic, the cases where the package refuses to answer, and where the methods come from.
- How it is checked: what each test compares against and how closely, and the corrections made in past versions.
- Limits: what the models leave out, in detail.
- Changes from version to version.
How it is checked
376 automated tests run on every change, on Python 3.9 to 3.14 and with the oldest NumPy, SciPy and QuTiP the package allows. They compare against a closed-form result, an exact identity, a published number or the same quantity worked out a second, different way; none compares against a number stored from an earlier run. Two examples: a passive ring returns exactly the vacuum level at any coupling and frequency, and the timing noise reproduces the published tables of the Raman paper and agrees with a Monte-Carlo simulation of the full nonlinear equation. The full list is in How it is checked.
What it does not do
The main gaps, in plain terms:
- The quantum noise is the usual linearized (Gaussian) picture around a steady state. Above threshold and for few photons there are exact tools, but only for a few modes.
- The noise of the ring's material other than the Raman noise of glass (thermorefractive noise, the pump laser's noise) is not computed from physics: you supply its spectrum, with its source, and the package carries it to the detector.
- Only silica's Raman response ships. The models are anchored at terahertz frequencies; below about 0.5 THz they are extrapolations, and Brillouin scattering and guided acoustic waves are not included.
- The timing model is one soliton with dispersion up to D2, without dispersive waves other than single shifted resonances, without the coupling of counter-propagating solitons and without the measurement chain.
- No material numbers for the ring itself: its Kerr index, loss and dispersion come from you, with their source.
- There is no paid support. Questions and bug reports go to the issue tracker.
The full list is in Limits.
Citing
If sqzcomb helps your work, please cite it with the concept DOI 10.5281/zenodo.22015375, which always points to the latest version (CITATION.cff has the details). The squeezing methods were developed for
T. M. Mahim, M. M. Rahman and A. S. M. Mohsin, "Overcoming the 3 dB squeezing extraction limit in silicon carbide microcombs with a photonic molecule," Optics Express 34(18), 34822-34834 (2026), https://doi.org/10.1364/OE.612248
and the Raman noise and timing tools follow
T. M. Mahim, M. M. Rahman and A. S. M. Mohsin, "The Raman self-frequency shift predicts thermal timing noise in soliton microcombs" (manuscript, 2026).
The other sources each part builds on are listed in the Reference.
Who makes it
Written and maintained by Tanvir Mahmud Mahim (Department of Electrical and Electronic Engineering, BRAC University), who reviews every change. Contributions are welcome: see CONTRIBUTING.md. A change to the physics comes with a test, and a new number comes with its source. While the version is below 1.0 the API may still change between minor versions; such changes are named in the release notes.
Licensed under Apache-2.0.
Metadata
Release files for sqzcomb 0.20.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sqzcomb-0.20.0.tar.gz | 271.5 kB | With provenance | Details for sqzcomb-0.20.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sqzcomb-0.20.0-py3-none-any.whl | Python 3 | none | any | Details for sqzcomb-0.20.0-py3-none-any.whl |
Total release size: 414.0 kB
Release files / sqzcomb-0.20.0.tar.gz
| Download URL | sqzcomb-0.20.0.tar.gz |
|---|---|
| Size | 271.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f699049f4fb3a1e3ac9c36d57b53e9e0fa275fe3c13b0d36cd9117c22a10758
|
|
BLAKE2b-256 checksum How to use checksums |
92a931856c4ecca3cc4fadefe0ac8892a0985a9a0013b8828ef756620442deed
|
| 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 29, 2026.
Transparency logRelease files / sqzcomb-0.20.0-py3-none-any.whl
| Download URL | sqzcomb-0.20.0-py3-none-any.whl |
|---|---|
| Size | 142.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd9b7da9b14ca9cd1f1ef6e4aaecf8cd5defd06f6926eb34049c15272c1c3b6a
|
|
BLAKE2b-256 checksum How to use checksums |
ed4c910a715e63ad691276ff297ca30365d5f9dec635316ee5a26850435a3e16
|
| 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 29, 2026.
Transparency logSecurity for sqzcomb 0.20.0
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.
Attestation for sqzcomb-0.20.0.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 29, 2026.
Transparency logA 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.