From 214dee85acb907df1329f00cd74f748e65c0d950 Mon Sep 17 00:00:00 2001 From: Thierry Martinez Date: Thu, 22 Jan 2026 19:54:20 +0100 Subject: [PATCH 1/3] 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/3] `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/3] 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