Repository navigation
Conversation
…sureZ with deprecated aliases
…s, outcomes and RNG use
…eadout matrices to GeneralNoiseModel
# Conflicts: # crates/pecos-core/src/gate_type.rs # crates/pecos-core/src/gates.rs # crates/pecos-core/src/unitary_rep.rs # crates/pecos-engines/src/byte_message/builder.rs # crates/pecos-engines/src/noise/biased_depolarizing.rs # crates/pecos-engines/src/noise/depolarizing.rs # crates/pecos-engines/src/noise/general.rs # crates/pecos-engines/src/quantum.rs # crates/pecos-engines/src/scheduled_frame.rs # crates/pecos-qasm/src/engine.rs # crates/pecos-qasm/src/parser/native_gates.rs # crates/pecos-qec/src/fault_tolerance/circuit_definitions/tests.rs # crates/pecos-qec/src/fault_tolerance/dem_builder/builder.rs # crates/pecos-qec/src/fault_tolerance/fault_sampler.rs # crates/pecos-qec/src/fault_tolerance/gadget_checker.rs # crates/pecos-qec/src/fault_tolerance/influence_builder.rs # crates/pecos-qec/src/fault_tolerance/pauli_frame.rs # crates/pecos-qec/src/fault_tolerance/pauli_prop_checker.rs # crates/pecos-qec/src/fault_tolerance/propagator.rs # crates/pecos-qec/src/fault_tolerance/propagator/pauli.rs # crates/pecos-qec/tests/fault_catalog_definitions.rs # crates/pecos-qec/tests/symbolic_hidden_sources_tests.rs # crates/pecos-qis/src/ccengine.rs # crates/pecos-quantum/src/circuit_display.rs # crates/pecos-quantum/src/dag_circuit.rs # crates/pecos-quantum/src/tick_circuit.rs # crates/pecos-quantum/src/unitary_matrix.rs # crates/pecos-quantum/tests/diagonal_gates.rs # crates/pecos-selene-general-noise-adapter/src/simulator.rs # docs/releases/changelog.md # exp/pecos-eeg/src/coherent_dem.rs # exp/pecos-eeg/src/expand.rs # exp/pecos-eeg/src/heisenberg.rs # exp/pecos-eeg/src/noise_compression.rs # exp/pecos-experimental/src/symbolic_executor.rs # exp/pecos-experimental/src/symbolic_reference.rs # exp/pecos-neo/src/inline_channel.rs # exp/pecos-stab-active/src/heisenberg/tests.rs # python/pecos-rslib/src/gate_registry_bindings.rs # python/quantum-pecos/tests/qec/test_tick_circuit_gate_classification.py
…e general-noise plugin setter parity test.
# Conflicts: # docs/releases/changelog.md
…led errors, readout errors, and duplicate JSON keys.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #1642 (the
MeasureZrename, merged). This is the first part of adding qubit loss toGeneralNoiseModel. It adds the measurement gates and readout configuration that loss needs, without any loss state yet.What changes
An invariance test for
GeneralNoiseModel(first commit).crates/pecos-engines/tests/general_noise_invariance.rsdrives 17 feature-specific scenarios by hand throughstart/continue_processing. It compares each simulator round trip's commands, the final outcomes, and the next fouru64from a clone of the model RNG against golden files intests/fixtures/general_noise_invariance/. It pins today's behaviour, so later loss work can show that runs with loss disabled stay bit-identical. Fixtures are regenerated only withPECOS_UPDATE_GENERAL_NOISE_FIXTURE=1; a missing fixture is a failure.Two herald gates.
GateType::MeasureZLost(wire value 108, outcomes{0, 1, 3}) andGateType::MeasureZLeakedLost(109,{0, 1, 2, 3}), where 2 means leaked and 3 means lost. LikeMeasureZLeaked, they are record-less Z measurements;GateType::is_recordless_z_measurementnames the three heralds. Sites that classify gates as Z measurements treat them alike: core metadata, simulators and engines, the depolarizing models, circuit display (MLo,MLL), DAG/tick circuits, QEC propagators and fault samplers, QASM, and the experimental crates. Consumers that cannot represent them reject them by name: the runtime-frame and scheduled wire tables,ScheduledBackend, EEG expansion, and the neo conversions. In QEC fault analysis a herald is a collapse with no record: it takes X-only Pauli faults and no measurement-flip mechanism, matchingFaultCatalog. Without loss configured,MeasureZLostreads exactly likeMZandMeasureZLeakedLostexactly likeMeasureZLeaked.Per-flavor readout matrices.
ReadoutMatrix::new(flavor, rows)andGeneralNoiseModelBuilder::with_readout, JSONmeasurement.readout, and Pythonwith_readout(gate_name, rows). These configure, for each Z-measurement flavor (MZ,MeasureZLeaked,MeasureZLost,MeasureZLeakedLost;MPZusesMZ's), the outcome distribution for each true state (0,1,leaked):p_meas_0/p_meas_1behaviour and draws.MZforMZandMPZ).lostrow is accepted by the constructor but rejected at build until qubit loss exists.RuntimeNoise, and the Selene general-noise adapter reject models with configured readout, because those paths do not implement it.Error text. The unsupported runtime-frame and scheduled gate errors now append the gate name after their existing prefix. Scheduled errors for
MeasureZLostandMeasureZLeakedLostsuggestMeasureZLeaked(which cannot herald loss) or a non-scheduled engine.ReadoutMatrixexports.ReadoutMatrixis re-exported from thepecos-enginesprelude andpecos::noise.Docs: a "Readout matrices" section in
docs/user-guide/noise-model-builders.mdand changelog entries.Fixes from review
A multi-model review of the first version found pre-existing defects on paths the heralds reach. They are fixed here, each with a regression test:
QAlloc, herald collapses, and Clifford-angle rotations (RX/RY/RZ/RXX/RYY/RZZ/U). This fixes wrongFaultCheckerresults on those circuits.LookupDecoderchoose custom Pauli weights by gate kind, so p1 weights no longer scale or zero preparation and MZ noise, and heralds and transparent gates get no p1 noise. Batched DAG nodes are split into independent per-qubit or per-pair channels.PerGateTypeNoise::to_neo_channelreturns an error for an unmapped gate instead of panicking.GeneralNoiseConfigJSON rejects duplicate object keys at any depth. Readout parse errors name the flavor, row and column, and JSON and Python share one flavor parser. In JSON, an explicitnullon an optional parameter means unset; the user guide says which fields rejectnull.Not in this PR
Qubit-loss state, the
lossconfig section, recovery and loss spreading, and the semantics oflostrows come in the next part.Verification
just rstest,just python-ci-lint,just python-ci-core,just docs-test, pre-commit,just build-seleneand the Selene plugin tests (177 passed) pass locally on the final tree. Rust lanes ran pinned to the machine's E-cores to avoid a known host-local flake insparse_stab_oracle.crates/pecos/tests/general_noise_readout_statistics.rsuse Jeffreys intervals (alpha 1e-6, n = 20000, fixed seed).f64bit patterns); the cross-platform CI run is the check for that.