trying to run Hello Many Worlds code at:
https://publish.obsidian.md/emily-parkman-quantum/PennyLane+Quantum+Hello+World
Did this happen because job could not complete?
How can I check the Job Status?
Thanks
trying to run Hello Many Worlds code at:
https://publish.obsidian.md/emily-parkman-quantum/PennyLane+Quantum+Hello+World
Did this happen because job could not complete?
How can I check the Job Status?
Thanks
Hi @wparkman and welcome to the forum!
This is a tricky error to debug - it looks like an issue with the response data but I’m not exactly sure what. Could you share with us which version of PL-IonQ you are using? The easiest way to provide this is by copying over the output of qml.about()
. Thanks!
Thanks, this is what it says:
Name: PennyLane
Version: 0.16.0
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: https://github.com/XanaduAI/pennylane
Author: None
Author-email: None
License: Apache License 2.0
Location: /home/walt/.local/lib/python3.8/site-packages
Requires: semantic-version, autoray, appdirs, toml, numpy, autograd, networkx, scipy
Required-by: PennyLane-Qchem, PennyLane-IonQ
Platform info: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.29
Python version: 3.8.5
Numpy version: 1.20.3
Scipy version: 1.6.3
Installed devices:
Tried it again and got a different stack trace with something new at the end:
ConnectionError: HTTPSConnectionPool(host=‘api.ionq.co’, port=443): Max retries exceeded with url: /v0.1/jobs/85744500-a004-41b0-888e-937ae4348d49 (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x7f100059f3a0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’))
Hi @wparkman,
Thanks for the traces!
On our end, we get counts well using the example that you’ve shared. One subtlety is that we pass the API key explicitly to the device:
dev = qml.device("ionq.qpu", wires=2, shots=1000, api_key=key)
As we’re not able to reproduce the trace, I can just try to give a couple of ideas:
requests
library are you using? You can check that with pip freeze | grep requests
on a Linux based system.Just to make sure, it was the Qiskit-IonQ provider that worked well with your API key, correct?
So the following example would execute well:
from qiskit_ionq import IonQProvider
provider = IonQProvider(key)
from qiskit import QuantumCircuit
# Create a basic Bell State circuit:
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
# Get IonQ's simulator backend:
simulator_backend = provider.get_backend("ionq_simulator")
# Run the circuit on IonQ's platform:
job = simulator_backend.run(qc, shots=10000)
# Print the counts
print(job.get_counts())