# Quantum Circuits **Quantum circuits** are the fundamental way to describe quantum computations in Qiskit—an ordered sequence of operations applied to qubits. A circuit specifies which gates to apply, in what order, on which qubits, and where to measure. Think of it like assembly code: abstract and portable, executable on any backend that supports the required gate set. In Qiskit, a `QuantumCircuit` object holds qubits (quantum registers) and classical bits (classical registers). Qubits hold quantum state; classical bits hold measurement results. Gates modify qubit state; measurements collapse qubits and write results to classical bits. ```python from qiskit import QuantumCircuit # Create a 3-qubit, 3-bit circuit qc = QuantumCircuit(3, 3) # Apply gates qc.h(0) # Hadamard on qubit 0 qc.cx(0, 1) # CNOT: qubit 0 controls qubit 1 qc.rz(0.5, 2) # RZ rotation on qubit 2 # Measure all qubits qc.measure([0, 1, 2], [0, 1, 2]) # Draw the circuit print(qc.draw()) ``` Circuits are abstract—they don't execute until you send them to a backend (simulator or hardware). This abstraction lets you design once and run on different backends. Before execution, [[qiskit-transpilation|transpilation]] adapts your circuit to the backend's native gates and qubit topology. ## Circuit Construction Gates can be chained, and Qiskit provides hundreds: single-qubit gates (H, X, Y, Z, S, T, RX, RY, RZ), two-qubit gates (CNOT, CZ, SWAP), and multi-qubit gates (Toffoli, controlled operations). Use the circuit's methods to add gates: `qc.h(0)`, `qc.cx(0, 1)`, etc. You can also inspect and manipulate circuits: get the number of qubits/bits, decompose gates, remove or insert operations, and compose smaller circuits together. ```python # Get circuit info print(qc.num_qubits) # 3 print(qc.num_clbits) # 3 print(qc.depth()) # Circuit depth (longest qubit path) # Compose two circuits qc2 = QuantumCircuit(3, 3) qc2.h([0, 1, 2]) combined = qc.compose(qc2) ``` ## Parameterized Circuits [[qiskit-parameterized-circuits|Parameterized circuits]] replace fixed rotation angles with parameters, useful for [[qiskit-variational-algorithms|variational algorithms]]. Define parameters once, then bind them to different values for each evaluation without rebuilding the circuit.