Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 1 addition & 4 deletions examples/gallery/aer_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 4 additions & 3 deletions graphix_ibmq/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,17 @@ 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]

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)
Expand Down
5 changes: 3 additions & 2 deletions graphix_ibmq/converter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from graphix import Circuit
from graphix.fundamentals import rad_to_angle
from qiskit import QuantumCircuit, transpile


Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ numpy
qiskit>=1.0,<2
qiskit_ibm_runtime
qiskit-aer
graphix
graphix @ git+https://github.com/thierry-martinez/graphix@fix/181-pauli_plane_measurements
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]},
}
Expand Down
Loading