Core
Tableau, simulator, Pauli and circuit basics
29/29 passed in 296ms
| Test | What it does | Result |
|---|---|---|
test_version | import qliff works and its version matches Cargo.toml [package]. | ✅ pass |
test_gate_groups | Gates map stabilizer groups: |0>, |000>, H, S, Z, Y, S_DAG, Bell, GHZ via flattened CX pairs, CZ on |++>, SWAP. | ✅ pass |
test_random_clifford_inverse | A random Clifford followed by its inverse returns to |0...0>. | ✅ pass |
test_bad_targets | Out-of-range qubits, a repeated or unpaired CX target, a wrong-width Pauli and a record before any measurement raise ValueError. | ✅ pass |
test_fidelity | fidelity: a Bell state and its copy 1, |Phi+> vs |Phi-> 0, |0> vs |+> 0.5. | ✅ pass |
test_measure_pauli | measure() of ZZ and XX on a Bell state is a deterministic +1; XX on |00> is a coin flip. | ✅ pass |
test_reset | R and MR leave |0>, MR reports the value before the reset, and the qubit is reusable. | ✅ pass |
test_teleport | Teleporting |0>, |1>, |+>, |-> through a Bell pair gives <Z> or <X> = +-1 on q2. | ✅ pass |
test_bell_correlation | Bell-pair outcomes are perfectly correlated. | ✅ pass |
test_composite_gates | SX, SX_DAG, MX, MY and MZ act as their primitive sequences on a Simulator and on a Circuit (method or append by name); each basis measurement records one bit. | ✅ pass |
test_ghz_statistics | GHZ_3 collapses only to 000 or 111, about 50:50. | ✅ pass |
test_plus_statistics | |+> measures 0/1 about 50:50. | ✅ pass |
test_record | |0> measures 0, X|0> measures 1, and the record keeps call order. | ✅ pass |
test_repeatable | Measuring the same qubit twice agrees. | ✅ pass |
test_peek | peek: <Z> = +1 on |0>, -1 on |1>, 0 on |+>; <X> = +1 on |+>, -1 on |->; a '-' prefix flips it; Bell <YY> = -1, <ZI> = 0; a PauliString argument works, and qliff.expectation agrees. | ✅ pass |
test_commutation | X and Z anticommute; XX and ZZ commute. | ✅ pass |
test_from_sparse | from_sparse places single-qubit Paulis. | ✅ pass |
test_parse_repr_roundtrip | Parsing then repr is the identity for signed Paulis. | ✅ pass |
test_product | Products track the i phase: XY = +iZ, YX = -iZ, Z*Z = +I, (-X)*Y = -iZ; the identity is neutral. | ✅ pass |
test_bell_matches_direct | A Bell circuit reproduces the directly-built Bell state. | ✅ pass |
test_custom_channel_round_trips | A custom Channel added via noise() is sampled like a built-in one. | ✅ pass |
test_fluent_matches_append | Fluent gate methods build the same instructions as append. | ✅ pass |
test_infers_num_qubits | num_qubits grows to cover the targets used. | ✅ pass |
test_reproducible_with_seed | The same seed gives the same measurement record. | ✅ pass |
test_reset_collapses_partner | Sampling H(0) CX(0,1) R(0) M(1) reads 1 on about half the shots: the reset collapses the Bell partner at random. | ✅ pass |
test_run_rejects_noise | run() is for noiseless circuits and raises on a noise instruction. | ✅ pass |
test_deferred_records | The per-shot core buffers measurements: a gate on a buffered qubit flushes it first (X; MR resets q0, so the CX flips nothing), and buffered MRs survive a gate elsewhere, so every record matches the eager order. | ✅ pass |
test_sample_batch_reproducible | The per-shot core is deterministic in its seed. | ✅ pass |
test_signed_reset_branch_and_sign | A hand-built signed {I, -Z, R} table resets q0 on its R branch and gives both signs, |weight| = gamma = 1.1 and mean weight ~ 0.9. | ✅ pass |