Skip to main content

WestQuant QCSC Optimizer

Use the QPU only where the QPU is actually needed.

Semantic QPU Minimization for hybrid quantum-classical workflows.


PyPI Python License Discussions


An open-source, software-agnostic analyzer and optimizer for hybrid quantum-classical projects. The system inspects a user's quantum codebase and answers:

Which planned quantum operations actually need QPU hardware?

Core distinction

Existing hybrid quantum systems often solve: Where should task T execute?

WestQuant solves the deeper problem: Should task T require a QPU at all?

This is Semantic QPU Minimization.

Quick start

pip install westquant-qcsc

Command renamed in 0.2.0. The console command is now westquant-qcsc. Versions 0.1.x installed it as westquant, which collided with the westquant umbrella package's own command. Replace westquant audit|propose|run|policy|closed-loop with westquant-qcsc …; subcommands and options are unchanged. If you keep 0.1.x, do not install it alongside the westquant package.

Audit a project

westquant-qcsc audit ./my_quantum_project

Output:

westquant_report.html    # Full HTML report
westquant_report.md      # Markdown report
westquant_plan.json      # Machine-readable plan (SAFE/BALANCED/AGGRESSIVE)
westquant_workflow.json  # WQFlow IR graph

QPU Budget Predictor

Estimate the required QPU budget from problem structure — before any quantum execution:

from qcsc import QPUBudgetPredictor, ProblemProfile

profile = ProblemProfile(
    problem="MaxCut",
    n_qubits=16,
    p=3,
    graph_family="GEO",
    quality_target=0.95,
)
predictor = QPUBudgetPredictor()
budget = predictor.estimate(profile)

print(f"Shots: {budget.recommended_shots:,}")
print(f"Reduction vs naive: {budget.reduction_vs_naive:.0f}x")
print(f"Estimated quality: {budget.estimated_quality:.4f}")
print(f"Strategies: {budget.strategies}")

Or from the CLI:

westquant-qcsc budget --problem MaxCut --qubits 16 --depth 3 --family GEO --compare

Output:

  [B0_naive]
    Shots:         2,119,680
    Est. quality:  0.9961

  [B1_best_practice]
    Shots:         1,024
    Est. quality:  0.9961
    vs naive:      2070.0x reduction

  [B2_classical]
    Shots:         0
    Est. quality:  1.0000

The predictor is calibrated from 12,600 exact simulation results across 6 problems, 7 graph families, and depths p=1,2,3. See Paper A for the underlying research.

What it detects

ID Transformation Guarantee Description
T01 Redundant Measurement Bases EXACT Observables obtainable from same basis
T02 Measurement Reuse EXACT Observables recoverable from existing samples
T03 Commuting Measurement Grouping EXACT Group compatible Pauli observables
T04 Shot Reduction Opportunity APPROXIMATE Detect high shot budgets, propose ablation
T05 Adaptive Shot Allocation APPROXIMATE Variable shot budgets by optimization stage
T06 Simulator Pretraining APPROXIMATE Pretrain variational parameters on simulator
T07 Parameter Transfer APPROXIMATE Transfer params between structurally similar instances
T08 Repeated-Circuit Caching EXACT Cache identical circuit+parameter submissions
T09 Graph/Problem Preprocessing EXACT Classical graph reduction (components, symmetry)
T10 Workload Packing EXPERIMENTAL Pack independent circuits on larger QPU
T11 Candidate Pruning APPROXIMATE Surrogate filtering for large parameter sweeps
T12 Circuit Cutting Candidate EXACT Identify cuttable interaction graphs
T13 CPU/GPU Simulator Routing EXACT Recommend best simulator class
T14 Circuit Architecture Reduction EXACT Remove mathematically redundant gates
T15 Quantum/Classical Decomposition EQUIVALENT Split quantum sampling from classical post-processing

Three plans

  • SAFE: Only EXACT transformations. Mathematical result preserved.
  • BALANCED: EXACT + EQUIVALENT + low-risk APPROXIMATE. Requires tolerance ε.
  • AGGRESSIVE: All transformations including EXPERIMENTAL. Always shows uncertainty.

Architecture

qcsc/
├── qpu_budget.py              # QPU budget predictor (Paper A integration)
├── flow_ir/                    # WQFlow IR — directed graph of hybrid workflows
├── resource_model/             # QPU backend + local compute capabilities
├── transformation_registry/    # 15 QPU-saving transformations (T01-T15)
├── analyzer/                   # Framework-specific source analysis (Qiskit first)
├── detectors/                  # Detectors that produce recommendations
├── planner/                    # Pareto planner (SAFE/BALANCED/AGGRESSIVE)
├── reporting/                  # HTML + Markdown + JSON report generation
├── benchmark/                  # Benchmark projects with known opportunities
├── cost_model.py               # QPU cost estimation
├── closed_loop.py              # Closed-loop measurement tracking
├── learned_policy.py           # Learned policy for transformation ranking
├── patch_generator.py         # Advisory patch generation
├── runner.py                   # Supervised plan execution
└── cli.py                      # CLI entry point

Design philosophy

WestQuant asks three questions in order:

  1. Does this operation need to happen? (Eliminate)
  2. Does it need to be quantum? (Replace with classical)
  3. Only then: which resource should execute it? (Schedule)

That ordering is the defining idea of the project.

CUDA-Q and cuQuantum

Version 0.1.1 adds advisory capability records for CUDA-Q CPU/GPU targets and cuStateVec, cuTensorNet, cuDensityMat, cuPauliProp, and cuStabilizer. Install westquant-qcsc[cudaq] to compose QPU minimization with westquant-cudaq. The integration is domain-neutral and does not include vertical-specific scientific methods.

V0.1 — Advisory only

V0.1 performs static analysis + cost estimation + recommendations. It does NOT:

  • modify user code
  • execute user code
  • submit jobs to hardware
  • automatically rewrite experiments

Community

License

MIT

Metadata

Release files for westquant-qcsc 0.2.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-qcsc 0.2.0
File Size Uploaded Provenance Actions
westquant_qcsc-0.2.0.tar.gz 46.9 kB With provenance Details for westquant_qcsc-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for westquant-qcsc 0.2.0
File Interpreter ABI Platform Actions
westquant_qcsc-0.2.0-py3-none-any.whl Python 3 none any Details for westquant_qcsc-0.2.0-py3-none-any.whl

Total release size: 99.5 kB

Release files / westquant_qcsc-0.2.0.tar.gz

Download URL westquant_qcsc-0.2.0.tar.gz
Size 46.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8aafecf4084d8b138d8b019d06388905087e4f377fb1b68792651a85ed1b5074
BLAKE2b-256 checksum
How to use checksums
643ad38c4b061cace7b5c933675cdb01ecf55a31af9957a48098621e2a560395
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / westquant_qcsc-0.2.0-py3-none-any.whl

Download URL westquant_qcsc-0.2.0-py3-none-any.whl
Size 52.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37cbbab6d45fe91d7c4c7c2a763a0bb76d6db589c0c5d0773d53bec6e54edf95
BLAKE2b-256 checksum
How to use checksums
b7ab4ff53d744c3d12066bf8b4e576f07d9a6d91c370a2ad124e8adb55cf9688
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for westquant-qcsc 0.2.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for westquant_qcsc-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

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.

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