Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b86c91b
Merge pull request #2 from microsoft/main
marcusps Jun 14, 2026
bf45784
Merge branch 'microsoft:main' into main
marcusps Jun 26, 2026
f64956f
Merge branch 'microsoft:main' into main
marcusps Jun 26, 2026
4075af7
Add phased outcome-complete simulation (arXiv:2603.24717, Alg. 4.2)
marcusps Jun 27, 2026
de8e503
Add example notebook for phased outcome-complete simulation
marcusps Jun 27, 2026
5b0a15c
Add example notebook for verifying symbolic-rotation circuits
marcusps Jun 27, 2026
86dc587
Add phase-aware Choi comparison (PhasedCircuitAction) and expose in P…
marcusps Jun 27, 2026
cd49990
Add symbolic-angle provenance and measurement-based ejection to phase…
marcusps Jun 27, 2026
c8d775c
Add X-basis ejection tests (Hadamard dual of the Z-basis gadget)
marcusps Jun 27, 2026
bd103ca
test(pauliverse): extend ejection to general diagonal channels
marcusps Jun 27, 2026
18aa84f
test(pauliverse): demonstrate Section 4.1 circuit-equivalence verific…
marcusps Jun 27, 2026
75c53e1
Add high-level symbolic-pauli-exp API and hide rotation internals
marcusps Jun 27, 2026
48d3192
Make symbolic angles opaque handles indexed by allocation order
marcusps Jun 28, 2026
ddf7e85
Address code-review findings (M1 docs, M2 clean exception, L1 termino…
marcusps Jun 28, 2026
76d8f7f
test(pauliverse): negative + randomized phased equivalence tests
marcusps Jun 29, 2026
91ffaef
Document PhasedOutcomeCompleteSimulation in top-level and Python READMEs
marcusps Jul 5, 2026
3184fbc
test: use descriptive identifiers in phased dense-oracle tests
marcusps Jul 8, 2026
ab1106f
test(paulimer): cover PhasedOutcomeCompleteSimulation in shared simul…
marcusps Jul 8, 2026
742a1ce
Add exact Clifford to pi/4 Pauli-exponent decomposition
marcusps Jun 28, 2026
521e3e9
Document Clifford to pi/4 Pauli-exponent decomposition in READMEs
marcusps Jul 5, 2026
7d9e479
Merge branch 'microsoft:main' into main
marcusps Jul 9, 2026
e666cce
Merge branch 'microsoft:main' into main
marcusps Jul 12, 2026
f6e8494
Merge branch 'microsoft:main' into main
marcusps Jul 15, 2026
6d591c8
Fix lost Python test boundary found in code review
Jul 17, 2026
9effd0c
Fix stale section citation found in code review
Jul 17, 2026
ef8f678
Apply cargo fmt
marcusps Jul 18, 2026
fbe939c
fix(paulimer): satisfy clippy::semicolon_if_nothing_returned in phase…
marcusps Jul 18, 2026
8858fdb
Merge remote-tracking branch 'marcusps/masilv/phased-outcome-complete…
marcusps Jul 18, 2026
5fba7cf
Apply cargo fmt to Clifford decomposition files
marcusps Jul 18, 2026
218d7dc
test(pauliverse): add Hadamard-conjugation equivalences and clarify e…
marcusps Jul 18, 2026
5e18367
Merge branch 'masilv/phased-outcome-complete-sim' into masilv/cliffor…
marcusps Jul 18, 2026
920bcf5
test: unify dense-statevector oracle into shared dense-oracle crate
Jul 23, 2026
9eea57e
fix(pauliverse): correct measure_with_hint outcome sign for negative …
Jul 23, 2026
66daf20
Merge remote-tracking branch 'public-origin/main' into masilv/phased-…
Jul 23, 2026
30114bb
Merge branch 'microsoft:main' into main
marcusps Jul 23, 2026
190ab19
Merge branch 'main' into masilv/phased-outcome-complete-sim
marcusps Jul 23, 2026
65e8b84
Merge remote-tracking branch 'public-origin/main' into masilv/phased-…
Jul 23, 2026
19ed4db
Merge remote-tracking branch 'public-origin/masilv/phased-outcome-com…
Jul 23, 2026
6fda1ca
Update pauliverse/tests/phased_outcome_complete_dense.rs
marcusps Jul 24, 2026
b38bc78
Update pauliverse/tests/phased_outcome_complete_dense.rs
marcusps Jul 24, 2026
79e4d69
Relocate dense-oracle to test-utils and modernize its complex arithmetic
Jul 24, 2026
786b0a7
Simplify phased_clifford bit iteration
Jul 24, 2026
a7bd312
Rewrite phased_clifford_dense as a proptest
Jul 24, 2026
c6f5c8e
Deduplicate phased action construction
Jul 24, 2026
4b946c0
Reuse PhaseData::phase_exponent for output_phase_exponent
Jul 24, 2026
19f5562
Tidy random-bit iteration in phased_outcome_complete_dense
Jul 24, 2026
fc455bf
Rewrite measure_with_hint_sign_test as a proptest
Jul 24, 2026
0d5631b
Drop checked-in proptest regression seeds
Jul 24, 2026
6fe3f9b
Restore .gitignore
Jul 24, 2026
926e34d
Silence redundant_closure_for_method_calls in dense-oracle
Jul 24, 2026
33d8259
Extract shared phase_form_exponent helper (jmbr)
Jul 24, 2026
698bab0
Merge branch 'microsoft:main' into masilv/clifford-pauli-exp-decomp
marcusps Jul 24, 2026
db2dca7
Merge phased-outcome-complete-sim (PR #115) into clifford-pauli-exp-d…
Jul 24, 2026
c34f48b
Tidy clifford decomposition: derive qubit count, doc the algorithm
Jul 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"paulimer",
"paulimer/bindings/python",
"pauliverse",
"test-utils/dense-oracle",
"deq/deq_runtime",
"deq/deq_decoder_abi",
"deq/deq_decoder_abi/reference_plugin",
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This repository contains several interconnected crates:

- [binar](binar): A high-performance bit manipulation library providing bit vectors, bit matrices, and bitwise operations over GF(2).
- [paulimer](paulimer): A library for Pauli operators and Clifford gates, built on binar.
- [pauliverse](pauliverse): Fast stabilizer simulators.
- [pauliverse](pauliverse): Fast stabilizer simulators, including exact global-phase tracking (`PhasedOutcomeCompleteSimulation`) for verifying parameterised circuits.
- [deq](deq): A dynamic and generic QEC decoding system, including the `.deq` DSL, transpiler, JIT runtime (Rust), CLI, and an anywidget-based visualizer.

### Python Bindings
Expand Down Expand Up @@ -136,6 +136,26 @@ let image = clifford.image(&x0);
assert_eq!(image, "XX".parse::<DensePauli>().unwrap());
```

### Stabilizer Simulation (pauliverse)

```rust
use pauliverse::{PhasedOutcomeCompleteSimulation, Simulation};
use paulimer::{SparsePauli, UnitaryOp};

// Track the exact global phase while simulating all measurement-outcome branches.
let mut sim = PhasedOutcomeCompleteSimulation::new(2);
sim.unitary_op(UnitaryOp::Hadamard, &[0]);
sim.unitary_op(UnitaryOp::Hadamard, &[1]);

// Apply a symbolic rotation e^{i·alpha·Z0Z1} around a higher-weight (two-qubit) Pauli.
let alpha = sim.allocate_symbolic_angle();
sim.symbolic_pauli_exp(&"Z0 Z1".parse::<SparsePauli>().unwrap(), alpha);
```

The phase-aware `phased_action` of two circuits can then be compared for exact equality — see the
[pauliverse README](pauliverse/README.md) and the Python
[example notebooks](paulimer/bindings/python/examples).

## Benchmarks

This repository uses [Criterion](https://github.com/bheisler/criterion.rs) for Rust benchmarks and [ASV](https://asv.readthedocs.io/) for Python benchmarks.
Expand Down
1 change: 1 addition & 0 deletions paulimer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ criterion = { version = "0.5", features = ["html_reports"] }
proptest = "1.0"
serde_json = "1.0"
jsonschema = { version = "0.29" }
dense-oracle = { path = "../test-utils/dense-oracle" }

[[bench]]
name = "pauli_benchmark"
Expand Down
13 changes: 13 additions & 0 deletions paulimer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ the building blocks for stabilizer quantum mechanics and quantum error correctio
- **Clifford Unitaries**: Efficient representation enabling fast operations
- [`CliffordUnitary`]: O(n²) Pauli conjugation via binary symplectic matrix
- Supports all standard Clifford gates (H, S, CNOT, etc.)
- [`clifford_to_pauli_exponents`]: exact decomposition into `π/4` Pauli exponents (the full
tableau, including image signs), so replaying it with exact phase tracking yields a well-defined
global phase

Based on algorithms from [arXiv:2309.08676](https://arxiv.org/abs/2309.08676).

Expand Down Expand Up @@ -94,6 +97,15 @@ assert_eq!(image, "XX".parse::<DensePauli>().unwrap());
let mut circuit = CliffordUnitary::identity(2);
circuit.left_mul(UnitaryOp::Hadamard, &[0]);
circuit.left_mul(UnitaryOp::ControlledX, &[0, 1]);

// Decompose a Clifford into an ordered product of π/4 Pauli exponents (exact, sign-preserving)
use paulimer::clifford::clifford_to_pauli_exponents;
let exponents = clifford_to_pauli_exponents(&circuit);
let mut rebuilt = CliffordUnitary::identity(2);
for pauli in &exponents {
rebuilt.left_mul_pauli_exp(pauli);
}
assert_eq!(rebuilt, circuit);
```

## When to Use Each Type
Expand Down Expand Up @@ -171,6 +183,7 @@ Key documentation:
- [`SparsePauli`](src/pauli/sparse.rs) - Sparse Pauli representation for large systems
- [`PauliGroup`](src/pauli_group.rs) - Subgroup operations and stabilizer groups
- [`CliffordUnitary`](src/clifford.rs) - Clifford gates and Pauli conjugation
- [`clifford_to_pauli_exponents`](src/clifford/decomposition.rs) - Exact decomposition of a Clifford into `π/4` Pauli exponents
- [Trait documentation](src/lib.rs) - `Pauli`, `Clifford`, and other core traits

## Contributing
Expand Down
57 changes: 56 additions & 1 deletion paulimer/bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,71 @@ sim.apply_unitary(paulimer.UnitaryOpcode.ControlledX, [0, 1])
sim.measure(paulimer.SparsePauli("Z0"))
```

### Verifying parameterised circuits with symbolic angles

`PhasedOutcomeCompleteSimulation` tracks the exact global phase, so two circuits that share the same
free rotation angles can be checked for exact equality — even for exponents of higher-weight Paulis:

```python
from paulimer import PhasedOutcomeCompleteSimulation, SparsePauli, UnitaryOpcode


def prepared_action(build):
sim = PhasedOutcomeCompleteSimulation(2)
for qubit in range(2):
sim.apply_unitary(UnitaryOpcode.Hadamard, [qubit]) # |++>
build(sim)
return sim.phased_action([], [0, 1]) # state-preparation action


def direct(sim): # e^{i alpha Z0 Z1} |++>
alpha = sim.allocate_symbolic_angle()
sim.apply_symbolic_pauli_exp(SparsePauli("Z_0 Z_1"), alpha)


def conjugated(sim): # CNOT . e^{i alpha Z1} . CNOT |++>
sim.apply_unitary(UnitaryOpcode.ControlledX, [0, 1])
alpha = sim.allocate_symbolic_angle()
sim.apply_symbolic_pauli_exp(SparsePauli("Z_1"), alpha)
sim.apply_unitary(UnitaryOpcode.ControlledX, [0, 1])


assert prepared_action(direct).is_equivalent(prepared_action(conjugated))
```

### Decomposing a Clifford into pi/4 Pauli exponents

`CliffordUnitary.to_pauli_exponents()` returns an ordered product of `pi/4` Pauli exponents that
reproduces the Clifford exactly, including the Pauli-image signs — so replaying it with exact phase
tracking yields a well-defined global phase:

```python
from paulimer import CliffordUnitary, UnitaryOpcode

clifford = CliffordUnitary.identity(2)
clifford.left_mul(UnitaryOpcode.Hadamard, [0])
clifford.left_mul(UnitaryOpcode.ControlledX, [0, 1])

exponents = clifford.to_pauli_exponents() # list[SparsePauli], each factor exp(+-i pi/4 P)

rebuilt = CliffordUnitary.identity(2)
for pauli in exponents:
rebuilt.left_mul_pauli_exp(pauli)
assert rebuilt == clifford
```

## Features

- **DensePauli / SparsePauli** - Pauli operators with phase tracking and multiplication
- **CliffordUnitary** - Clifford gates with conjugation and composition
(including `to_pauli_exponents()`, an exact decomposition into `pi/4` Pauli exponents)
- **PauliGroup** - Group operations including membership testing and factorization
- **Stabilizer Simulation** - Noiseless (OutcomeComplete, OutcomeFree, OutcomeSpecific) and noisy (Faulty) modes
- **PhasedOutcomeCompleteSimulation** - Outcome-complete simulation that additionally tracks the exact global phase, enabling exact equality checking of parameterised (symbolic-angle) circuits

## Use Cases

Designed for quantum error correction research, including stabilizer circuit analysis and Clifford circuit verification.
Designed for quantum error correction research, including stabilizer circuit analysis and Clifford circuit verification. `PhasedOutcomeCompleteSimulation` extends this to exact verification of non-stabilizer circuits built from symbolic Pauli rotations `e^{i alpha P}`.

## Performance

Expand Down
Loading
Loading