Skip to content

Latest commit

 

History

History
63 lines (59 loc) · 1004 Bytes

README.md

File metadata and controls

63 lines (59 loc) · 1004 Bytes

qasm2circ-tex

LaTeX integration of qasm2circ. Tested on Overleaf. Note that this implementation is UNOFFICIAL.

Requirements

  • Python 2
  • pdflatex

Usage

usepackage

\usepackage{qasm2circ}

Inline qasm

\begin{qasm}[teleport]
    qubit a,\psi
    qubit b,0
    qubit c,0
    def c-X,1,'X'
    def c-Z,1,'Z'
    H b
    cnot b,c
    cnot a,b
    H a
    nop b
    measure a
    measure b
    c-X b,c
    c-Z a,c
\end{qasm}

Define qasm and use

\begin{defqasm}[teleport]
    qubit a,\psi
    qubit b,0
    qubit c,0
    def c-X,1,'X'
    def c-Z,1,'Z'
    H b
    cnot b,c
    cnot a,b
    H a
    nop b
    measure a
    measure b
    c-X b,c
    c-Z a,c
\end{defqasm}

For usage:

\useqasm{teleport}

or

\includegraphics[valign=c, max width=0.4\textwidth, max height=0.2\textheight]{\useqasmpdf{teleport}}

Acknowledgements

qasm2circ