Package com.quantum4j.examples
package com.quantum4j.examples
-
ClassesClassDescriptionCreates a Bell state |Φ+> and measures it to demonstrate entanglement.Bell state demonstration.Basic circuit construction: create a circuit, add gates/measurements, and print instructions.Demonstrates ASCII and SVG rendering of a simple circuit.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.Demonstrates the GateCommutationPass by showing before/after instruction order for commuting gates.Showcases common gates: single-qubit, rotations, controlled, and U-gates.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).Shows that applying QFT followed by inverse QFT returns the original basis state.Demonstrates exporting a circuit to OpenQASM 2.0 and importing it back.Demonstrates QASM export/import round-trip.Demonstrates QFT on a few basis states and prints the resulting statevector amplitudes.QFT(3) amplitudes for basis states |001>, |010>, |111>.Demonstrates running a simple circuit, collecting counts, and inspecting the state before measurement.Teleportation of |psi> = H|0> to qubit 2 using coherent corrections.Demonstrates running individual transpiler passes and printing before/after instruction counts.Demonstrates a simple transpiler pipeline.Generates ASCII (raw + pretty) and SVG diagrams for canonical circuits, compares raw against golden fixtures, and writes outputs to examples-out/.