Sycamore Random Circuit Example¶
Overview¶
This example demonstrates how to:
Import a Sycamore-style random circuit from OpenQASM 2.0
Add measurement
Execute the circuit
Retrieve sampled results
For the general execution workflow (provider → backend → circuit → run), see Circuits.
Sycamore Random Quantum Circuits¶
Sycamore Random Quantum Circuits (RQCs) are available to download from Google’s public Dryad repository:
Dryad (DOI): 10.5061/dryad.k6t1rj8 — https://doi.org/10.5061/dryad.k6t1rj8
Circuits in this dataset are identified by the parameters n, m, s, e, and p:
n — number of qubits (12, 14, … 38, 39, … 51, 53)
m — number of cycles (12, 14, 16, 18, 20)
s — PRNG seed number (0 … 23)
e — number of elided gates (0 … 35)
p — coupler activation pattern (e.g. EFGH, ABCDCDAB)
There are three variants of RQCs:
patch circuits: remove a slice of two-qubit gates, splitting the circuit into two patches
elided circuits: remove only a fraction of initial two-qubit gates along the slice
verification circuits: same gate counts as supremacy circuits, but with a different two-qubit pattern (easier to simulate)
Patch and elided circuits are differentiated by the presence or absence of the word patch in the
file name.
Example filename pattern:
circuit_n12_m14_s0_e0_pEFGH.qasm
Import a Sycamore circuit¶
Import the circuit using QuantumCircuit.from_qasm_file(...):
from QuantumRingsLib import QuantumCircuit
qc = QuantumCircuit.from_qasm_file("sycamore_rqc.qasm")
See QASM Import & Execution for more information.
Add measurement¶
If the imported circuit does not include measurement instructions, add measurement before execution.
qc.measure_all()
See Measurement for details on measurement behavior.
Execute the circuit¶
Acquire a backend and execute the circuit:
from QuantumRingsLib import QuantumRingsProvider
provider = QuantumRingsProvider()
backend = provider.get_backend("scarlet_quantum_rings")
job = backend.run(qc, shots=100, mode="sync")
result = job.result()
Retrieve results¶
Access measurement output using:
memory = result.get_memory()
counts = result.get_counts()
print(memory[:10])
print(counts)
Scaling considerations¶
Sycamore random circuits are often large and may use many qubits. Ensure the circuit size is compatible with your account limits. Start small (e.g. n=12, m=12, s=0, e=0, p=EFGH) and scale up as needed.
For configuration options such as precision and execution mode, see Run Settings.