All Classes and Interfaces

Class
Description
Abstraction for executing quantum circuits.
Registry and factory for backend instances.
Supported backend implementations.
Decomposes U1/U2/U3 gates into the RX/RY/RZ basis (and preserves measurements).
Creates a Bell state |Φ+> and measures it to demonstrate entanglement.
Bell state demonstration.
Removes adjacent pairs of H gates on the same qubit (H followed by H is identity).
A transpiler pass that cancels consecutive pairs of X gates on the same qubit.
Removes adjacent pairs of Z gates on the same qubit.
Toffoli (Controlled-Controlled-X or CCX) quantum gate.
Controlled Hadamard (CH) quantum gate.
Deterministic ASCII renderer with raw (ASCII-safe) and pretty (Unicode) modes.
Basic circuit construction: create a circuit, add gates/measurements, and print instructions.
Demonstrates ASCII and SVG rendering of a simple circuit.
SVG renderer with dynamic gate box widths and short labels (tooltips carry full params).
CNOT (Controlled-NOT) quantum gate.
Immutable representation of a complex number.
Peephole optimization: CX(a,b); CX(a,b) ==> (removed) Used to reduce circuit depth and simplify transpilation before routing.
Transpiler pass that decomposes CX/CNOT into: H(target) + CZ(control, target) + H(target) This pass is intentionally robust: it detects CNOT even if the gate did not originate from StandardGates.CNOTGate.
Controlled-Z (CZ) quantum gate.
Default transpiler pipeline for Quantum4J.
Runs the default transpiler pipeline on a sample circuit and prints before/after instruction counts.
Deutsch's algorithm demonstrating constant vs balanced oracle.
Shows how Quantum4J reports illegal arguments (invalid qubit indices).
Builds canonical example circuits, renders ASCII/SVG, writes golden ASCII snapshots, and verifies deterministic ASCII output.
Interface representing a quantum gate.
Demonstrates the GateCommutationPass by showing before/after instruction order for commuting gates.
Local commutation optimizer.
Produces the inverse (adjoint) of the unitary prefix of a circuit.
Showcases common gates: single-qubit, rotations, controlled, and U-gates.
Pre-computed matrix representations for standard quantum gates.
Maps gates to plain ASCII labels for rendering.
GHZ state demonstration on 3 qubits.
Builds a 3-qubit GHZ state and measures it.
Two-qubit Grover search marking |11> with a single iteration.
Submit a small 2-qubit Grover circuit to a hardware backend (IonQ).
Hardware backend abstraction.
Minimal HTTP helper for hardware backends.
 
Represents a single instruction in a quantum circuit.
Type of instruction: GATE or MEASURE.
Shows that applying QFT followed by inverse QFT returns the original basis state.
IonQ hardware backend using OpenQASM 2.0 submission.
iSWAP (imaginary SWAP) quantum gate.
Manages and applies a sequence of transpiler passes to a quantum circuit.
Shows how invalid QASM inputs are rejected with clear exceptions.
Exports a small circuit (Bell + U3) to OpenQASM 2.0 and prints the result.
Exports QuantumCircuit objects to OpenQASM 2.0.
Imports a raw OpenQASM 2.0 string and prints the resulting instruction list.
Strict OpenQASM 2.0 importer for Quantum4J.
 
Demonstrates deterministic export/import/export round-trip of a circuit.
Demonstrates exporting a circuit to OpenQASM 2.0 and importing it back.
Demonstrates QASM export/import round-trip.
Imports QASM, runs the default transpiler, and exports back to QASM.
Quantum Fourier Transform (QFT) and inverse QFT (IQFT) circuit builders.
Demonstrates QFT on a few basis states and prints the resulting statevector amplitudes.
QFT(3) amplitudes for basis states |001>, |010>, |111>.
 
Lightweight container describing an execution request.
 
Immutable container for quantum circuit execution results.
Fuses consecutive same-axis rotations (RZ, RX, RY) on the same qubit by summing angles.
Configuration for quantum circuit execution.
Rotation around the X-axis (Rx(θ)) quantum gate.
Rotation around the Y-axis (Ry(θ)) quantum gate.
Rotation around the Z-axis (Rz(θ)) quantum gate.
Demonstrates running a simple circuit, collecting counts, and inspecting the state before measurement.
Abstract base class for single-qubit gates.
Factory class providing standard single- and two-qubit gates.
 
 
 
 
 
 
 
 
 
 
 
 
U1(λ): [[1, 0], [0, e^{iλ}]]
U2(φ, λ) = U3(π/2, φ, λ)
U3(θ, φ, λ): [ cos(θ/2) , -e^{iλ} sin(θ/2) ] [ e^{iφ} sin(θ/2) , e^{i(φ+λ)} cos(θ/2) ]
 
 
 
Mutable representation of a quantum state vector.
State-vector simulator backend for quantum circuits.
Decomposes SWAP gates into the canonical 3-CX sequence:
SWAP quantum gate.
Teleportation of |psi> = H|0> to qubit 2 using coherent corrections.
Abstract base class for three-qubit gates.
A transpiler pass that transforms a quantum circuit.
Demonstrates running individual transpiler passes and printing before/after instruction counts.
Demonstrates a simple transpiler pipeline.
Abstract base class for two-qubit gates.
Decomposes U1/U2/U3 gates into native rotations:
Quantum4J library version information.
Generates ASCII (raw + pretty) and SVG diagrams for canonical circuits, compares raw against golden fixtures, and writes outputs to examples-out/.