Skip to content
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

IBM no longer support IBMQ provider #289

Closed
PoJung-Lu opened this issue Apr 17, 2023 · 1 comment · Fixed by #298
Closed

IBM no longer support IBMQ provider #289

PoJung-Lu opened this issue Apr 17, 2023 · 1 comment · Fixed by #298

Comments

@PoJung-Lu
Copy link

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'))"'
image

Desktop (please complete the following information):

  • OS: windows wsl2 ubuntu 22.04.2
  • Browser: chrome
  • Version: pennylane 0.29.1, jupyterlab 3.6.1, jax, 0.4.6

Additional context
Hope that pennylane would support the new IBMProvider soon, that would be very helpfu.

@isaacdevlugt
Copy link

Thanks @PoJung-Lu! Just noting here that they made a post on the forum that led to this issue:

https://discuss.pennylane.ai/t/disconnect-issues-with-qiskit-hardware/2827/10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants