Skip to content

Default HybridEngine to the Rust PHIR interpreter#348

Closed
ciaranra wants to merge 2 commits into
devfrom
hybrid-engine-default-rust
Closed

Default HybridEngine to the Rust PHIR interpreter#348
ciaranra wants to merge 2 commits into
devfrom
hybrid-engine-default-rust

Conversation

@ciaranra

Copy link
Copy Markdown
Member

Default HybridEngine's classical interpreter to the Rust implementation (RustPhirClassicalInterpreter), and strengthen the Rust↔Python parity coverage that backs the switch.

Change

_make_classical_interpreter(None) now returns the Rust interpreter instead of the Python one. The cinterp argument still lets callers choose: cinterp="python" for the pure-Python PhirClassicalInterpreter, cinterp="rust" (or the default) for the Rust-backed one, or a concrete instance. Rust is a core dependency (pecos_rslib always ships), so the default path is always available; no fallback added.

Motivation: the Rust interpreter is bit-for-bit equivalent to Python (parity suite) and materially faster.

Verification

  • Default resolves to RustPhirClassicalInterpreter.
  • quantum-pecos suite: 784 passed, slr_tests: 435 passed (full SLR→PHIR→HybridEngine path) with the Rust default — no feature gaps.
  • Parity coverage strengthened (second commit): fuzz iterations 200→2000 (classical) / 200→1000 (quantum); classical fuzz now nests expressions and includes unary ~; added the example1 WASM program; added a QASM→PHIR generated-differential over the curated converter fixtures. ~3,200 direct Rust≡Python comparisons total, all green, in <3s.

Notes

  • Users can opt back to Python via cinterp="python".
  • This is a default-behavior change affecting all HybridEngine users.

@ciaranra

Copy link
Copy Markdown
Member Author

Consolidated into #347 (the default-to-Rust switch + parity strengthening now live there); avoiding a separate PR.

@ciaranra ciaranra closed this Jul 10, 2026
@ciaranra ciaranra deleted the hybrid-engine-default-rust branch July 10, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant