Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.23k stars 2.36k forks source link

Circuit with parametrized delay gate doesn't execute on backend #12974

Open przemekk125 opened 2 months ago

przemekk125 commented 2 months ago

Environment

What is happening?

A simple circuit with 1 delay gate on single qbit on ibm_brisbane backend when executed gives Internal error 1500. Similar issue poped up (#11010), but this solution doesn't work.

error_screenshot

How can we reproduce the issue?

from qiskit.quantum_info import Pauli
import numpy as np
from qiskit import QuantumCircuit
from qiskit.circuit import Parameter
from qiskit_ibm_runtime import EstimatorV2 as Estimator
from qiskit_ibm_runtime import QiskitRuntimeService
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager

backend_name = "ibm_brisbane"

qbit_num = 28

t_vals = np.linspace(0,100,20)
t = Parameter("time")

observables = Pauli("X")

circuit = QuantumCircuit(1)
circuit.delay(t,0,unit="us")

backend = QiskitRuntimeService().backend(name=backend_name)
pass_manager = generate_preset_pass_manager(1,backend=backend,initial_layout=[qbit_num])
pass_manager.scheduling = None

echo_transpiled = pass_manager.run(circuits=circuit)
observables_transpiled = observables.apply_layout(echo_transpiled.layout)
pub = (echo_transpiled,observables_transpiled,t_vals)

estimator = Estimator(mode=backend)

job = estimator.run([pub])

What should happen?

Circuit should be executed on ibm_brisbane backend

Any suggestions?

No response

przemekk125 commented 2 months ago

It appears that what was causing error was fact that all backends need delay time given is multipules of 8 in dt unit.