Skip to main content

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:

License

Apache 2.0

Metadata

Release files for westquant-plugins 0.4.0

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

Source distribution (sdist)

Source distribution for westquant-plugins 0.4.0
File Size Uploaded Provenance Actions
westquant_plugins-0.4.0.tar.gz 15.9 kB Without provenance Details for westquant_plugins-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for westquant-plugins 0.4.0
File Interpreter ABI Platform Actions
westquant_plugins-0.4.0-py3-none-any.whl Python 3 none any Details for westquant_plugins-0.4.0-py3-none-any.whl

Total release size: 36.6 kB

Release files / westquant_plugins-0.4.0.tar.gz

Download URL westquant_plugins-0.4.0.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2f100141032bec2e4cb9c04e0e27de054641dc0d660a9d0b4a289e920843fa2d
BLAKE2b-256 checksum
How to use checksums
15e45942fdfec6a0ddb3593056ac6a0b99e8c6e0f6d427ce2b685661cf7e603e
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.4.0-py3-none-any.whl

Download URL westquant_plugins-0.4.0-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e22c82c907459a0c57d5419b08bd24f69b1d7f5a83aa2efd939fa89bf170956
BLAKE2b-256 checksum
How to use checksums
b8bddf316499078b876aeb907ffd6d57e060fd936a618b92e62809cc2c317f9a
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.4.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.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files No provenance

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