Skip to content

StabMps/StabVec: stabilizer+MPS simulator, Python bindings, Selene pl…#295

Merged
ciaranra merged 1 commit intodevfrom
study/tensor-network-clifford-rz
Apr 18, 2026
Merged

StabMps/StabVec: stabilizer+MPS simulator, Python bindings, Selene pl…#295
ciaranra merged 1 commit intodevfrom
study/tensor-network-clifford-rz

Conversation

@ciaranra
Copy link
Copy Markdown
Member

…ugins

Comprehensive stabilizer tensor network simulation crate (exp/pecos-stab-tn) plus Python/Selene integration and repo-wide naming cleanup.

Naming (Stab{Variant} convention)

  • CliffordRz → StabVec (sum of stabilizer states)
  • Stn/CliffordMps → StabMps (stabilizer tableau + MPS)
  • S/Sdg → SZ/SZdg in enums
  • Selene plugins: pecos-selene-stab-vec, pecos-selene-stab-mps, pecos-selene-mast

StabMps simulator (exp/pecos-stab-tn)

  • Hybrid stabilizer-tableau + MPS for Clifford+rotation circuits
  • MAST magic state injection (deferred ancilla projection)
  • Lazy virtual-frame measurement with DeferredOp queue
  • Pauli frame tracking (Y-direct rep, exact decomposition-based flush)
  • merge_rz: same-qubit RZ batching with Clifford commutation
  • QEC API: reset_qubit, pz/px, extract_syndromes, inject_paulis_in_frame
  • Builder: for_qec() preset, auto_grow_bond_dim, pauli_frame_tracking
  • Diagnostics: pragmatic_drift_count, is_state_exact, StabMpsStats, OFD nullity
  • 238 lib tests + 81 verification tests (tiered: quick + ignored deep fuzz)

Python bindings (python/pecos-rslib-exp)

  • PyO3/maturin: StabMps and Mast classes
  • Gate dispatch (run_gate/run_1q_gate/run_2q_gate), QEC helpers
  • Qubit bounds checking on all methods

Selene plugins

  • pecos-selene-stab-mps, pecos-selene-mast: SimulatorInterface impls
  • Conformance tests pass
  • Added to CI workflow matrix, Justfile, workspace configs

Merge reconciliation

  • QuantumSimulator::num_qubits() added to all impls across repo
  • StabilizerTableauSimulator stale num_qubits removed
  • ForeignSimulator/PyForeignSimulator: num_qubits threaded through FFI

Code quality

  • Zero clippy warnings, zero rustc warnings
  • All .unwrap() in production code replaced with .expect()
  • design/ docs stubbed (moved to pecos-docs vault)
  • Python backward-compat aliases: CliffordRz = StabVec

@ciaranra ciaranra force-pushed the study/tensor-network-clifford-rz branch 3 times, most recently from 25d3366 to 9c2f658 Compare April 18, 2026 04:08
…ugins

Comprehensive stabilizer tensor network simulation crate (exp/pecos-stab-tn)
plus Python/Selene integration and repo-wide naming cleanup.

## Naming (Stab{Variant} convention)
- CliffordRz → StabVec (sum of stabilizer states)
- Stn/CliffordMps → StabMps (stabilizer tableau + MPS)
- S/Sdg → SZ/SZdg in enums
- Selene plugins: pecos-selene-stab-vec, pecos-selene-stab-mps, pecos-selene-mast

## StabMps simulator (exp/pecos-stab-tn)
- Hybrid stabilizer-tableau + MPS for Clifford+rotation circuits
- MAST magic state injection (deferred ancilla projection)
- Lazy virtual-frame measurement with DeferredOp queue
- Pauli frame tracking (Y-direct rep, exact decomposition-based flush)
- merge_rz: same-qubit RZ batching with Clifford commutation
- QEC API: reset_qubit, pz/px, extract_syndromes, inject_paulis_in_frame
- Builder: for_qec() preset, auto_grow_bond_dim, pauli_frame_tracking
- Diagnostics: pragmatic_drift_count, is_state_exact, StabMpsStats, OFD nullity
- 238 lib tests + 81 verification tests (tiered: quick + ignored deep fuzz)

## Python bindings (python/pecos-rslib-exp)
- PyO3/maturin: StabMps and Mast classes
- Gate dispatch (run_gate/run_1q_gate/run_2q_gate), QEC helpers
- Qubit bounds checking on all methods

## Selene plugins
- pecos-selene-stab-mps, pecos-selene-mast: SimulatorInterface impls
- Conformance tests pass
- Added to CI workflow matrix, Justfile, workspace configs

## Merge reconciliation
- QuantumSimulator::num_qubits() added to all impls across repo
- StabilizerTableauSimulator stale num_qubits removed
- ForeignSimulator/PyForeignSimulator: num_qubits threaded through FFI

## Code quality
- Zero clippy warnings, zero rustc warnings
- All .unwrap() in production code replaced with .expect()
- design/ docs stubbed (moved to pecos-docs vault)
- Python backward-compat aliases: CliffordRz = StabVec
@ciaranra ciaranra force-pushed the study/tensor-network-clifford-rz branch from 9c2f658 to 8594f89 Compare April 18, 2026 04:13
@ciaranra ciaranra marked this pull request as ready for review April 18, 2026 14:56
@ciaranra ciaranra merged commit 0ab008f into dev Apr 18, 2026
99 checks passed
@ciaranra ciaranra deleted the study/tensor-network-clifford-rz branch April 18, 2026 14:57
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