Efficient Decoherence Control Algorithms

7 Software

Various authors have written packages that allow to typeset quantum circuits with the help of TEX or LATEX macros. The drawback of such an approach is that the memory consumption for drawing within native TEX is quite high, and one can easily exceed the capacity of TEX. We generate postscript figures with the help of METAPOST, a lesser known variant of the METAFONT system that has a postscript backend.

We have used the powerful macro capabilities of METAPOST to create a little language that allows to specify quantum circuits in a logical fashion. The system can be use in a standalone mode or can be integrate with TEX or LATEXusing the embedded metapost package. For example,

 \documentclass{article} \usepackage{emp}  
\begin{document} \empprelude{input qcg; prologues :=0;}  
\begin{empfile} \begin{emp}(50,50) input qcg.mp  
  qubits(2);  
  cnot(icnd 0, gpos 1);  
  circuit(0.8cm)(gpos 0,1, btex $U$ etex);  
  cnot(ocnd 1, gpos 0);  
  gate(gpos 0, btex $Y$ etex, 1, btex $H$ etex);  
  measure(0,1);  
\end{emp}  
\end{empfile}  
\end{document}

yields PIC

The qcg typesetting package is freely available at qcg-dist.tgz