Circuits¶
Overview¶
A quantum circuit is the object you construct and execute on a backend. This page describes the recommended workflow and how to obtain circuits.
For backend selection, see Backends. For execution options (shots, precision, mode), see Run Settings.
Recommended workflow: Provider → Backend → Circuit → Run¶
Use this order:
Provider — Create or load a
QuantumRingsProvider.Backend — Obtain a backend using
provider.get_backend(...).Circuit — Build or load your circuit.
Run — Call
backend.run(...)and retrieve the result.
Minimal example:
from QuantumRingsLib import QuantumCircuit, QuantumRingsProvider
provider = QuantumRingsProvider()
backend = provider.get_backend("scarlet_quantum_rings")
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()
job = backend.run(qc, shots=100)
result = job.result()
Obtaining circuits¶
Programmatic construction¶
Construct circuits using QuantumCircuit from QuantumRingsLib.
You define the number of qubits (and classical bits, if needed),
apply gates, and add measurement operations.
See Quick Start (5 Minutes) and Core SDK Examples for additional examples.
QASM import¶
You can load circuits from OpenQASM 2.0 (.qasm) files or strings.
Details and constraints are described in QASM import.
For downloadable circuit datasets, see Downloadable Circuits.
Common pitfalls¶
Unsupported operations — If your circuit uses operations not supported by the SDK or by the OpenQASM import path, import or execution may fail. See Supported gates.
Execution before backend selection — Always acquire a backend before calling
run(...)on a circuit.
See also¶
Return to Quantum Rings SDK Documentation.