diff --git a/pyproject.toml b/pyproject.toml index 1c2c4f4..2c51825 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ requires-python = ">=3.7" dependencies = [ "requests", "qiskit-terra", - "qiskit-qir @ git+https://github.com/microsoft/qiskit-qir" + "qiskit-qir @ git+https://github.com/jrj-d/qiskit-qir@add_delay_instruction_using_an_extern" ] [project.optional-dependencies] diff --git a/tests/test_backend.py b/tests/test_backend.py index ffb06c5..1cff725 100644 --- a/tests/test_backend.py +++ b/tests/test_backend.py @@ -23,6 +23,7 @@ from requests_mock.mocker import Mocker from qiskit_alice_bob_provider.api.client import AliceBobApiException +from qiskit_alice_bob_provider.backend import _qiskit_to_qir from qiskit_alice_bob_provider.provider import AliceBobProvider @@ -111,3 +112,17 @@ def test_failed_server_side_validation(failed_validation_job: Mocker) -> None: backend = provider.get_backend('SINGLE_CAT_SIMULATOR') with pytest.raises(AliceBobApiException): execute(c, backend) + + +def test_delay_instruction_recognized() -> None: + c = QuantumCircuit(1, 2) + c.initialize('+', 0) + c.measure_x(0, 0) + c.delay(3000, 0, unit='ns') + c.measure(0, 1) + qir = _qiskit_to_qir(c) + delay_call = ( + 'call void @__quantum__qis__delay__body' + '(double 3.000000e+00, %Qubit* null)' + ) + assert delay_call in qir