I wanted to run PennyLane's notebook "Quantum transfer learning":
I tried it and it works quite fine, when using dev = qml.device('default.qubit', wires=n_qubits) as device, so PennyLane's default device.
However, if I test it on an actual IBM machine (e.g. ibm_cairo) it does not work or runs for days.
The queue time is not the problem may be rather some other issues. I also tested it on some of the other IBM backends.
But the result was all the same.
When calling the train_model command quite at the end of the notebook, it arises the following UserWarning:
Resynthesized
<qiskit.circuit.library.standard_gates.rz.RZGate object at 0x7f971b2d50d0>
<qiskit.circuit.library.standard_gates.sx.SXGate object at 0x7f971b2d5310>
<qiskit.circuit.library.standard_gates.rz.RZGate object at 0x7f9730849fd0>
<qiskit.circuit.library.standard_gates.sx.SXGate object at 0x7f971b327fd0>
and got
<qiskit.circuit.library.standard_gates.rz.RZGate object at 0x7f971b327690>
<qiskit.circuit.library.standard_gates.sx.SXGate object at 0x7f971b327410>
<qiskit.circuit.library.standard_gates.rz.RZGate object at 0x7f971b327e50>
<qiskit.circuit.library.standard_gates.sx.SXGate object at 0x7f971b327610>
<qiskit.circuit.library.standard_gates.rz.RZGate object at 0x7f971b3276d0>
but the original was native (for ['id', 'rz', 'sx', 'x', 'cx', 'reset']) and the new value is longer. This indicates an efficiency bug in synthesis. Please report it by opening an issue here: https://github.com/Qiskit/qiskit-terra/issues/new/choose
new_dag = pass_.run(dag)
Maybe this is in some sense the reason for it, but I do not know.
In the third codeblock replace dev = qml.device('default.qubit', wires=n_qubits) by dev = qml.device('qiskit.ibmq', wires=n_qubits, backend=backend.name(), provider=provider, shots=1000), where the backend is defined in a new codeblock above via
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
token='Insert token here'
IBMQ.save_account(token, overwrite=True)
IBMQ.load_account()
provider = IBMQ.get_provider()
def backend_filter_num_circuit(b):
return b.configuration().n_qubits >= n_qubits and not b.configuration().simulator and b.status().operational==True and b.status().status_msg=='active'
backend = least_busy(provider.backends(filters=backend_filter_num_circuit))
Can also exchange the backends (the same result arises)
Let anything else like in the notebook
What should happen?
I would expect a longer execution time due to the queue and the execution of the circuit on the backends themselves. I expect some similar results as I get on the qasm_simulator or some fake backends. But not the error message showed above in every execution.
Environment
Fri Feb 18 18:53:45 2022 CET
What is happening?
I wanted to run PennyLane's notebook "Quantum transfer learning": I tried it and it works quite fine, when using
dev = qml.device('default.qubit', wires=n_qubits)
as device, so PennyLane's default device.However, if I test it on an actual IBM machine (e.g. ibm_cairo) it does not work or runs for days. The queue time is not the problem may be rather some other issues. I also tested it on some of the other IBM backends. But the result was all the same.
When calling the
train_model
command quite at the end of the notebook, it arises the following UserWarning:Maybe this is in some sense the reason for it, but I do not know.
I want to get something similar to the paper Transfer learning in hybrid classical-quantum neural networks, where they showed it with the ibmqx4 backend and an execution time of 26 seconds for the full dataset.
How can we reproduce the issue?
dev = qml.device('default.qubit', wires=n_qubits)
bydev = qml.device('qiskit.ibmq', wires=n_qubits, backend=backend.name(), provider=provider, shots=1000)
, where the backend is defined in a new codeblock above viaWhat should happen?
I would expect a longer execution time due to the queue and the execution of the circuit on the backends themselves. I expect some similar results as I get on the qasm_simulator or some fake backends. But not the error message showed above in every execution.
Any suggestions?
No response