Skip to main content

Phenomenological spectral-gap dephasing parameterization for PennyLane (delegates to qml.PhaseDamping)

Project description

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 of gamma against λ₁, returning γ · λ₁ / (λ₁ + α).
  • ToroidalDephasing(gamma, grid_n, alpha, wires) — a named channel whose Kraus operators are delegated to qml.PhaseDamping.compute_kraus_matrices with effective_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 × n lattice 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-noise for non-PennyLane use cases.

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pennylane_toroidal_noise-0.2.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pennylane_toroidal_noise-0.2.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file pennylane_toroidal_noise-0.2.0.tar.gz.

File metadata

  • Download URL: pennylane_toroidal_noise-0.2.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for pennylane_toroidal_noise-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1867574f01611db6a93ad2ac8127eb2662150e612e0804928d2162efcd887847
MD5 5bbd80dd269c1cf1c765a982d463a701
BLAKE2b-256 cfb2c4c7ca40e8ed26c8cfaa3193194ccc527d853c157f04006294c9d5345966

See more details on using hashes here.

File details

Details for the file pennylane_toroidal_noise-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pennylane_toroidal_noise-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56aede584669e745ef446fe886767270b8fe57acc0dba5de04b9838c2d08d054
MD5 6601d02faf2e91c9c4b87d407469628e
BLAKE2b-256 e9975a74765b8db23dce1291bc0cd7982d87a90220322456a202e174fb854cc5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page