Skip to content

Commit

Permalink
feat: update to qiskit 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gschurck committed Dec 6, 2024
1 parent b2e9368 commit ea6542d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 328 deletions.
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,20 @@ classifiers=[
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Physics",
]
urls = {Homepage = "https://github.com/Alice-Bob-SW/qiskit-alice-bob-provider", "Alice & Bob" = "https://alice-bob.com/"}
requires-python = ">=3.8, <3.13"
requires-python = ">=3.9, <3.13"
dependencies = [
"ipython",
"ipywidgets",
"pydantic>=2.0",
"requests>=1.26",
# Qiskit version is pinned because substitute_node_with_dag function is patched to make custom instructions work.
"qiskit==1.2.4",
"qiskit==1.3.0",
"qiskit-aer<0.16.0",
"qiskit-qir-alice-bob-fork==0.5.0rc0",
"tenacity"
Expand Down
15 changes: 0 additions & 15 deletions qiskit_alice_bob_provider/custom_instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
from qiskit.circuit import Instruction, InstructionSet, QuantumCircuit, Reset
from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary
from qiskit.circuit.quantumcircuit import ClbitSpecifier, QubitSpecifier
from qiskit.dagcircuit import DAGCircuit

from qiskit_alice_bob_provider.local.patch.substitute_node_with_dag import (
substitute_node_with_dag,
)


class MeasureX(Instruction):
Expand Down Expand Up @@ -65,13 +60,3 @@ def _measure_x(
_c = QuantumCircuit(1, 0)
_c.initialize('0', 0) # pylint: disable=no-member
SessionEquivalenceLibrary.add_equivalence(Reset(), _c)


# The function substitute_node_with_dag is patched to make the custom measure_x
# instruction work with Qiskit 1.2.
# It adds the else statement that was removed on lines 1610-1611
# in dagcircuit.py in this commit :
# https://github.com/Qiskit/qiskit/commit/353b0ea6bdd907e801ad8fa264f3444e0be942aa#diff-4fb31a3ade5ae57cfd91ea00dbf3c5b6ab066a8234a742d91f9c09a09edca2f7L1610-L1611
# This function will be moved to Rust in Qiskit version 1.3
# so we will have to find another solution.
DAGCircuit.substitute_node_with_dag = substitute_node_with_dag
307 changes: 0 additions & 307 deletions qiskit_alice_bob_provider/local/patch/substitute_node_with_dag.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/local/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_translation_plugin() -> None:
circ = QuantumCircuit(3)
circ.initialize(2, [0, 1])
circ.reset(2)
transpiled = transpile(circ, backend)
transpiled = transpile(circ, backend, optimization_level=1)
_assert_many_initializes(transpiled, ['0', '1', '0'])


Expand Down
2 changes: 1 addition & 1 deletion tests/local/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def test_interpolated_cat() -> None:
circ.measure_x(0, 0)
circ.measure(0, 1)

job = backend.run(transpile(circ, backend))
job = backend.run(transpile(circ, backend, optimization_level=1))
assert isinstance(job, ProcessorSimulationJob)
noisy_circ = job.noisy_circuits()[0]

Expand Down

0 comments on commit ea6542d

Please sign in to comment.