Skip to main content

Quax

A high-performance quantum information science library built on top of JAX.

Documentation

Check out the docs.

Features

  • Quantum Objects: States, gates and superoperators objects are defined to allow natural manipulations and operations.
  • Clear typing: Standard objects such as Unitaries, Chois and Density matrices are all typed, clarifying the nature of various objects.
  • Standard operators composition/application @, tensor products |, scalar multiplication * and powers * are defined on all quantum objects.
  • Automatic promotion Pure states and operators are automatically promoted to mixed states and superoperators when appropriate.
  • Quantum instruments Mid-circuit measurements are modeled with QuantumInstrument, supporting confusion/transition matrices, composition, and tensor products.
  • Qudit support Operations on d-dimensional qudits are supported.
  • Batch support Operating on batches or ensembles of states is supported for straightforward parallelization.

Installation

pip install rigetti-quax

Quick Example

import jax
import jax.numpy as jnp
import quax as qx

# Create a 2-qubit state
psi_0: qx.StateVector = qx.zero_state_vector(dims=(2, 2,))

# Apply gates to prepare a pure Bell state
psi = (qx.gates.H | qx.gates.I) @ psi_0
psi = qx.gates.CNOT @ psi

# Generate an ensemble of Lindbladians with varying strenght
L: qx.Lindbladian = qx.lindbladians.amplitude_damping(jnp.linspace(0.0, 0.1, 10))

# Combine the Lindbladians with the CNOT unitary to create an ensemble of quantum channels
# The unitary is automatically promoted to a superoperator to support the addition of the Lindbladian
noisy_cnot: qx.SuperOp = qx.gates.CNOT + (L | L)

# Apply the noise operation to create a noisy Bell states
rho: qx.DensityMatrix = noisy_cnot @ (qx.gates.H | qx.gates.I) @ psi_0

# Compute the fidelity between the noisy Bell state and the ideal Bell state
fidelity: jax.Array = qx.fidelity(rho, psi)

# Now let's apply a qutrit gate to the ensemble of noisy Bell states. 
rho = (qx.gates.TRX12(jnp.pi) | qx.gates.I) @ rho

# We can estimate the 𝜆8 observable
obesrvables: jax.Array = qx.estimate(rho, observable=(qx.gates.GELLMANN8) | qx.gates.I)

Acknowledgements

Quax draws inspiration, educational material, and some code from forest-benchmarking, Rigetti's open-source library for quantum characterization, verification, and validation. We gratefully acknowledge the forest-benchmarking contributors for their foundational work on superoperator representations, quantum channel conventions, and distance metrics.

License

Copyright 2026 Rigetti & Co, LLC. Licensed under Apache License 2.0.

Metadata

Release files for rigetti-quax 0.7.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rigetti-quax 0.7.8
File Size Uploaded
rigetti_quax-0.7.8.tar.gz 110.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rigetti-quax 0.7.8
File Interpreter ABI Platform
rigetti_quax-0.7.8-py3-none-any.whl Python 3 none any Details

Total release size: 242.1 kB

Release files / rigetti_quax-0.7.8.tar.gz

Download URL rigetti_quax-0.7.8.tar.gz
Size 110.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bec35177332f3f523cdf2dd71739ca385e75cece0cb46aa4098e6eb5e757dfd5
BLAKE2b-256 checksum
How to use checksums
e6852ff9faa8556898e32bed9c90f23973c5b98c9b5104c2ee0cfd87cb01ce6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.15 Linux/6.1.188-233.385.amzn2023.x86_64

Release files / rigetti_quax-0.7.8-py3-none-any.whl

Download URL rigetti_quax-0.7.8-py3-none-any.whl
Size 132.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbcab6c9429da41b08a9f6ae82afc24527a638023dbb5cc6d274583f3ff0c439
BLAKE2b-256 checksum
How to use checksums
e701f4cf27eb6f91a191a8f82e30492f3be89e7500da6514e29b615fac544975
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.15 Linux/6.1.188-233.385.amzn2023.x86_64

Release history Release notifications | RSS feed

This release

0.7.8 This release

2 release files

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

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