Simulator Backend for Quantum Computing
Project description
Quex
Initially, these are just a lot of big words!
A high-performance, backend-agnostic dispatcher for quantum circuit execution.
Quex aims to be the "JAX for Quantum Computing." Currently, many quantum simulators are tightly coupled to their frontend SDKs (e.g., Qiskit, Cirq). Quex completely divorces circuit construction from circuit execution.
By ingesting standard intermediate representations (like OpenQASM 3.0), Quex acts as an intelligent dispatcher, routing the heavy linear algebra required for quantum simulation to the most optimal, hardware-specific classical solver available on your machine—whether that is a multi-core CPU, an NVIDIA GPU (via cuQuantum), or an Apple Silicon unified memory architecture.
Core Architecture
-
The Ingestion Layer: Parses hardware-agnostic formats (OpenQASM 3.0, and eventually QIR) into a lightweight internal Abstract Syntax Tree (AST).
-
The Dispatcher (WIP): Analyzes circuit depth, qubit count, and host hardware to intelligently route execution.
-
The Execution Engines (WIP): Wrappers around optimized, low-level linear algebra libraries (NumPy, SciPy Sparse, cuQuantum, etc.) to crunch the matrices efficiently.
Installation and Setup
Quex is managed using uv, the lightning-fast Python package manager written in Rust.
Prerequisites
If you don't have uv installed, we recommend the standalone installer:
curl -LsSf https://astral.sh/uv/install.sh | sh
Local Development Setup
To clone the repository and set up the development environment instantly:
# 1. Clone the repo
git clone https://github.com/rajarshitiwari/quex.git
cd quex
# 2. Sync dependencies (uv will automatically create a .venv and install the lockfile)
uv sync
# 3. (Optional) Run tests to ensure everything is working
uv run pytest
💻 Quick Start
Currently, Quex features a highly efficient (hopefully) parsing layer for OpenQASM 3.0 strings. Here is how to ingest a standard quantum circuit:
import quex as qx
# Instantiate a circuit
qc = qx.Circuit(num_qubits=2)
# Add standard operations
qc.add_operation('h', 0)
qc.add_operation('cx', [0, 1])
# Quex features a built-in topological visualizer
print("Circuit Topology:")
print(qc)
# We read a raw OpenQASM string from an external file/source
qasm_str = """
OPENQASM 3.0;
qubit[2] q;
h q[0];
rx(theta_0) q[1];
ry(gamma_1) q[0];
cx q[0], q[1];
"""
# Parse it
qc = qx.Circuit.from_qasm(qasm_str)
# Quex automatically found the variables and initialized them!
print("Auto-populated Parameters:")
print(qc.parameters)
# Output: {'theta_0': 0.0, 'gamma_1': 0.0}
# Now attach a simulator, and run it.
qc.simulator = qx.NumpySimulator()
baseline_state = qc.run()
# The ML loop can just update the dictionary directly
qc.parameters['theta_0'] = 1.57
updated_state = qc.run()
Running Scripts Locally
Because uv handles virtual environments automatically, you do not need to manually activate your .venv. Simply prepend uv run to execute your scripts with all Quex dependencies loaded:
uv run your_script.py
🗺️ Roadmap
- OpenQASM 3.0 Ingestion Layer
- Internal Circuit Representation (DAG structure)
- Baseline Classical Execution Engine (NumPy state-vector simulation)
- Hardware Dispatcher Logic
- Advanced Execution Engines (SciPy Sparse, cuQuantum integration)
- LLVM-based QIR Ingestion
Contact
Contact rajarshi.tiwari @ ichec.ie, or @rajarshitiwari for any questions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quex-0.2.0.tar.gz.
File metadata
- Download URL: quex-0.2.0.tar.gz
- Upload date:
- Size: 138.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f3e6548a8d83d2ccd648ec59f797afc67ed688bfcf4fd817914509bc264a1f8
|
|
| MD5 |
16f027ca4fa26bbc2acb1f3a75837d7e
|
|
| BLAKE2b-256 |
6f5e681ee76add30fac90808c5d5877d4c9c890a049390de28ef1abe343107e2
|
Provenance
The following attestation bundles were made for quex-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on ICHEC/quex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quex-0.2.0.tar.gz -
Subject digest:
8f3e6548a8d83d2ccd648ec59f797afc67ed688bfcf4fd817914509bc264a1f8 - Sigstore transparency entry: 1519053722
- Sigstore integration time:
-
Permalink:
ICHEC/quex@cf38399d8b27f485b73341d9fd02d1b267017ed3 -
Branch / Tag:
refs/tags/r1 - Owner: https://github.com/ICHEC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@cf38399d8b27f485b73341d9fd02d1b267017ed3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file quex-0.2.0-py3-none-any.whl.
File metadata
- Download URL: quex-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31a1fa3c39a2c180434498b65280c6fcb0e3f7b600e5a7f07a39fa7d321268c9
|
|
| MD5 |
2c0b91738e2aebf7e8155f7649668ebe
|
|
| BLAKE2b-256 |
abe921652e4bd02b863918727cbc0470467c2ffc2be877e4d9a5a06769c9ba01
|
Provenance
The following attestation bundles were made for quex-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on ICHEC/quex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quex-0.2.0-py3-none-any.whl -
Subject digest:
31a1fa3c39a2c180434498b65280c6fcb0e3f7b600e5a7f07a39fa7d321268c9 - Sigstore transparency entry: 1519053745
- Sigstore integration time:
-
Permalink:
ICHEC/quex@cf38399d8b27f485b73341d9fd02d1b267017ed3 -
Branch / Tag:
refs/tags/r1 - Owner: https://github.com/ICHEC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@cf38399d8b27f485b73341d9fd02d1b267017ed3 -
Trigger Event:
release
-
Statement type: