Skip to content

YijiawWang/gate_decompose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iso_peps_to_circuit

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.

Directory structure

  • circuit_optimize/: Code for optimizing unitary gate decompositions
  • circuit_simulation/: Code for simulating and analyzing circuits
  • gates/: Gates and decomposed circuits
  • samples/: Sampled images

Basic workflow

  1. Convert iso-PEPS tensors to unitary gates:

    cd circuit_optimize
    python3 iso_to_uni.py          # writes tensors to ../gates/unitary_gates/
  2. Optimize per-gate U3+MS decompositions:

    cd circuit_optimize
    python3 optimize_unitary_gates.py   # writes ../gates/decomposed_gates/gate_index{i}/
  3. Simulate the decomposed circuit, compute the nll and sample:

    cd circuit_simulation
    python3 nll_circuit.py
    # prints NLL and saves images to ../samples/
  4. 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/
  5. Simulate the final optimized circuit:

    cd circuit_simulation
    python3 circuit_simulation.py      # no noise
    python3 noisy_circuit_simulation.py # with noise

Gate set

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))

Dependencies

  • Python 3.8+
  • PyTorch
  • NumPy, SciPy
  • Matplotlib
  • Qiskit (core) and qiskit-aer
  • Pyomo + SCIP (only required for optimize_circuit_layout.py)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published