Skip to main content

Simulation of noisy qudit Clifford circuits via extended stabilizer tableau formalism.

Project description

quickqudits

QuickQudits is a Python framework for efficient classical simulation of noisy qudit Clifford circuits using stabilizer tableau formalism, with Monte Carlo sampling of Pauli/Weyl noise.

All dimensions are supported, with prime dimensions favoured.

Core Functionality:

  • Extended stabilizer tableaus for qudits of arbitrary dimension d, storing X/Z exponents and a phase column, with Clifford updates over Z_d.
  • Measurement / post-measurement updates via a generalized Aaronson–Gottesman (CHP-style) procedure for prime dimensions.
  • Measurement for composite dimensions via SNF.
  • Noise modeling as probabilistic mixtures of Weyl operators.
  • Statevector / density-matrix backends and circuit visualization utilities.

Installation

  • Base:
pip install quickqudits
  • With JIT speedups:
pip install "quickqudits[numba]"
  • With plotting:
pip install "quickqudits[plot]"
  • For dev/tests:
pip install "quickqudits[test]"
  • Everything:
pip install "quickqudits[numba,plot,test]"

Quick start

import quickqudits as qq

# initialize circuit
n, d = 5, 3  # 5 qudits of dimension 3
qc = qq.QuantumCircuit(n, d, name="example")

# add gates
qc.CXdag(2, 0)
qc.CX(1, 0)
qc.H(0)
qc.H(1)
qc.CXdag(0, 2)
qc.CX(0, 4)
qc.X(2)
qc.S(4)
qc.Hdag(4)
qc.CXdag(2, 0)
qc.Sdag(3)
qc.CX(2, 0)
qc.CZdag(4, 0)

# add global depolarizing noise
qc.add_noise_global(0.5)

# visualize circuit
qc.draw(show_info=True)

Generated circuit

The circuit produced by qc.draw(show_info=True):

Example circuit

# initialize tableau
tab = qq.Tableau(5, 3)

# draw samples from the noisy circuit
samples = tab.sample_measurements_noisy_pf(qc=qc, shots=5, seed=42)
print(samples, end="\n\n")

# execute the circuit and obtain tableau (ignoring noise channels)
tab.apply_circuit(qc)

# visualize tableau
print(tab)

Output

[[2 0 0 0 1]
 [0 2 2 0 1]
 [2 2 1 1 1]
 [0 1 0 0 2]
 [0 1 1 0 0]]

#  | x0 x1 x2 x3 x4 | z0 z1 z2 z3 z4 | τ
────────────────────────────────────────
d0 |  0  0  0  0  0 |  1  0  0  0  0 | 0
d1 |  0  0  0  0  0 |  1  1  0  0  0 | 0
d2 |  0  0  1  0  0 |  2  0  0  0  0 | 0
d3 |  0  0  0  1  0 |  0  0  0  2  0 | 0
d4 |  0  0  0  0  1 |  2  0  0  0  2 | 4
----------------------------------------
s0 |  2  1  1  0  2 |  2  0  1  0  2 | 2
s1 |  0  2  0  0  0 |  0  0  0  0  0 | 0
s2 |  0  0  0  0  0 |  1  0  1  0  0 | 4
s3 |  0  0  0  0  0 |  0  0  0  1  0 | 0
s4 |  0  0  0  0  1 |  1  0  0  0  0 | 0

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

quickqudits-1.0.1.tar.gz (88.7 kB view details)

Uploaded Source

Built Distribution

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

quickqudits-1.0.1-py3-none-any.whl (90.8 kB view details)

Uploaded Python 3

File details

Details for the file quickqudits-1.0.1.tar.gz.

File metadata

  • Download URL: quickqudits-1.0.1.tar.gz
  • Upload date:
  • Size: 88.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for quickqudits-1.0.1.tar.gz
Algorithm Hash digest
SHA256 12e1b6403facdbf3cbf2101549f6cb54bbd0502aeaed117dd02cb5fd0e865b77
MD5 94ed07f9fc0c4210fc08d803484898a6
BLAKE2b-256 94ad0b714c792b7732c38262ee25580601ee3e77fb4e0f5383527540207b893d

See more details on using hashes here.

File details

Details for the file quickqudits-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: quickqudits-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 90.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for quickqudits-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 739aeb4a4d95df75d24e6e53645ab6d93fe39bb31659b2c456290bc54e318da3
MD5 8ad9ac0275929d8b1f604075156d7424
BLAKE2b-256 6d9a0b805e8a193348f41eb4d37eb2eae0dfb137ac56a3ec722a417aea94a1e4

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