-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transpile problem using DynamicsBackend code #235
Comments
Thank you for this bug report! We will try to address it soon and include it in the next patch release. |
Just reproducing the first issue with code that is fully executable:
I think the issue here is purely to do with labelling. When specifying |
The second issue isn't actually an issue, it is a design choice. For some more context behind this choice: It is a reaction to the |
In general a backend= DynamicsBackend.from_backend(FakeKolkata(), subsystem_list=[1]) is to have backend be a 1 qubit backend, then you'll need to reindex the target based on the number of qubits you want. |
I think I potential solution to this is to change the behaviour of the |
Informations
What is the current behavior?
Sorry to my English. Please understand this post.
When I use DynamicsBackend class at fakeprovider, there is variable 'subsystem_list'. Qiskit Document explanation said that 'subsystem_list' means the qubit which i wanted to use.
There are problems. When I use pulse class, If I write 1 or another number except 0 at subsystem_list, there is error.
Also, If I write a list like [0,1], and If I use pulse class at two qubit, there is error.
I described all code below.
Steps to reproduce the problem
I will write my code.
First problem:
from qiskit.providers.fake_provider import FakeKolkata
from qiskit_dynamics.backend import DynamicsBackend
backend= DynamicsBackend.from_backend(FakeKolkata(), subsystem_list=[1])
X_cal=QuantumCircuit(1)
X_cal.x(0)
X_cal.measure_all()
X_cal.calibrations
with pulse.build(backend, name='X') as x_q0:
pulse.play(Drag(duration=160, beta=0.7171287840008055, amp=0.16, sigma=40), pulse.DriveChannel(0))
X_cal.add_calibration('x',[0], x_q0)
circ_transpile = transpile(X_cal, backend)
and there is error
QiskitError: "Cannot unroll the circuit to the given basis, ['measure']. Instruction measure not found in equivalence library and no rule found to expand."
But if i write at subsystem_list = [0], there is not problem.
Second problem:
from qiskit.providers.fake_provider import FakeKolkata
from qiskit_dynamics.backend import DynamicsBackend
backend= DynamicsBackend.from_backend(FakeKolkata(), subsystem_list=[0,1])
circ=QuantumCircuit(2)
circ.h(0)
circ.x(0)
circ.z(1)
circ.cx(0,1)
circ.y(0)
circ.y(1)
circ.measure_all()
with pulse.build(backend, name='X') as x_q0:
pulse.play(Drag(duration=160, beta=-1.5, amp=0.15575757575757576, sigma=40), pulse.DriveChannel(0))
circ.add_calibration('x',[0], x_q0)
with pulse.build(backend, name='Y') as y_q0:
pulse.shift_phase(np.pi,pulse.DriveChannel(0))
pulse.play(Drag(duration=160, beta=-1.5, amp=0.15575757575757576, sigma=40), pulse.DriveChannel(0))
circ.add_calibration('y',[0], y_q0)
with pulse.build(backend, name='Y') as y_q1:
pulse.shift_phase(np.pi,pulse.DriveChannel(1))
pulse.play(Drag(duration=160, beta=-1.5, amp=0.15575757575757576, sigma=40), pulse.DriveChannel(1))
circ.add_calibration('y',[1], y_q1)
circ_transpile = transpile(circ, backend)
and there is problem
TranspilerError: "Unable to translate the operations in the circuit: ['cx', 'z', 'h', 'measure', 'barrier'] to the backend's (or manually specified) target basis: ['barrier', 'measure', 'snapshot']. This likely means the target basis is not universal or there are additional equivalence rules needed in the EquivalenceLibrary being used. For more details on this error see: https://qiskit.org/documentation/stubs/qiskit.transpiler.passes.BasisTranslator.html#translation_errors"
What is the expected behavior?
First case is just drive qubit 1 and yield the result.
Second case also just drive qubit to use our calibrated X gate and Y gate and other qiskit own calibrated gate.
Suggested solutions
Add all our calibration gate to basis gate.
The text was updated successfully, but these errors were encountered: