From 214dee85acb907df1329f00cd74f748e65c0d950 Mon Sep 17 00:00:00 2001 From: Thierry Martinez Date: Thu, 22 Jan 2026 19:54:20 +0100 Subject: [PATCH 1/8] Support Python 3.13 and Graphix new angle convention MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Support for Python 3.9 is dropped. Graphix angles are now in units of π (https://github.com/TeamGraphix/graphix/pull/399). --- graphix_ibmq/converter.py | 5 +++-- setup.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/graphix_ibmq/converter.py b/graphix_ibmq/converter.py index 243927a..25b8aa8 100644 --- a/graphix_ibmq/converter.py +++ b/graphix_ibmq/converter.py @@ -1,6 +1,7 @@ from __future__ import annotations from graphix import Circuit +from graphix.fundamentals import rad_to_angle from qiskit import QuantumCircuit, transpile @@ -28,9 +29,9 @@ def qiskit_to_graphix(qc: QuantumCircuit) -> Circuit: circuit.h(idx) for ci in qc.data: if ci.operation.name == "rx": - circuit.rx(ci.qubits[0]._index, ci.operation.params[0]) + circuit.rx(ci.qubits[0]._index, rad_to_angle(ci.operation.params[0])) elif ci.operation.name == "rz": - circuit.rz(ci.qubits[0]._index, ci.operation.params[0]) + circuit.rz(ci.qubits[0]._index, rad_to_angle(ci.operation.params[0])) elif ci.operation.name == "cx": circuit.cnot(ci.qubits[0]._index, ci.qubits[1]._index) else: diff --git a/setup.py b/setup.py index 8344a5a..ef19938 100644 --- a/setup.py +++ b/setup.py @@ -27,15 +27,15 @@ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Science/Research", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Topic :: Scientific/Engineering :: Physics", ], - "python_requires": ">=3.8,<3.13", + "python_requires": ">=3.10,<3.14", "install_requires": requirements, "extras_require": {"test": ["graphix"]}, } From f80d752ae0ef01747156f3eeac8be49a0a220c6e Mon Sep 17 00:00:00 2001 From: Thierry Martinez Date: Thu, 22 Jan 2026 20:11:07 +0100 Subject: [PATCH 2/8] `Pattern.extract_graph` replaced `Pattern.get_graph` --- examples/gallery/aer_sim.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/gallery/aer_sim.py b/examples/gallery/aer_sim.py index 2e01b70..1939e55 100644 --- a/examples/gallery/aer_sim.py +++ b/examples/gallery/aer_sim.py @@ -67,10 +67,7 @@ def swap(circuit, a, b): # transpile and plot the graph pattern = circuit.transpile().pattern -nodes, edges = pattern.get_graph() -g = nx.Graph() -g.add_nodes_from(nodes) -g.add_edges_from(edges) +g = pattern.extract_graph() np.random.seed(100) nx.draw(g) plt.show() From 269d695d038ea68ab9811e7ce9556f18ef574026 Mon Sep 17 00:00:00 2001 From: Thierry Martinez Date: Thu, 22 Jan 2026 20:59:30 +0100 Subject: [PATCH 3/8] Update CI workflow and pin graphix master --- .github/workflows/ci.yml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30cec2f..08f96db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'windows-2022', 'macos-latest'] - python: ['3.9', '3.10', '3.11', '3.12'] + python: ['3.10', '3.11', '3.12', '3.13'] name: "Python ${{ matrix.python }} / ${{ matrix.os }}" runs-on: ${{ matrix.os }} diff --git a/requirements.txt b/requirements.txt index ad46ef2..3ef4a7d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ numpy qiskit>=1.0,<2 qiskit_ibm_runtime qiskit-aer -graphix +graphix @ git+https://github.com/TeamGraphix/graphix.git From 869561dcf97ca08e791f2110205020d5e6e2ccaa Mon Sep 17 00:00:00 2001 From: Thierry Martinez Date: Fri, 13 Feb 2026 11:34:45 +0100 Subject: [PATCH 4/8] Fix for graphix#423 --- graphix_ibmq/compiler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/graphix_ibmq/compiler.py b/graphix_ibmq/compiler.py index 8751d4e..9cf718a 100644 --- a/graphix_ibmq/compiler.py +++ b/graphix_ibmq/compiler.py @@ -110,7 +110,8 @@ def _apply_e(self, cmd: E) -> None: def _apply_m(self, cmd: M) -> None: """Handles the M command: perform a measurement.""" - if cmd.plane != Plane.XY: + measurement = cmd.measurement.to_bloch() + if measurement.plane != Plane.XY: raise NotImplementedError("Non-XY plane measurements are not supported.") circ_idx = self._qubit_map[cmd.node] @@ -118,8 +119,8 @@ def _apply_m(self, cmd: M) -> None: self._apply_classical_feedforward("X", circ_idx, cmd.s_domain) self._apply_classical_feedforward("Z", circ_idx, cmd.t_domain) - if cmd.angle != 0: - self._circuit.p(-cmd.angle * np.pi, circ_idx) + if measurement.angle != 0: + self._circuit.p(-measurement.angle * np.pi, circ_idx) self._circuit.h(circ_idx) self._circuit.measure(circ_idx, self._next_creg_idx) From 20c28188e152c154d9009abc0a7fd1e5adc4d710 Mon Sep 17 00:00:00 2001 From: Thierry Martinez Date: Fri, 13 Feb 2026 14:02:33 +0100 Subject: [PATCH 5/8] Pin fix/181-pauli_plane_measurements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3ef4a7d..beaae77 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ numpy qiskit>=1.0,<2 qiskit_ibm_runtime qiskit-aer -graphix @ git+https://github.com/TeamGraphix/graphix.git +graphix @ git+https://github.com/thierry-martinez/graphix@fix/181-pauli_plane_measurements From 7eefdeb9e0c3893d44557733939c6f545b60fe64 Mon Sep 17 00:00:00 2001 From: Thierry Martinez Date: Sun, 8 Mar 2026 12:01:36 +0100 Subject: [PATCH 6/8] Mark support for graphix 3.14 and pin graphix master --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index beaae77..30f9129 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ numpy qiskit>=1.0,<2 qiskit_ibm_runtime qiskit-aer -graphix @ git+https://github.com/thierry-martinez/graphix@fix/181-pauli_plane_measurements +graphix @ git+https://github.com/TeamGraphix/graphix@master diff --git a/setup.py b/setup.py index ef19938..c58daab 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ "Operating System :: OS Independent", "Topic :: Scientific/Engineering :: Physics", ], - "python_requires": ">=3.10,<3.14", + "python_requires": ">=3.10,<3.15", "install_requires": requirements, "extras_require": {"test": ["graphix"]}, } From 646a819d88b19561286828184179f144361e7c63 Mon Sep 17 00:00:00 2001 From: Thierry Martinez Date: Sun, 8 Mar 2026 18:36:00 +0100 Subject: [PATCH 7/8] Add required constraints for Python 3.14 --- requirements.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/requirements.txt b/requirements.txt index 30f9129..13c50f7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,7 @@ qiskit>=1.0,<2 qiskit_ibm_runtime qiskit-aer graphix @ git+https://github.com/TeamGraphix/graphix@master +# The following contraints on `pydantic-core` and `symengine` are required for +# Python 3.14 +pydantic-core>=2.41.5 +symengine>=0.14 From ad097cf51f0d072dba7fd9c67ec1372335772f70 Mon Sep 17 00:00:00 2001 From: Thierry Martinez Date: Mon, 30 Mar 2026 17:41:23 +0200 Subject: [PATCH 8/8] Add Python 3.14 tests and markers Suggested by Mateo. --- .github/workflows/ci.yml | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08f96db..29dc082 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'windows-2022', 'macos-latest'] - python: ['3.10', '3.11', '3.12', '3.13'] + python: ['3.10', '3.11', '3.12', '3.13', '3.14'] name: "Python ${{ matrix.python }} / ${{ matrix.os }}" runs-on: ${{ matrix.os }} diff --git a/setup.py b/setup.py index c58daab..c854ba8 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Topic :: Scientific/Engineering :: Physics",