pennylane-toroidal-noise
A phenomenological dephasing parameterization for PennyLane,
where the effective dephasing rate is modulated by the spectral gap of an
n × n discrete-torus Laplacian.
This package is a thin wrapper over qml.PhaseDamping. It exposes:
spectral_gap(n)— the smallest non-zero eigenvalue of the cycle-graph Laplacian,λ₁(n) = 2 − 2cos(2π/n).effective_gamma(gamma, grid_n, alpha)— a one-parameter saturation ofgammaagainstλ₁, returningγ · λ₁ / (λ₁ + α).ToroidalDephasing(gamma, grid_n, alpha, wires)— a named channel whose Kraus operators are delegated toqml.PhaseDamping.compute_kraus_matriceswitheffective_gamma(...)as the rate.
Status
Phenomenological model, not a derivation from physical first principles.
The spectral-gap-to-dephasing mapping γ_eff = γ · λ₁ / (λ₁ + α) is offered
as a tunable parameterization for studying lattice-geometry-dependent
dephasing in PennyLane simulations. alpha is a knob, not a physically
calibrated coupling. Treat results as exploratory unless you have an
independent physical justification for this mapping in your specific setting.
Installation
pip install pennylane-toroidal-noise
Or from source:
git clone https://github.com/Paraxiom/pennylane-toroidal-noise
cd pennylane-toroidal-noise
pip install -e .[dev]
pytest
Usage
Recommended pattern — explicit composition
The cleanest way to use this library is to compose the spectral-gap
calculation with qml.PhaseDamping at the call site:
import pennylane as qml
from pennylane_toroidal_noise import effective_gamma
dev = qml.device("default.mixed", wires=1)
@qml.qnode(dev)
def circuit(gamma):
qml.Hadamard(wires=0)
qml.PhaseDamping(effective_gamma(gamma, grid_n=12, alpha=1.0), wires=0)
return qml.expval(qml.PauliX(0))
This makes the parameterization visible to anyone reading the circuit and
keeps the noise model standard (a PhaseDamping channel).
Alternative — named operator
If you prefer a named operator for circuit-diagram readability or for
reusing grid_n/alpha across many call sites, use ToroidalDephasing:
import pennylane as qml
from pennylane_toroidal_noise import ToroidalDephasing
dev = qml.device("default.mixed", wires=1)
@qml.qnode(dev)
def circuit(gamma):
qml.Hadamard(wires=0)
ToroidalDephasing(gamma, grid_n=12, alpha=1.0, wires=0)
return qml.expval(qml.PauliX(0))
ToroidalDephasing.compute_kraus_matrices delegates to
qml.PhaseDamping.compute_kraus_matrices; decomposition() returns a
single qml.PhaseDamping(effective_gamma(...)).
Math
The discrete n × n torus is the graph product C_n □ C_n of two cycle
graphs. The eigenvalues of its Laplacian are sums of cycle-graph
eigenvalues:
λ_{j,k}(n) = (2 − 2cos(2πj/n)) + (2 − 2cos(2πk/n)), 0 ≤ j, k < n
The smallest non-zero eigenvalue is attained at (1, 0) or (0, 1):
λ_1(n) = 2 − 2cos(2π/n)
This is also the spectral gap of the cycle graph C_n. The library uses
this as the geometry parameter in the saturation:
γ_eff(γ, n, α) = γ · λ_1(n) / (λ_1(n) + α)
grid_n |
λ_1(n) |
γ_eff/γ (α=1) |
|---|---|---|
| 4 | 2.000 | 0.667 |
| 6 | 1.000 | 0.500 |
| 8 | 0.586 | 0.369 |
| 12 | 0.268 | 0.211 |
| 32 | 0.0383 | 0.0369 |
| 64 | 0.00964 | 0.00955 |
Limitations and caveats
- Phenomenological direction. The mapping
γ_eff = γ · λ₁ / (λ₁ + α)reduces dephasing asλ₁ → 0. This direction does not correspond to any particular standard physical mechanism — typical "spectral-gap protection" arguments in many-body physics suppress noise as the gap increases, not as it shrinks. Users should not interpret results from this parameterization as a physical prediction without independent justification. - No T₂ / hardware claim. This package does not derive or claim a hardware T₂-extension figure. Earlier framings that quoted specific microsecond-to-millisecond figures have been removed; if you need those numbers, they must come from a calibrated device model, not from this parameterization.
- Single-qubit channel only. The spectral-gap calculation references
an
n × nlattice geometry, but the channel itself acts on a single wire. There is no multi-qubit lattice noise correlation in this implementation.
Related
- A pure-Rust companion crate is published as
toroidal-noisefor non-PennyLane use cases.
License
MIT.
Metadata
Release files for pennylane-toroidal-noise 0.2.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 |
|---|---|---|---|---|
| pennylane_toroidal_noise-0.2.0.tar.gz | 8.8 kB | Without provenance | Details for pennylane_toroidal_noise-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pennylane_toroidal_noise-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for pennylane_toroidal_noise-0.2.0-py3-none-any.whl |
Total release size: 16.0 kB
Release files / pennylane_toroidal_noise-0.2.0.tar.gz
| Download URL | pennylane_toroidal_noise-0.2.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1867574f01611db6a93ad2ac8127eb2662150e612e0804928d2162efcd887847
|
|
BLAKE2b-256 checksum How to use checksums |
cfb2c4c7ca40e8ed26c8cfaa3193194ccc527d853c157f04006294c9d5345966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Release files / pennylane_toroidal_noise-0.2.0-py3-none-any.whl
| Download URL | pennylane_toroidal_noise-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56aede584669e745ef446fe886767270b8fe57acc0dba5de04b9838c2d08d054
|
|
BLAKE2b-256 checksum How to use checksums |
e9975a74765b8db23dce1291bc0cd7982d87a90220322456a202e174fb854cc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Security for pennylane-toroidal-noise 0.2.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.