projekter/yquant

yquantimport for groups?

amirebrahimi opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
Perhaps this is already possible, but I couldn't figure it out from the docs. I want to be able to set two circuits equal to each other in a figure and have those circuits come from files.

Describe the solution you'd like
Something equivalent to \yquantimport, but with a yquantgroup environment`.

Describe alternatives you've considered
For now, I'm doing something like:

\begin{figure}[H]
        \centering
              \yquantimport[]{file} = \yquantimport[]{other_file}
\end{figure}

Something like this is already possible. You can use \yquantimport within circuits to only import parts of a circuit. So the following will work:

\documentclass{article}

\usepackage[compat=0.6]{yquant}
\useyquantlanguage{groups}

\begin{document}
   \begin{tikzpicture}
      \begin{yquantgroup}
         \registers{
            qubit a;
            qubit b;
         }
         \circuit{
            \yquantimport{testa.circ}
         }
         \equals
         \circuit{
            \yquantimport{testb.circ}
         }
      \end{yquantgroup}
   \end{tikzpicture}
\end{document}

And then in testa.circ, you just write the plain circuit, for example:

cnot a | b;
box {\vrule height 2cm} a;
h b;

But maybe this is not what you had in mind, then please describe what you would like to have.

This is sufficient. Thank you.