Sample Circuits & Notebooks¶
Open Quantum provides ready-to-run quantum circuits and Jupyter notebooks to help you get started quickly.
Sample QASM Circuits¶
The Sample QASM page on the portal has downloadable OpenQASM 2.0 circuits covering fundamental quantum algorithms:
| Circuit | Algorithm | Qubits |
|---|---|---|
deutsch_n2.qasm |
Deutsch's Algorithm | 2 |
grover_n2.qasm |
Grover's Search | 2 |
cat_state_n4.qasm |
Cat State (GHZ) | 4 |
simon_n6.qasm |
Simon's Algorithm | 6 |
qaoa_n3.qasm |
QAOA | 3 |
bell_n4.qasm |
Bell State Preparation | 4 |
These can be submitted directly through the web portal or via the SDK:
Sample Notebooks¶
The Sample Notebooks page has Jupyter notebooks that open directly in Google Colab — no local setup required.
| Notebook | Description |
|---|---|
| Run a Circuit in Python | Execute a quantum circuit on real hardware using the OpenQuantum Python SDK. Connect to IonQ, Rigetti, IQM, and AQT backends. |
| Run a Simulation with Quantum Rings SDK | Use the Quantum Rings SDK to run a quantum simulation without needing access to physical hardware. |
Using Sample Circuits with the SDK¶
Core SDK¶
from openquantum_sdk.clients import SchedulerClient, JobSubmissionConfig
scheduler = SchedulerClient(auth=auth)
config = JobSubmissionConfig(
backend_class_id="ionq:forte-1",
name="Grover Search",
job_subcategory_id="opt:oth", # Optimization
shots=1024,
)
job = scheduler.submit_job(config, file_path="grover_n2.qasm")
output = scheduler.download_job_output(job)
print(output)
Qiskit Plugin¶
from qiskit import QuantumCircuit
from openquantum_sdk_qiskit import OpenQuantumService
service = OpenQuantumService()
backend = service.return_backend("ionq:forte-1")
qc = QuantumCircuit.from_qasm_file("bell_n4.qasm")
job = backend.run(qc, shots=1024)
result = job.result()
print(result.get_counts())
PennyLane Plugin¶
import pennylane as qml
dev = qml.device(
"openquantum.device",
wires=2,
shots=1024,
backend="ionq:forte-1",
)
@qml.qnode(dev)
def bell_state():
qml.Hadamard(0)
qml.CNOT(wires=[0, 1])
return qml.counts()
print(bell_state())
Related Pages¶
- Submitting Jobs -- Walk through submitting a job in the web UI.
- Quick Start (SDK) -- Submit your first job with Python.
- Backends -- Available quantum hardware.