What It Does — 3 Tested Examples
Example 1: 62% Gate Reduction (Random Circuit, Fidelity-Focused)
Problem: 8-qubit random circuit (depth 30) on grid topology Naive transpilation → cost 1231.2 (fidelity-focused objective) 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, Linear Backend)
The same QAOA circuit gets different best actions depending on the objective:
QAOA-6q-p2 on linear backend: Objective WQT50M picks ───────────────── ───────────────── balanced → CANCEL_GATES 2q_focused → 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
WQT50M predicts costs in the real magnitude range (not a narrow band):
State: <DOMAIN:circuit_optimization> <LEVEL:CIRCUIT> <N_QUBITS:8> ... <BACKEND:SUPERCONDUCTING> <TOPO:grid> <T1:180us> <T2:90us> <OBJ_TYPE:fidelity_focused>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, AutoTokenizerimport 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() # Predict cost for a state-action pairstate = ("<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())# → predicted cost in real magnitude range
What WQT50M Predicts
Table with columns: Task, Input, Output, Performance| Task | Input | Output | Performance |
|---|
| Value prediction | State + action | Predicted cost (calibrated) | Spearman 0.981, ratio 0.999 |
| Ranked policy | State + all actions | Best action (via value ranking) | 74% Top-1 |
| Objective sensitivity | Same state, different objectives | Different best actions | 65% change rate |
| Backend awareness | Same state, different backends | Different best actions |
Model
Table with columns: Config, WQT20M-Beta, WQT50M| Config | WQT20M-Beta | WQT50M |
|---|
| Architecture | Llama-style decoder | Llama-style decoder |
| Parameters | 19.06M | 49.53M |
| Layers | 8 | 12 |
| Hidden size | 384 | 512 |
| Attention heads | 6 (2 KV) | 8 (4 KV) |
| FFN | 1536 |
Standard HuggingFace LlamaForCausalLM. Compatible with AutoModelForCausalLM,
AutoTokenizer, and SafeTensors.
Validation Results
450 tests: 15 circuits × 5 objectives × 6 backends
Table with columns: Metric, WQT20M-Beta, WQT50M| Metric | WQT20M-Beta | WQT50M |
|---|
| Top-1 accuracy (picks best action) | ~22% | 74.0% |
| Beats random | 58% | 90.4% |
| Avg improvement over naive | -14.8% | +16.6% |
| Oracle improvement | +31.1% | +19.7% |
| Efficiency (% of oracle captured) | 23.3% | 88.7% |
By objective
Table with columns: Objective, WQT50M improvement, Random, Oracle, Efficiency| Objective | WQT50M improvement | Random | Oracle | Efficiency |
|---|
| balanced | 22.2% | 9.3% | 25.2% | 87.7% |
| 2q_focused | 8.8% | 3.8% | 11.2% | 92.1% |
| depth_focused | 24.1% | 9.7% | 28.0% | 87.6% |
|
By circuit type
Table with columns: Circuit, WQT50M improvement, Random, Oracle, Efficiency| Circuit | WQT50M improvement | Random | Oracle | Efficiency |
|---|
| BV-4q | 26.6% | 7.8% | 26.6% | 100% |
| GHZ-4q | 11.9% | 2.4% | 11.9% | 100% |
| GHZ-8q | 6.5% | 1.3% | 6.5% | |
Biggest improvements
Table with columns: Circuit, Backend, Objective, Naive → WQT50M, Improvement| Circuit | Backend | Objective | Naive → WQT50M | Improvement |
|---|
| Random-8q-d30 | grid | fidelity | 1231 → 467 | 62.0% |
| Random-8q-d30 | ion trap | fidelity | 273 → 118 | 56.7% |
| Random-8q-d30 | linear | depth | 1752 → 763 | |
Production Gap Coverage
WQT50M addresses 6 of the 9 production gaps identified in WQT20M-Beta:
Table with columns: Gap, WQT20M-Beta, WQT50M, Status| Gap | WQT20M-Beta | WQT50M | Status |
|---|
| Gap 1: Real compiler outputs | Synthetic surrogate | Real Qiskit transpilation | ✅ Fixed |
| Gap 2: Value calibration | 6.0–6.6 range | Ratio 0.999, Spearman 0.981 | ✅ Fixed |
| Gap 3: Objective sensitivity | 0% | 65% change rate | ✅ Fixed |
| Gap 4: Legality | 76.9% | 79.2% |
Remaining gaps for future models
- Legality accuracy: 79.2% (target >90%) — needs a dedicated classification head
- Multi-step trajectory planning: Data generated but not yet evaluated end-to-end
- Active learning feedback loop: Not yet implemented
- Production deployment as Qiskit plugin: Not yet implemented
Training Data
WQT50M is trained on real Qiskit transpilation outputs:
Table with columns: Component, Details| Component | Details |
|---|
| Circuits | 50,000 (QAOA, Grover, QFT, BV, GHZ, random, Toffoli) |
| Backends | 6 (linear, ring, grid, heavy-hex, all-to-all, trapped ion) |
| Strategies | 12 real Qiskit transpilation passes |
| Objectives | 5 (balanced, 2q-focused, depth-focused, fidelity-focused, time-focused) |
| Records | 1,799,639 total |
| Backend calibration | Per-edge error rates, T1/T2, readout errors |
| Legality | 50/50 balanced with real constraints |
| Trajectories | 50,000 multi-step optimization sequences |
Coverage
15 quantum optimization domains:
Table with columns: Domain, Example Actions| Domain | Example Actions |
|---|
| Quantum chemistry | UCCSD_ANSATZ, ADAPT_VQE, FROZEN_CORE |
| Graph optimization | MAXCUT_ROUND, COLOR_GRAPH, SDP_RELAX |
| Error correction | SYNDROME_MEASURE, DECODE_SURFACE, MAGIC_STATE_DISTILL |
| Quantum annealing | REVERSE_ANNEAL, MINOR_EMBED, HYBRID_SOLVE |
| Variational | QAOA_P1/P2/P3, WARM_START, ADAPTIVE_LAYER |
| Hamiltonian simulation | TROTTER_STEP, LCU_DECOMPOSE, QUBITIZE |
| Circuit optimization | CANCEL_GATES, ZX_SIMPLIFY, FUSE_ROTATIONS |
| Hardware mapping | SABRE_ROUTE, PULSE_OPTIMIZE, NOISE_AWARE |
Limitations
- Legality: 79.2% — Below the 90% target. The model sometimes marks
illegal actions as valid.
- Not a circuit compiler — The model works on structured state
representations, not raw Qiskit/TKET circuits. Plugins translate between
the model's representation and real frameworks.
- Single-step evaluation — While trajectory data was generated, the
model has not been evaluated on multi-step planning end-to-end.
- No active learning — The model is static; it does not improve from
user compilations.
License
Apache 2.0
Citation
@misc{westquant2026wqt50m, title={WQT50M: A 50M-Parameter Transformer for Quantum Representation Scheduling}, author={Vesterlund, David}, year={2026}, url={https://huggingface.co/WestQuantStudio/WQT50M}, note={WestQuant Open Source Project}}