This directory contains the code that converts an iso-PEPS tensor network on a lattice into a quantum circuit, and then simulates / analyzes that circuit in Qiskit.
circuit_optimize/: Code for optimizing unitary gate decompositionscircuit_simulation/: Code for simulating and analyzing circuitsgates/: Gates and decomposed circuitssamples/: Sampled images
-
Convert iso-PEPS tensors to unitary gates:
cd circuit_optimize python3 iso_to_uni.py # writes tensors to ../gates/unitary_gates/
-
Optimize per-gate U3+MS decompositions:
cd circuit_optimize python3 optimize_unitary_gates.py # writes ../gates/decomposed_gates/gate_index{i}/
-
Simulate the decomposed circuit, compute the nll and sample:
cd circuit_simulation python3 nll_circuit.py # prints NLL and saves images to ../samples/
-
Build the optimized circuit and merge consecutive U3 gates:
cd circuit_optimize python3 build_entire_circuit.py # builds circuit from decomposed gates, merges U3 gates, saves to ../gates/final_circuit/
-
Simulate the final optimized circuit:
cd circuit_simulation python3 circuit_simulation.py # no noise python3 noisy_circuit_simulation.py # with noise
The circuit uses:
- U3 gates: Universal single-qubit gates with 3 parameters (theta, phi, lam)
- MS gates: Mølmer-Sørensen two-qubit gates, defined as MS(θ) = exp(-i * θ/4 * (X⊗X + Y⊗Y))
- Python 3.8+
- PyTorch
- NumPy, SciPy
- Matplotlib
- Qiskit (core) and
qiskit-aer - Pyomo + SCIP (only required for
optimize_circuit_layout.py)