Backends

class qiskit_qryd_provider.QRydBackend(**kwargs)[source]

Super class for accessing the emulator of the QRydDemo consortium.

All backends are derived from this class, which provides functionality for running a quantum circuit on the emulator. For usages examples, see the derived backends.

__init__(**kwargs)[source]

Initialize the class.

Parameters:

**kwargs – Arguments to pass to Qiskit’s Backend class.

property max_circuits: int

The maximum number of circuits that can be run in a single job.

Currently, it is only supported to run a single circuit in a single job.

Returns:

1

run(circuit, **kwargs)[source]

Serialize a circuit, submit it to the backend, and create a job.

This method will submit a simulation job and return a Job object that runs the circuit on QRydDemo’s emulator. This is an async call so that running does not block the program.

Parameters:
Return type:

QRydJob

Returns:

A job object.

set_option(key, value)[source]

Set an option.

Parameters:
  • key (str) –

    The key of the option. Currently, the following options are supported:

    • shots (int, default: 1024): Number of measurements, must be \(\geq 1\) and \(\leq 2^{18}\).

    • seed_simulator (int, default: None): A seed for the random number generator of the emulator.

    • fusion_max_qubits (int, default: 4): The maximum number of qubits that can be fused in a single unitary.

    • allow_compilation (bool, default: True): Whether our servers are allowed to compile the circuit. If not, the user must take care that the circuit only uses native gates and connectivity.

    The following additional options can be used to fine-tune how our servers compile the quantum circuit to the connectivity and gate set of the Rydberg platform:

    • seed_compiler (int, default: None): A seed for the random number generator of the compiler.

    • use_extended_set (bool, default: True): Whether the SABRE algorithm uses the extended set of gates.

    • use_reverse_traversal (bool, default: True): Whether SABRE uses the reverse traversal technique to update the initial mapping.

    • extended_set_size (int, default: 5): Size of the extended set of gates used by SABRE.

    • extended_set_weight (float, default: 0.5): Weight of the extended set of gates used by SABRE.

    • reverse_traversal_iterations (int, default: 2): The number of times SABRE is run back and forth.

  • value (Union[int, None, bool, str, float]) – The value of the option.

Raises:

NotImplementedError – If key does not describe a valid option.

Return type:

None

property target: Target

A target object which defines a model of the backend for Qiskit’s transpiler.

Returns:

A target object of the backend.

class qiskit_qryd_provider.QRydEmulatorSquare(provider)[source]

Bases: QRydBackend

Backend for accessing a specific emulator.

The emulator simulates 30 ideal qubits arranged in a 5x6 square lattice with nearest-neighbor connectivity. Quantum circuits are compiled to the gate set and connectivity of the Rydberg platform on our servers after submitting the circuits to QRydDemo’s infrastructure.

Typical usage example:

from qiskit_qryd_provider import QRydProvider
from qiskit import QuantumCircuit, transpile
import os

provider = QRydProvider(os.getenv("QRYD_API_TOKEN"))
backend = provider.get_backend("qryd_emulator$square")

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)
__init__(provider)[source]

Initialize the backend.

Parameters:

provider (QRydProvider) – The provider that this backend comes from.

class qiskit_qryd_provider.QRydEmulatorTriangle(provider)[source]

Bases: QRydBackend

Backend for accessing a specific emulator.

The emulator simulates 30 ideal qubits arranged in a triangle lattice with nearest-neighbor connectivity. Quantum circuits are compiled to the gate set and connectivity of the Rydberg platform on our servers after submitting the circuits to QRydDemo’s infrastructure.

Typical usage example:

from qiskit_qryd_provider import QRydProvider
from qiskit import QuantumCircuit, transpile
import os

provider = QRydProvider(os.getenv("QRYD_API_TOKEN"))
backend = provider.get_backend("qryd_emulator$triangle")

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)
__init__(provider)[source]

Initialize the backend.

Parameters:

provider (QRydProvider) – The provider that this backend comes from.

class qiskit_qryd_provider.NoisyEmulatorTriangle(provider)[source]

Bases: QRydBackend

Backend for accessing a specific emulator.

The emulator is currently under development and aims to simulate up to 16 qubits arranged in a triangle lattice with nearest-neighbor connectivity and simple noise models. This emulator is useful for studying quantum error correction codes.

Typical usage example:

from qiskit_qryd_provider import QRydProvider
from qiskit import QuantumCircuit, transpile
import os

provider = QRydProvider(os.getenv("QRYD_API_TOKEN"))
backend = provider.get_backend("noisy_emulator$triangle")

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, allow_compilation=True)
__init__(provider)[source]

Initialize the backend.

Parameters:

provider (QRydProvider) – The provider that this backend comes from.