0

I cannot use qcircuit package in Springer Nature journal template, the latex template for Springer journal papers. It makes an error when I use that package in that template. Could anybody please help me?

4
  • Please include a minimal working example (MWE) that demonstrates your issue. And please share the actual error message that you're getting.
    – dedded
    Commented Nov 22, 2022 at 14:30
  • if asking about an error show the full error message from the log Commented Nov 22, 2022 at 14:31
  • 1
    Use standalone and \includegraphics. Commented Nov 22, 2022 at 19:12
  • Thank you for your feedback!! If the answer meets your requirement, please accept it by checking the green tickmark on left side of the answer. Commented Dec 22, 2022 at 21:29

1 Answer 1

1

The sn-jnl class loads the package program. From CTAN:

its main offering is a program environment; a programbox environment is available for fragments that must not break with the pages.

Unfortunately, it defines a command \push that conflicts with the qcircuit package. If you don't need such "programbox environment", you can avoid loading the package program.

Using the solution from disable loading the package program

% !TeX TS-program = pdflatex

\makeatletter% added <<<<<<<<<<<<<<<<
\disable@package@load{program}{}
\makeatother

\documentclass[pdflatex,sn-mathphys]{sn-jnl}

\usepackage{braket}
\usepackage{qcircuit}

\begin{document}

\centerline{%
        \Qcircuit @C=1em @!R {
            \lstick{\ket{x}}   &   \qw   &   \ctrl{1}   &   \qw   &   \rstick{\ket{x}}   \qw                     \\
            \lstick{\ket{y}}   &   \qw   &   \ctrl{1}   &   \qw   &   \rstick{\ket{y}}   \qw                     \\
            \lstick{\ket{z}}   &   \qw   &   \targ      &   \qw   &   \rstick{\ket{x \oplus (y \wedge z})} \qw
        }
}

\end{document}

a

1
  • Thank you very much. I worked for me and the problem solved! Commented Nov 29, 2022 at 5:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .