0

I am using latex in Ubuntu 22.04. I have been trying to generate quantum circuits using quantikz. I have been reading the documentation and they import the package as:

\usepackage{tikz}

\usetikzlibrary{quantikz2}

the problem is that this does not work on my computer. Any idea on what could be the problem? What do I need to do?

I am using texlive, latexmk.

4
  • Welcome. // Is everything installed on your system, e.g. via a packet manager?
    – MS-SPO
    Commented Mar 28 at 7:38
  • 4
    I don't know the TeX Live version of Ubuntu 22.04. And I also don't know, what “does not work on my computer” mean. If the computer does not explode, you should get an error message and therefore show it. However, users of ubuntu texlive package often use a more or less old version. And quantikz2 is quite new (AFAIK first release 2023). So I guess: You need either a manual installation of quantikz (and maybe a manual update of several other parts, which can be a hard job to do) or a vanilla TeX Live installation.
    – cabohah
    Commented Mar 28 at 7:38
  • 1
    Another alternative could be to use quantikz instead of quantikz2. This should be available also as part of older TeX distributions. But we don't know if this would be an option, because you have not shown how you've used quantikz.
    – cabohah
    Commented Mar 28 at 7:44
  • 1
    Hi, thanks for replying. I got an error: ! Package tikz Error: I did not find the tikz library 'quantikz2'. I looked for files named tikzlibraryquantikz2.code.tex and pgflibraryquantikz2.code.tex, bu t neither could be found in the current texmf trees.. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.8 \usetikzlibrary{quantikz2} ? I have downloaded those files, but I am not sure where to place them. Commented Mar 28 at 7:52

1 Answer 1

0

Make sure your TeX installation is up-to-date. Try running tlmgr install quantikz for TeXLive installation. You may need to run tlmgr init-usertree for the first time you use tlmgr.

For MiKTeX, use its package management console to install the required package.

3
  • 2
    tlmgr install … does only work, if the installed TeX Live is the same version as the repository version.
    – cabohah
    Commented Mar 28 at 8:30
  • They provide update scripts as well. See this discussion as well.
    – codeR
    Commented Mar 28 at 9:02
  • 1
    This is something completely different. Note: 1. You cannot use tlmgr to install packages from TeX Live 2024 distribution (which is the current version), e.g., into a TeX Live 2020 distribution. 2. Only advanced users should use tlmgr to upgrade from one TeX Live release to another. 3. You should never use tlmgr to upgade a Linux distribution texlive packages to a new vanilla texlive release. It usually will fail. 4. The user tree cannot be used to upgrade one TeX Live release to another TeX live release. So no, I don't think, that this answers is useful.
    – cabohah
    Commented Mar 28 at 9:11

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