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.

Download files

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

Source Distribution

rigetti_quax-0.7.2.tar.gz (95.0 kB view details)

Uploaded Source

Built Distribution

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

rigetti_quax-0.7.2-py3-none-any.whl (113.3 kB view details)

Uploaded Python 3

File details

Details for the file rigetti_quax-0.7.2.tar.gz.

File metadata

  • Download URL: rigetti_quax-0.7.2.tar.gz
  • Upload date:
  • Size: 95.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.13 Linux/6.1.176-221.367.amzn2023.x86_64

File hashes

Hashes for rigetti_quax-0.7.2.tar.gz
Algorithm Hash digest
SHA256 c37a05128b12319b6b47fa10d45277ea89eec7a17ed41681d0c641d5113cdb0d
MD5 494ca5ec69aac023140675292bf97629
BLAKE2b-256 269df6ba771f38cd91cd6f664ebfc638aa5184800b9d21c4738b440833db282e

See more details on using hashes here.

File details

Details for the file rigetti_quax-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: rigetti_quax-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 113.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.13 Linux/6.1.176-221.367.amzn2023.x86_64

File hashes

Hashes for rigetti_quax-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d93c8151062f7540b3fb1cb88b5cbf0cb11a0e84f4ffc124d4f719e3b1e6c073
MD5 355142931764608bce504e616a55a266
BLAKE2b-256 f86e47c5e62680a4c7c82fb66afaf99f4e61e9ed2f271354c1a42d58e721c97f

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 Sentry Error logging StatusPage Status page