Open 18810393041 opened 1 month ago
from qiskit_ibm_runtime.fake_provider import FakeValenciaV2
from qiskit import QuantumCircuit, pulse
from qiskit.pulse import (Play,Schedule,DriveChannel,MeasureChannel,build)
from qiskit_ibm_runtime import QiskitRuntimeService
backend = FakeValenciaV2()
config = backend.configuration()
print(config.open_pulse)
# backend_name = 'ibm_brisbane'
# service = QiskitRuntimeService()
# backend = service.backend(backend_name)
circ = QuantumCircuit(1, 1)
circ.id(0)
circ.measure([0], [0])
with pulse.build() as h_q0:
pulse.play(
pulse.library.Gaussian(duration=256, amp=0.2, sigma=50, name="custom"),
pulse.DriveChannel(0)
)
circ.add_calibration("id", qubits=[0], schedule=h_q0)
circ.draw("mpl")
result = backend.run(circ).result().data()
print(result)
Environment
What is happening?
For the prior version qiskit. Pulse, we can't run Schedule or Scheduleblock directly on the fake backend and the real backend directly, the alternative is to embed Scheduleblock into the quantum gate via 'add_calibration' for pulse control.
However, this does not work, and it is known from measurements that these encoded Schedules do not control quantum bits. I hope the problem can be solved, thank you!
How can we reproduce the issue?
from qiskit_ibm_runtime.fake_provider import FakeValenciaV2 from qiskit import QuantumCircuit, pulse from qiskit.pulse import ( Play, Schedule, ShiftFrequency, DriveChannel, MeasureChannel, build ) from qiskit_ibm_runtime import QiskitRuntimeService
backend = FakeValenciaV2() config = backend.configuration() print(config.open_pulse)
backend_name = 'ibm_brisbane'
service = QiskitRuntimeService()
backend = service.backend(backend_name)
from qiskit import QuantumCircuit
circ = QuantumCircuit(1, 1) circ.id(0) circ.measure([0], [0])
circ.draw("mpl") with pulse.build() as h_q0: pulse.play( pulse.library.Gaussian(duration=256, amp=0.2, sigma=50, name="custom"), pulse.DriveChannel(0) )
circ.add_calibration("id", qubits=[0], schedule=h_q0) circ.draw("mpl")
result = backend.run(circ).result().data() print(result)
What should happen?
No matter how the pulse parameters are adjusted, they do not work for the id gate.
Any suggestions?
No response