https://github.com/kmilkevych/qcgen
A tool for generating simple, slanted quantum circuits for noies experiments.
https://github.com/kmilkevych/qcgen
Last synced: 7 months ago
JSON representation
A tool for generating simple, slanted quantum circuits for noies experiments.
- Host: GitHub
- URL: https://github.com/kmilkevych/qcgen
- Owner: KMilkevych
- Created: 2024-12-03T09:55:51.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-12-03T09:59:38.000Z (11 months ago)
- Last Synced: 2025-02-01T07:44:42.653Z (9 months ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+title: Readme
A tool for generating slanted circuits consisting of two qubits with the same length of unary gates and a single swap gate (3 cx-gates) inserted at different positions in the unary gate chains.
* Dependencies
Requires Qiskit:
#+begin_src sh
pip install qiskit>=1.0
#+end_src
* Options
#+begin_src
usage: qcgen.py [-h] [-p {guadalupe,tenerife,cambridge}] [-o OUTPUT]
depth slant_0 slant_1positional arguments:
depth Depth of unary gate chain
slant_0 Slant of the first qubit
slant_1 Slant of the second qubitoptions:
-h, --help show this help message and exit
-p {guadalupe,tenerife,cambridge}, --platform {guadalupe,tenerife,cambridge}
Transpile circuit to platform
-o OUTPUT, --output OUTPUT
#+end_src* Usage
To generate a slanted circuit and save it to a file, use:
#+begin_src sh
./qcgen.py 8 2 6 --platform guadalupe --output guad_8_2_6.qasm
#+end_src
The above produces a circuit of total depth 8, with 2 unary gates before the swap gate on the first qubit, and 6 unary gates before the swap gate on the second qubit: 2 unary gates before the swap gate on the first qubit, and 6 unary gates before the swap gate on the second qubit:
#+begin_src
┌─────────┐┌─────────┐ ┌───┐ ┌─────────┐┌─────────┐┌─────────┐┌─────────┐┌─────────┐┌─────────┐
q_0: ┤ Rz(π/4) ├┤ Rz(π/4) ├──────────────────────────────────────────────■──┤ X ├──■──┤ Rz(π/4) ├┤ Rz(π/4) ├┤ Rz(π/4) ├┤ Rz(π/4) ├┤ Rz(π/4) ├┤ Rz(π/4) ├
├─────────┤├─────────┤┌─────────┐┌─────────┐┌─────────┐┌─────────┐┌─┴─┐└─┬─┘┌─┴─┐├─────────┤├─────────┤└─────────┘└─────────┘└─────────┘└─────────┘
q_1: ┤ Rz(π/4) ├┤ Rz(π/4) ├┤ Rz(π/4) ├┤ Rz(π/4) ├┤ Rz(π/4) ├┤ Rz(π/4) ├┤ X ├──■──┤ X ├┤ Rz(π/4) ├┤ Rz(π/4) ├────────────────────────────────────────────
└─────────┘└─────────┘└─────────┘└─────────┘└─────────┘└─────────┘└───┘ └───┘└─────────┘└─────────┘
#+end_src