Tutorials
Tip
Interactive tutorials can be found on our Jupyter server.
Basic Usage
To use the provider, a QRydDemo API token is required. The token can be obtained via our online registration form.
You can use the token to initialize the provider:
from qiskit_qryd_provider import QRydProvider
import os
provider = QRydProvider(os.getenv("QRYD_API_TOKEN"))
Afterwards, you can choose a backend. Different backends are available that are capable of running ideal simulations of quantum circuits on the GPU-based emulator of the QRydDemo consortium. An inclusion of noise models is planned for the future. You can either choose a backend emulating 30 qubits arranged in a 5x6 square lattice with nearest-neighbor connectivity
backend = provider.get_backend("qryd_emulator$square")
or a backend emulating 30 qubits arranged in a triangle lattice with nearest-neighbor connectivity
backend = provider.get_backend("qryd_emulator$triangle")
If you use these backends, the compilation of quantum circuits happens on our servers. The circuits are compiled to comply with the native gate set and connectivity of the Rydberg platform, using a decomposer developed by HQS Quantum Simulations.
After selecting a backend, you can run a circuit on the backend, using the transpile function followed by backend.run:
from qiskit import QuantumCircuit, transpile
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
job = backend.run(transpile(qc, backend), shots=200)
print(job.result().get_counts())
Alternatively, you can use the BackendSampler primitive:
from qiskit import QuantumCircuit
from qiskit.primitives import BackendSampler
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
job = BackendSampler(backend).run(qc, shots=200)
print(job.result().quasi_dists[0])
Expert Options
The value of the phase shift of the PCZ gate
can be modified before using the backend via:
from qiskit_qryd_provider import PCZGate
PCZGate.set_theta(1.234)