Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 08 Apr 06:38
· 25 commits to master since this release
eaa6f69

Added

  • Noise Model Module: Added graphqomb.noise_model for event-driven noise injection during Stim compilation

    • Added NoiseModel hooks for on_prepare, on_entangle, on_measure, and on_idle
    • Added frozen, validated NoiseOp dataclasses: PauliChannel1, PauliChannel2, HeraldedPauliChannel1, HeraldedErase, RawStimOp, MeasurementFlip
    • Added event dataclasses PrepareEvent, EntangleEvent, MeasureEvent, IdleEvent, plus NodeInfo and Coordinate
    • Added NoisePlacement, noise_op_to_stim(), depolarize1_probs(), and depolarize2_probs()
  • Built-in Noise Models: Ready-to-use noise model implementations

    • Added DepolarizingNoiseModel for single and two-qubit depolarizing noise
    • Added MeasurementFlipNoiseModel for measurement bit-flip errors using Stim's built-in MX(p) syntax
  • Stim Compiler Noise Integration: Added noise-model-driven Stim compilation

    • Support for multiple noise models via Sequence[NoiseModel]
    • Added tick_duration parameter for idle noise calculations
    • Automatic measurement record tracking for heralded noise operations when emitting detectors and observables
  • Greedy Scheduler: Fast greedy scheduling algorithms as an alternative to CP-SAT optimization

    • Added greedy_minimize_time() for minimal execution time scheduling with ALAP preparation optimization
    • Added greedy_minimize_space() for minimal qubit usage scheduling
  • Schedule Solver: Added constraint that every non-input, non-output node must be prepared strictly before it is measured (node2prep[node] < node2meas[node])

  • Circuit Conversion: Added circuit-derived pre-scheduling support in circuit2graph().

    • Added CircuitScheduleStrategy with PARALLEL and MINIMIZE_SPACE.
    • Added schedule_strategy argument to circuit2graph().
    • circuit2graph() now returns (graph, gflow, scheduler) and pre-populates Scheduler via manual scheduling.
  • PyZX Integration: Added optional graphqomb.zx_util utilities for importing strict graph-like PyZX diagrams into GraphState.

    • Added from_pyzx() to convert PyZX diagrams into a GraphState.
    • Added boundary rewriting and metadata import helpers to preserve graph structure, measurement bases, and coordinates during conversion.
    • Added optional phase-gadget recognition for supported lone-Z gadget patterns via recognize_pg=True, importing the adjacent node as a YZ-plane measurement.
  • Documentation: Added comprehensive Sphinx documentation for the noise model module

Changed

  • Stim Compiler API: stim_compile() now has signature stim_compile(pattern, *, emit_qubit_coords=True, noise_models=None, tick_duration=1.0)
  • Stim Compiler: Refactored internal structure to support event-driven noise model integration
  • Measurement Flip Semantics: MeasurementFlipNoiseModel and custom MeasurementFlip ops now compile to Stim's native MX(p) / MY(p) / MZ(p) instructions instead of emitting separate Pauli error instructions
  • Noise Extension API: NoiseOp values are now represented as plain frozen dataclasses collected under the NoiseOp union, improving type safety for custom NoiseModel implementations
  • Noise Validation: Centralized noise parameter validation in noise_model
    • NoiseOp dataclasses now validate and normalize their inputs at construction time
    • DepolarizingNoiseModel and MeasurementFlipNoiseModel now reject invalid probabilities when instantiated
    • MeasurementFlip is now enforced as a measurement-only noise operation during Stim compilation
  • Graph State: Made meas_bases read-only by returning MappingProxyType to avoid external mutation.
  • Graph State: Added caching for physical_nodes snapshots and proper cache invalidation on node add/remove.
  • Docs/Examples: Updated circuit conversion usage in README and examples/pattern_from_circuit.py for the new circuit2graph() return signature.
  • Packaging/Docs: Added the optional graphqomb[pyzx] extra, documented PyZX installation in the README, and published Sphinx API reference pages for graphqomb.zx_util.
  • CI: Split PyZX-marked tests into a dedicated GitHub Actions job and installed the optional dependency in coverage runs.

Fixed

  • Stim Compiler: Detector and observable record indices now stay aligned when noise models emit heralded instructions that add measurement records
  • Feedforward: Fixed operator precedence bug in dag_from_flow where self-loops were only removed from zflow but not from xflow. The expression xflow | zflow - {node} was evaluated as xflow | (zflow - {node}) due to - binding tighter than |. Corrected to (xflow | zflow) - {node}.

Tests

  • Noise Model / Stim Compiler: Added comprehensive tests for graphqomb.noise_model and noise-aware stim_compile(), including heralded record tracking, MeasurementFlip validation, and removed legacy kwargs
  • Greedy Scheduler: Added tests for greedy scheduling algorithms
  • Schedule Solver: Added integration test verifying that CP-SAT MINIMIZE_SPACE strategy enforces node preparation before measurement
  • Circuit Conversion: Expanded scheduling tests in tests/test_circuit.py, including scheduler return contract, J/CZ/phase-gadget timing behavior, schedule validation, and MINIMIZE_SPACE behavior.
  • Integration: Added circuit-level integration tests for signal_shifting() and pauli_simplification() with circuit-vs-pattern statevector equivalence checks.
  • Stim Compiler / Pauli Frame: Updated tests to explicitly pass parity-check groups where logical-observable and cache initialization paths are exercised.
  • PyZX Integration: Added unit tests for vertex/edge collection, boundary rewrites, lone-spider phase-gadget recognition, and end-to-end from_pyzx() conversion behavior.

Removed

  • Stim Compiler Legacy Noise Args: Removed p_depol_after_clifford and p_before_meas_flip from stim_compile()
    • Use noise_models=[DepolarizingNoiseModel(...), MeasurementFlipNoiseModel(...)] instead