# How to change \slice{} color on quantikz

Within quantikz package there's this possibility to put a single slice to separate two columns, through the command \slice{}.

By default it is colored in red and no standard command allows to change that.

Can someone explain me how can I overcome this problem, even by changing the package itself if necessary. Which I believe is this one.

Below a simple example; a circuit of four steps but with a slice only in the middle.

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{quantikz}

\begin{document}

\begin{quantikz}[slice style=blue]
\gate{X} & \gate{I} & \slice{1}\gate{I} & \gate{Y}
\end{quantikz}

\end{document}


• Welcome to the TeX.SE. community. Please can you put a minimal working example of your idea? Thank you in advance. Oct 14, 2021 at 22:07

You can just put it in the optional argument of \slice:

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{quantikz}

\begin{document}

\begin{quantikz}[]
\gate{X} & \gate{I} & \slice[style=blue]{1}\gate{I} & \gate{Y}
\end{quantikz}

\end{document}


You can change it using slice/.append style, as below.

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{quantikz}
\tikzset{slice/.append style={draw=blue}}
\begin{document}
\begin{quantikz}
\gate{X} & \gate{I} & \slice{1}\gate{I} & \gate{Y}
\end{quantikz}
\end{document}