Skip to content

Releases: TeamGraphix/graphqomb

v0.4.1

Choose a tag to compare

@github-actions github-actions released this 20 Jul 13:10
455df96

Added

  • Stim Clifford Parser: Added graphqomb.stim_parser for normalizing Stim Clifford circuits to the Clifford J/CZ basis: H = J(0), HS = J(pi/2) (Stim C_XNYZ), HZ = J(pi) (Stim SQRT_Y), and HS_DAG = J(-pi/2) (Stim C_XYZ), corresponding to X+/Y+/X-/Y- measurements. The parser covers fixed one- and two-qubit Clifford gates, SPP/SPP_DAG, nested repeats, R/RX/RY and M/MX/MY boundaries, preserved record/annotation instructions, and detailed rejection of unsupported instructions. Optimization canonicalizes every single-qubit gate run to its shortest word over the four J gates (at most three per single-qubit Clifford), cancels redundant CZ pairs, and folds gates at those Pauli reset and measurement boundaries.

Changed

  • Stim Circuit Import: Normalize reset/unitary TICK blocks through the new Stim parser before circuit analysis, folding leading Clifford gates into Pauli input initialization, expanding accepted Clifford gates, and removing identity blocks such as repeated CZ pairs without advancing their temporal coordinate.

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 19 Jul 20:08
909cd68

Added

  • QEC Stim MPP Import: Added utilities for building StabilizerCode inputs from unsigned Stim MPP layers, including sparse Stim qubit id mapping, coordinate import, multi-layer selection, detector/logical-observable import, and the optional graphqomb[stim] extra. Signed products using inverted Pauli targets are rejected because stabilizer signs are not retained.
  • Stim Circuit Import: Added stim_file_to_pattern(), stim_text_to_pattern(), and stim_circuit_to_pattern() for converting supported Stim circuits into GraphQOMB patterns. The importer handles initial Pauli resets (R/RZ, RX, and RY), Clifford unitary blocks, and TICK-separated Pauli measurements (M/MZ, MX, MY, MXX, MYY, MZZ, and MPP), assigns single-qubit measurement bases directly to their graph nodes, terminates each qubit lifetime at its direct measurement while allowing disjoint qubits to continue, validates that same-block MPP products commute, supports Type I and Type II Y foliation, keeps MPP ancilla nodes out of the X-correction flow, derives the complete Z-correction flow from the composed data flow without Pauli simplification, places gate and MPP blocks on explicit temporal Z layers while preserving the first two Stim coordinate components, aligns parallel gate outputs across different transpiled depths, relocates idle I/O nodes without adding graph nodes or edges, and resolves detector/logical-observable records once across the full flattened circuit. Circuit-level noise and measurement-error probabilities are intentionally omitted because GraphQOMB uses an MBQC-specific noise model; mid-circuit reset, measurement-reset, and feedback instructions remain unsupported.
  • Input Initialization Bases: Added per-input positive Pauli eigenstate initialization via GraphState.register_input(..., init_axis=...), with X+, Y+, and Z+ propagated through qompile(), Pattern, PatternSimulator, and Stim export.

Changed

  • Development Tooling: Use uv as the default dependency manager for local development, CI, documentation builds, and publishing workflows.
  • Graph State API: Replaced legacy physical_* graph methods/properties with standard graph-style nodes, edges, add_node(), add_edge(), remove_node(), remove_edge(), and count/query helpers.
  • Pattern Simulator: Materialize pending output Pauli-frame corrections when returning output statevectors or explicit output measurement results.
  • Pattern Simulator: Sample all measurements from exact Born probabilities by default, with calc_prob=False retaining the legacy 50/50 assumption for non-output measurements.
  • PTN Format: Bumped exported .ptn files to format version 2 to record non-default input initialization bases with .input_basis; version 1 files remain readable and default inputs to X+.
  • Stim Compiler: Input reset instructions now follow the stored initialization basis (RX, RY, or R) while non-input preparations remain RX.
  • Stim Coordinate Import: Reject QUBIT_COORDS whose first two components collide across qubits, because graph nodes are placed by the XY projection and colliding projections produce coincident nodes.

Fixed

  • Pattern Simulator: Raise TypeError for unsupported commands instead of recursively redispatching them.
  • QEC Graph-State Builder: Add the required ancilla CZ edge when shared data qubits contain an odd number of oppositely ordered stabilizer-interaction pairs, using the same Z-before-Y-before-X rule for Type I and Type II foliation.
  • Stim Circuit Import: Preserve the existing data-lane endpoint and its coordinate when importing a terminal single-qubit measurement.
  • Stim Circuit Import Coordinates: Generate consistent 3D spacetime coordinates across gate, idle, and MPP fragments instead of mixing raw 2D gate coordinates with MPP Z layers.
  • Stim Compiler: Preserve minus-signed axis measurement bases using inverted Stim measurement targets.
  • State Vector Array Conversion: Convert to a real NumPy dtype without warnings when every amplitude is real-valued, and reject the conversion when it would discard nonzero imaginary amplitudes.

Removed

  • Pattern Commands: Removed explicit graphqomb.command.X and graphqomb.command.Z correction commands. Output corrections are now represented by PauliFrame only, and .ptn files containing X/Z command lines are rejected.

v0.3.1

Choose a tag to compare

@github-actions github-actions released this 17 May 17:52
2c5cb46

Added

  • PTN Format: Human-readable text format (.ptn) for pattern serialization
    • ptn_format.dumps() / ptn_format.dump(): Serialize patterns to text
    • ptn_format.loads() / ptn_format.load(): Deserialize patterns from text
    • Format separates quantum instructions and classical feedforward processing
    • Timeslice markers [n] indicate parallel execution groups
    • Pauli measurements use compact notation (X +, Y -, Z +)
    • Non-Pauli measurements use plane+angle format (XY pi/4)
    • Support for node coordinates, logical observables, and inline comments
  • Non-Unitary Parity Projection Example: Added examples/nonunitary_parity_projection.py demonstrating measurement-induced entanglement via a 3-node star graph parity projector

Fixed

  • Qompiler: qompile() now validates a provided scheduler before pattern generation, so invalid manual schedules fail early with ValueError.

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 08 Apr 06:38
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

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 21 Jan 09:18
ad07ddf

Added

  • Type Hints: Added py.typed marker for PEP 561 compliance, enabling type checkers (mypy, pyright) to recognize the package as typed when installed from PyPI.

Changed

  • Python Support: Dropped Python 3.9 support, added Python 3.14 support. Now requires Python >=3.10, <3.15.

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 08 Jan 15:03
20b0ad4

Added

  • TICK Command: Time slice boundary marker for temporal scheduling in MBQC patterns

    • Added TICK command type to mark boundaries between time slices
    • Integrated TICK command handling in PatternSimulator
    • Integrated TICK command processing in Stim compiler
  • Edge Scheduler: Automatic entanglement operation scheduling based on node preparation times (#99)

    • Added entangle_time attribute to Scheduler for tracking entanglement operation timing
    • Added auto_schedule_entanglement() method to automatically schedule CZ gates when both nodes are prepared
    • Extended the timeline property to include entanglement operations
    • Added entanglement time validation in schedule validation
    • Added compress_schedule() function to support entanglement time compression
  • Pattern: Added the depth attribute into Pattern, which represents the depth of parallel execution.

  • Pattern: Added pattern resource/throughput metrics (active_volume, volume, idle_times, throughput).

  • Scheduler Integration: Enhanced qompile() to support temporal scheduling with TICK commands

    • Added scheduler parameter to qompile() for custom scheduling
    • Automatically inserts TICK commands between time slices
  • Examples: Added entanglement_scheduling_demo.py demonstrating edge scheduler features

  • Feedforward Optimization: Added a signal_shifting method as a feedforward optimization.

    • This optimization is equivalent to the operation of the same name in the measurement calculus, and makes the measurement pattern as parallel as possible.
    • The optimization is now self-contained within the feedforward module.
  • Feedforward Optimization: Added pauli_simplification() to remove redundant Pauli corrections in correction maps when measuring in Pauli bases.

Changed

  • Pattern: Updated command sequence generation to support TICK commands
  • Command: Extended Command type alias to include TICK
  • The default strategy of Scheduler.solve_schedule is now MINIMIZE_TIME instead of MINIMIZE_SPACE for the compilation performance.

Fixed

  • Scheduler: Accept entangle_time edges in either order in Scheduler.manual_schedule().

Tests

  • Stim Compiler: Add coverage that manual entangle_time determines CZ time slices in both Pattern and Stim output.

v0.1.2

Choose a tag to compare

@github-actions github-actions released this 30 Oct 02:02
3fadeea

Added

  • Graph State: Bulk initialization methods for GraphState (#120)
    • Added from_graph() class method for direct graph-based initialization
    • Added from_base_graph_state() class method for initialization from base GraphState objects
    • Improved initialization flexibility for diverse use cases

Performance

  • Pauli Frame: Optimized _collect_dependent_chain method with memoization and caching
    • Added Pauli axis cache to avoid redundant basis computations
    • Implemented chain memoization cache to prevent recalculating dependent chains
    • Optimized set operations for better performance in large graph states

Tests

  • Pauli Frame: Added comprehensive test suite for PauliFrame module
    • Added tests for basic methods (x_flip, z_flip, meas_flip, children, parents)
    • Added tests for Pauli axis cache initialization and chain cache memoization
    • Added tests for dependent chain collection across X, Y, Z measurement axes
    • Added tests for detector groups and logical observables
    • Improved test coverage from 77.78% to 97% for pauli_frame.py
  • Graph State: Added comprehensive test suite for bulk initialization methods
    • Added tests for from_graph() initialization
    • Added tests for from_base_graph_state() initialization
    • Added tests for graph consistency and state equivalence

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 25 Oct 06:26
c2a052e

Added

  • Stim Compiler: Pattern to Stim circuit compiler with detector and observable support for fault-tolerant quantum computing (#67)
    • Compile MBQC patterns into Stim format for error correction analysis
    • Support for detectors, observables, and error models
    • Configurable depolarization noise after Clifford gates and measurements

Changed

  • Pauli Frame: Extended with detector and syndrome analysis capabilities
    • Added detector_groups for detector grouping
    • Added syndrome_parity_group for syndrome extraction
    • Added parity check grouping for X and Z corrections

Fixed

  • Fixed inverse flow construction to avoid self-loops
  • Fixed type hints in graphstate.compose for better type safety

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 23 Oct 00:48
30c1edb

Added

  • Core Infrastructure: Initial repository setup with project structure, build system, and CI/CD workflows (#12)
  • Mathematical Foundations: Euler angle computations for quantum operations (#24)
  • Graph State: Graph state representation and manipulation (#34)
  • Pattern Module: MBQC pattern data structures and operations (#47)
  • Feedforward System: Feedforward strategy design and implementation for adaptive measurements (#40)
  • Command Module: Measurement command definitions (#43)
  • Qompiler: Pattern compiler with Pauli frame implementation (#55)
  • Scheduler: Prepare time and measurement time scheduling for efficient execution (#74)
  • Circuit Framework: Quantum gate definitions and circuit representation (#73)
  • Simulation Backend: Statevector simulator backend for quantum state evolution (#62)
  • Pattern and Circuit Simulation: Complete simulation support for both patterns and circuits (#78)
  • Visualization: Basic visualizer for graph states and patterns (#83)
  • Documentation: Comprehensive documentation on Read the Docs (https://graphqomb.readthedocs.io/)