westquant-qiskit
Wave 1 deterministic representation search for Qiskit.
westquant-qiskit searches the compilation representation, not only compiler
parameters. A logical circuit is compiled through a reproducible grid of Qiskit
pipeline choices and every success, failure, metric delta, and verification
outcome is written to RepGraph/WQT-ready records.
v0.1 search space
The first deterministic engine searches the Cartesian product of:
- optimization level:
0, 1, 2, 3 - layout:
trivial, dense, sabre - routing:
basic, lookahead, sabre - translation:
translator, synthesis - fixed transpiler seeds
- approximation degree
The default training grid with three seeds contains 216 pipeline representations per circuit. This is intentionally deterministic: the same circuit, target, search-space version, and seeds reproduce the candidate set.
Run a smoke suite
pip install -e ../westquant-core
pip install -e .
python -m westquant_qiskit.cli --suite smoke --output results/qiskit-smoke
A larger local data-generation suite:
python -m westquant_qiskit.cli \
--suite train \
--seed-count 3 \
--output results/qiskit-train
Each challenge writes:
summary.json
repgraph.json
training.jsonl
training.jsonl is the primary WQT20 precursor format. Each row contains the
logical baseline metrics, one pipeline choice, compilation success/failure,
conservative equivalence verification, resulting metrics, metric deltas,
compile cost, Pareto membership, and rank.
Verification policy
WestQuant does not silently call a candidate equivalent. For small unitary
circuits of equal width, v0.1 uses
qiskit.quantum_info.Operator.from_circuit(...).equiv(...), which accounts for
stored transpiler layouts. Circuits that cannot be checked under that regime
are labeled UNKNOWN, not EXACT.
Current objective vector
Candidates are Pareto-compared by minimizing:
- two-qubit gate count
- SWAP count
- depth
- circuit size
- compile time
The lexicographic best is used only as a transparent deterministic default;
the full Pareto front and all losing candidates remain in the dataset.
Qiskit integration
The package registers westquant as a Qiskit transpiler stage plugin for the
layout, routing and optimization stages:
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
pm = generate_preset_pass_manager(
optimization_level=2, backend=backend, seed_transpiler=7,
layout_method="westquant", routing_method="westquant", optimization_method="westquant",
)
tqc = pm.run(qc)
print(pm.property_set["westquant_selection"])
Each stage is a deterministic best-of selection among Qiskit's own built-in
strategies (layout: trivial/dense/sabre; routing: SabreSwap/BasicSwap/
LookaheadSwap; optimization: levels 0-3), scored by two-qubit cost (SWAP = 3)
and then depth. Every candidate, including failures and their error messages,
is recorded in property_set["westquant_selection"]; if every candidate fails a
TranspilerError is raised. The routing stage only runs when the circuit is
not already mapped to the device. Tests check unitary equivalence, ideal output
distributions with measurements, coupling-map compliance and that the selected
candidate is the one returned. This is a best-of wrapper over Qiskit, not the
full sequential policy search described below.
Sequential policy search
Wave 1 now also includes a policy-style sequential search mode. Instead of choosing a complete compiler pipeline in one Cartesian-grid action, WestQuant chooses an ordered sequence:
layout -> routing -> translation -> optimization
Each partial prefix is evaluated through an end-to-end rollout with unchosen later stages set to Qiskit's explicit defaults. A beam retains the strongest states under the deterministic objective vector. This intentionally uses only public Qiskit APIs while producing WQT-ready state/action/reward trajectories.
westquant-qiskit-search \
--suite smoke \
--search sequential \
--beam-width 3 \
--output results/qiskit-sequential
Each challenge writes trajectory.jsonl in addition to summary.json and
repgraph.json. A row contains state_id, stage, action, prefix before and
after the action, rollout pipeline, verification, metrics, reward vector,
baseline delta, and whether the state survived the beam.
Sequential 1000 dataset generator
Generate a frozen balanced manifest:
westquant-qiskit-1000 --output results/wq-qiskit-sequential-1000 --manifest-only
Pilot 25 challenges:
westquant-qiskit-1000 --output results/wq-qiskit-sequential-1000 --beam-width 3 --limit 25
Run/resume the full 1000:
westquant-qiskit-1000 --output results/wq-qiskit-sequential-1000 --beam-width 3
Regenerate statistics from raw saved outputs only:
westquant-qiskit-1000 --output results/wq-qiskit-sequential-1000 --stats-only
See docs/SEQUENTIAL-1000.md for the frozen design and failure-retention policy.
Metadata
Release files for westquant-qiskit 0.1.2
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_qiskit-0.1.2.tar.gz | 40.5 kB | With provenance | Details for westquant_qiskit-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| westquant_qiskit-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for westquant_qiskit-0.1.2-py3-none-any.whl |
Total release size: 81.0 kB
Release files / westquant_qiskit-0.1.2.tar.gz
| Download URL | westquant_qiskit-0.1.2.tar.gz |
|---|---|
| Size | 40.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be303a53d470a773ed4ca54ace7e469d05612f5d3640f83a87989b95c5c1f6b3
|
|
BLAKE2b-256 checksum How to use checksums |
77fe2580be509aed6c59104e20e0643f08767e2305e4066d8f95ad9bbd0fd0ca
|
| 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 logRelease files / westquant_qiskit-0.1.2-py3-none-any.whl
| Download URL | westquant_qiskit-0.1.2-py3-none-any.whl |
|---|---|
| Size | 40.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b954b52b4b9860b4b5b478ec471a03de43d9d2a8f3b5f470236608654cd2e78
|
|
BLAKE2b-256 checksum How to use checksums |
5cc19ed8f9d17ac459ba2cfd8bce4a8cf8c2c2785fa46424fe1b5f10d107a422
|
| 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 logSecurity for westquant-qiskit 0.1.2
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.
Attestation for westquant_qiskit-0.1.2.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 logA 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.