You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
As title says, the old IBMQ provider is deprecated, and is switched to a new one (IBMProvider).
However, pennylane does not seem to support the new IBMProvider.
In that case I'm affraid that we will no longer able to access IBM hardware with pennylane plugin anymore.
In fact, this issue has already caused some problem when using pennylane plugin to connect IBM hardware service.
If you try to use a busy IBM quantum machine, which will cause you to wait a lot of time, some disconnection error will happen.
To see more detail of what that I encountered, please see the article that I posted on forum.
To Reproduce
More detail is described in in the forum mentioned above.
A reproducable code is as follows:
`from qiskit import *
from qiskit.compiler import transpile, assemble
sleep_time = 5
num_retries = 5
str_error = None
#provider = IBMProvider() #This has no error
provider = IBMQ.load_account() #This has error
backend = provider.get_backend('ibm_oslo')
while True:
try:
if not str_error:
databatch=next(data)
for x in range(0, num_retries):
try:
result = qcircuit(*databatch)
counts = result.get_counts()
print('result:',counts)
str_error = None
except Exception as e:
str_error = str(e)
print(e)
if str_error: # if None->break; if 'some_string'(error happens)->sleep
time.sleep(sleep_time) # wait before trying to fetch the data again
sleep_time *= 3
print(f'retry {x} times')
else:
break
except StopIteration:
break`
Expected behavior
Succeessful to send a job and retrieve results from IBM quantum device.
Screenshots
'Error submitting job: "('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))"'
Desktop (please complete the following information):
Describe the bug
As title says, the old IBMQ provider is deprecated, and is switched to a new one (IBMProvider).
However, pennylane does not seem to support the new IBMProvider.
In that case I'm affraid that we will no longer able to access IBM hardware with pennylane plugin anymore.
In fact, this issue has already caused some problem when using pennylane plugin to connect IBM hardware service.
If you try to use a busy IBM quantum machine, which will cause you to wait a lot of time, some disconnection error will happen.
To see more detail of what that I encountered, please see the article that I posted on forum.
To Reproduce
More detail is described in in the forum mentioned above.
A reproducable code is as follows:
`from qiskit import *
from qiskit.compiler import transpile, assemble
sleep_time = 5
num_retries = 5
str_error = None
#provider = IBMProvider() #This has no error
provider = IBMQ.load_account() #This has error
backend = provider.get_backend('ibm_oslo')
def qcircuit(x,y):
qr = QuantumRegister(2)
cr = ClassicalRegister(2)
circuit = QuantumCircuit(qr, cr)
circuit.rx(x,qr[0])
circuit.ry(y,qr[1])
circuit.cx(qr[0], qr[1])
circuit.measure(qr, cr)
mapped_circuit = transpile(circuit, backend=backend)
job = backend.run(mapped_circuit, shots=1024)
return job.result()
data = iter([[0.1,0.2],[0.2,0.3],[0.4,0.5]])
while True:
try:
if not str_error:
databatch=next(data)
for x in range(0, num_retries):
try:
result = qcircuit(*databatch)
counts = result.get_counts()
print('result:',counts)
str_error = None
except Exception as e:
str_error = str(e)
print(e)
if str_error: # if None->break; if 'some_string'(error happens)->sleep
time.sleep(sleep_time) # wait before trying to fetch the data again
sleep_time *= 3
print(f'retry {x} times')
else:
break
except StopIteration:
break`
Expected behavior
Succeessful to send a job and retrieve results from IBM quantum device.
Screenshots
'Error submitting job: "('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))"'
Desktop (please complete the following information):
Additional context
Hope that pennylane would support the new IBMProvider soon, that would be very helpfu.
The text was updated successfully, but these errors were encountered: