WestQuant Open Source
WQT50M — a 50M-parameter open-source Transformer for quantum representation scheduling. Trained on real Qiskit transpilation outputs.
AI schedules. Deterministic mathematics executes. Independent verification certifies.
WQT50M is a proof-of-concept that a 50M-parameter Transformer can learn structured quantum optimization preferences from real compiler outputs. Researchers building better compiler-optimization models can use this as a baseline.
Models
| Model | Params | Training Data | Key Result |
|---|---|---|---|
| WQT20M-Beta | 19M | Synthetic | Proof-of-concept baseline |
| WQT50M | 50M | Real Qiskit | 74% Top-1, 90.4% beats random |
What WQT50M Does — 3 Tested Examples
Example 1: 62% Gate Reduction
Problem: 8-qubit random circuit (depth 30) on grid topology
Naive transpilation → cost 1231.2 (fidelity-focused)
WQT50M schedules ZX_SIMPLIFY
→ cost 467.4 (62.0% reduction)
Random selection → cost 869.6 (29.4% reduction)
Oracle (exhaustive) → cost 467.4 (62.0%)
WQT50M matches oracle ✓
Example 2: Objective-Aware Scheduling
QAOA-6q-p2 on linear backend:
Objective WQT50M picks
───────────────── ─────────────────
balanced → CANCEL_GATES
depth_focused → NATIVE_GATESET
fidelity_focused → FUSE_ROTATIONS
time_focused → MERGE_ADJACENT
4 different actions for 5 objectives ✓
Example 3: Calibrated Value Prediction
Action: ZX_SIMPLIFY
Predicted cost: 467.4
Actual cost: 467.4
Error: 0.0%
Calibration ratio: 0.999 (predicted range matches actual range)
Spearman correlation: 0.981
Quick Start
pip install transformers torch
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained("WestQuantStudio/WQT50M")
tokenizer = AutoTokenizer.from_pretrained("WestQuantStudio/WQT50M")
device = "mps" if torch.backends.mps.is_available() else "cpu"
model = model.to(device).eval()
state = ("<DOMAIN:circuit_optimization> <LEVEL:CIRCUIT> "
"<N_QUBITS:8> <ENTANGLEMENT:0.5000> "
"<RES:n_q=8 D=30 G1=100 G2=20 T=120 M=0 A=0.2000 E=0.0050 C=0.5000> "
"<BACKEND:SUPERCONDUCTING> <TOPO:grid> "
"<T1:180us> <T2:90us> <READOUT_ERR:0.0120> "
"<OBJ_TYPE:fidelity_focused> <STEP:0/5>")
text = f"<PREDICT> {state} <ACTION> ZX_SIMPLIFY <COST> "
ids = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt").to(device)
with torch.no_grad():
for _ in range(8):
out = model(input_ids=ids)
nxt = out.logits[0, -1].argmax().unsqueeze(0).unsqueeze(0)
ids = torch.cat([ids, nxt], dim=1)
if nxt.item() == tokenizer.eos_token_id:
break
print(tokenizer.decode(ids[0].tolist()).split("<COST>")[-1].strip())
Validation Results
450 tests: 15 circuits × 5 objectives × 6 backends
| Metric | WQT20M-Beta | WQT50M |
|---|---|---|
| Top-1 accuracy | ~22% | 74.0% |
| Beats random | 58% | 90.4% |
| Avg improvement over naive | -14.8% | +16.6% |
| Efficiency (% of oracle) | 23.3% | 88.7% |
| Value calibration ratio | ~0.01 | 0.999 |
| Objective sensitivity | 0% | 65% |
| Backend sensitivity | ~0% | 60% |
Production Gap Coverage
| Gap | WQT20M-Beta | WQT50M | Status |
|---|---|---|---|
| Real compiler outputs | Synthetic | Real Qiskit | ✅ |
| Value calibration | 6.0–6.6 | Ratio 0.999 | ✅ |
| Objective sensitivity | 0% | 65% | ✅ |
| Legality | 76.9% | 79.2% | ⚠️ |
| Multi-step trajectories | Single-step | 2-5 steps | ✅ |
| Backend awareness | Tokens only | 60% | ✅ |
| Model capacity | 19M | 49.53M | ✅ |
| Search improvement | +35% | 90.4% win | ✅ |
Model
| Config | Value |
|---|---|
| Architecture | Llama-style decoder Transformer |
| Parameters | 49.53M |
| Layers | 12 |
| Hidden size | 512 |
| Attention heads | 8 (4 KV heads, GQA) |
| FFN | 2048 (SwiGLU) |
| Context length | 4096 |
| Vocab | 4561 (quantum-native structured tokens + BPE) |
| Model size | 189 MB |
Models:
- WQT50M (50M, real Qiskit data)
- WQT20M-Beta (19M, synthetic baseline)
License
Apache 2.0
Metadata
Release files for westquant-plugins 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| westquant_plugins-0.3.0.tar.gz | 10.5 kB | Without provenance | Details for westquant_plugins-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| westquant_plugins-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for westquant_plugins-0.3.0-py3-none-any.whl |
Total release size: 21.3 kB
Release files / westquant_plugins-0.3.0.tar.gz
| Download URL | westquant_plugins-0.3.0.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8003877162de84c43a5d11178daa894e5bd0f3707ac1344d44973422fb273730
|
|
BLAKE2b-256 checksum How to use checksums |
5626ef48732cac43b1b8616e42aca4c26a4331f1518f72701de480a4e3712a6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Release files / westquant_plugins-0.3.0-py3-none-any.whl
| Download URL | westquant_plugins-0.3.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4313f7765392147db72aea18cbde13c1c89afa8719f853721d1146b280ecbdc
|
|
BLAKE2b-256 checksum How to use checksums |
73c91db2baeeddc74b73f6a26659e45fc35993f1e454bd123c1887958cada756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Security for westquant-plugins 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.