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
4.84k stars 2.29k forks source link

schedule() command doesn't defaulty take into account instruction map. #10837

Closed patdenim closed 8 months ago

patdenim commented 9 months ago

Environment

What is happening?

schedule() command fails when the circuit includes 'measure' with the error message

schedule(circuit, backend)  

 qiskit.pulse.exceptions.PulseError: "Operation 'measure' exists, but is only defined for qubits [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]."

The command works when specifying the default instruction map

schedule(qc, backend, backend.defaults().instruction_schedule_map, meas_map=backend.configuration().meas_map )

How can we reproduce the issue?

 provider = IBMProvider()
 qc = QuantumCircuit(1)
 qc.h(0)
 qc.measure_all()  # or qc.measure(0)
 # Schedule
 qctr = transpile(qc, backend_nisq, initial_layout=None, optimization_level=0)
 sch = schedule(qctr, backend)

What should happen?

default instruction and default measure maps should be defaultly taken into account without having to explicitly specify it in the schedule() command

Any suggestions?

No response

MozammilQ commented 9 months ago

@patdenim , I am unable to reproduce the error as shown by you. This is what I am getting instead! Could you please confirm if you are getting the same, I would like to work on this issue :) I have checked it, the same is the problem with qiskit verison 0.44.2 with qiskit-terra version 0.25.2. Screenshot_20231006_211526

MozammilQ commented 9 months ago

@fvarchon , am I allowed to work on this issue?

fvarchon commented 9 months ago

@MozammilQ Yes for sure :)

MozammilQ commented 9 months ago

@fvarchon , sir, please see if my efforts a good enough :), please let me know if any additional changes are required :)

patdenim commented 9 months ago

Thanks @MozammilQ, you've got the point !! fails only when backends are V1.

jakelishman commented 8 months ago

@to24toro, @nkanazawa1989: was this fully closed by #10988 or is there more to do?

to24toro commented 8 months ago

@jakelishman I think we can close this issue.