An open API service indexing awesome lists of open source software.

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.

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_1

positional arguments:
depth Depth of unary gate chain
slant_0 Slant of the first qubit
slant_1 Slant of the second qubit

options:
-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