Quantum circuit
A quantum circuit is a computational model in quantum information science that represents quantum algorithms as a sequence of unitary quantum gates applied to qubits, the basic units of quantum information analogous to classical bits but capable of existing in superpositions and entangled states. This model extends classical circuit architectures by leveraging principles of quantum mechanics, such as superposition and entanglement, to perform reversible transformations on quantum states within a Hilbert space, ultimately yielding probabilistic classical outputs upon measurement.[1] Quantum circuits are visualized as diagrams with horizontal wires representing qubits evolving from left to right through time, where each gate acts as a local unitary operator—either on a single qubit (e.g., Hadamard or Pauli gates) or multiple qubits (e.g., controlled-NOT or Toffoli gates)—to manipulate the overall quantum state. A finite universal set of such gates, such as single-qubit rotations combined with the controlled-NOT gate, suffices to approximate any desired unitary evolution, enabling the implementation of powerful quantum algorithms like Shor's factoring or Grover's search.[1] Circuits typically begin with qubits initialized in a standard basis state, such as |0⟩, and conclude with measurements that project the final state onto classical bit strings, with outcome probabilities determined by the squared magnitudes of the quantum amplitudes.[2] The model's power stems from its ability to exploit quantum parallelism, where operations on superposed states effectively compute on multiple inputs simultaneously, though decoherence and noise in physical implementations necessitate fault-tolerant designs using error-correcting codes and ancillary qubits. Quantum circuits form the backbone of quantum programming frameworks like Qiskit and Cirq, facilitating simulations and executions on noisy intermediate-scale quantum (NISQ) devices, and continue to drive advancements in quantum supremacy demonstrations and scalable quantum computing architectures.[1][3]Classical Foundations
Reversible Classical Logic Gates
Reversible logic gates are computing elements that implement bijective functions, ensuring a one-to-one mapping between inputs and outputs, thereby preserving all information without erasure.[4] This reversibility means that the gate's operation can be inverted to recover the original inputs from the outputs, contrasting with irreversible gates like AND or OR that discard information.[4] In the context of classical bits, these gates permute the $2^n possible input states for n bits, represented mathematically as permutation matrices—orthogonal matrices with exactly one 1 in each row and column.[5] The concept of reversible computation, foundational to these gates, was formalized by Charles Bennett in 1973 to address energy dissipation in computing devices, showing that logical reversibility allows arbitrary computations with minimal thermodynamic cost by avoiding information loss.[6] Bennett demonstrated that any irreversible computation can be simulated reversibly with modest overhead in space and time, laying the groundwork for low-power classical and later quantum systems.[6] A fundamental example is the NOT gate, which operates on a single bit by inverting its value: 0 becomes 1, and 1 becomes 0.[4] Its truth table is:| Input | Output |
|---|---|
| 0 | 1 |
| 1 | 0 |
| Control | Target | Output Control | Output Target |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 |
| a | b | c | Output a | Output b | Output c |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 0 |