From d9c3d558c2acb8bf412fe81cea4d278c04a5041c Mon Sep 17 00:00:00 2001 From: JoshDumo Date: Fri, 25 Jun 2021 12:46:55 +0900 Subject: [PATCH] latex-source (and latex) circuit drawer support for standalone (and cleaner output) (#6483) * fixed issue 6447 to use standalone and fewer cleaner lines * blacking and removing comments * fixed cropping of latex image labels when initial_state is True * fixed scaling issue using scalebox. Improved label strings * blacked code * fixed deprecated gates in test_circuit_latex Co-authored-by: Luciano Bello Co-authored-by: Abby Mitchell Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- qiskit/visualization/latex.py | 62 +++++----- .../references/test_latex_4597.tex | 34 ++---- .../references/test_latex_big_gates.tex | 38 +++---- .../references/test_latex_cnot.tex | 36 ++---- .../references/test_latex_conditional.tex | 32 ++---- .../test_latex_creg_initial_false.tex | 34 ++---- .../test_latex_creg_initial_true.tex | 32 ++---- .../references/test_latex_cswap_rzz.tex | 36 ++---- .../references/test_latex_deep.tex | 28 ++--- .../references/test_latex_empty.tex | 28 ++--- .../references/test_latex_ghz_to_gate.tex | 36 ++---- .../references/test_latex_global_phase.tex | 32 ++---- .../references/test_latex_huge.tex | 106 ++++++++---------- .../references/test_latex_init_reset.tex | 30 ++--- .../references/test_latex_inst_with_cbits.tex | 42 +++---- .../references/test_latex_iqx.tex | 40 +++---- .../references/test_latex_long_name.tex | 36 ++---- .../references/test_latex_meas_condition.tex | 32 ++---- .../test_latex_no_barriers_false.tex | 32 ++---- .../references/test_latex_no_ops.tex | 32 ++---- .../references/test_latex_normal.tex | 36 ++---- .../references/test_latex_partial_layout.tex | 36 ++---- .../references/test_latex_pauli_clifford.tex | 36 ++---- .../references/test_latex_pi_param_expr.tex | 28 ++--- .../test_latex_plot_barriers_false.tex | 32 ++---- .../test_latex_plot_barriers_true.tex | 32 ++---- .../test_latex_plot_partial_barriers.tex | 32 ++---- .../references/test_latex_r_gates.tex | 34 ++---- .../references/test_latex_reverse_bits.tex | 32 ++---- .../references/test_latex_scale_default.tex | 36 ++---- .../references/test_latex_scale_double.tex | 36 ++---- .../references/test_latex_scale_half.tex | 36 ++---- .../references/test_latex_teleport.tex | 34 ++---- .../references/test_latex_tiny.tex | 28 ++--- .../references/test_latex_u_gates.tex | 34 ++---- .../visualization/test_circuit_latex.py | 8 +- 36 files changed, 434 insertions(+), 854 deletions(-) diff --git a/qiskit/visualization/latex.py b/qiskit/visualization/latex.py index 01c9a6c6d6ca..b4db84e82012 100644 --- a/qiskit/visualization/latex.py +++ b/qiskit/visualization/latex.py @@ -75,7 +75,7 @@ def __init__( self.ops = ops # image scaling - self.scale = 0.7 if scale is None else scale + self.scale = 1.0 if scale is None else scale # Map of qregs to sizes self.qregs = {} @@ -157,31 +157,24 @@ def latex(self): self._initialize_latex_array() self._build_latex_array() - header_1 = r"""% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -""" - beamer_line = "\\usepackage[size=custom,height=%d,width=%d,scale=%.1f]{beamerposter}\n" - header_2 = r"""% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. + header_1 = r"""\documentclass[border=2px]{standalone} + """ + + header_2 = r""" \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} +\usepackage{graphicx} + +\begin{document} """ + header_scale = "\\scalebox{{{}}}".format(self.scale) + "{" + qcircuit_line = r""" -\begin{equation*} - \Qcircuit @C=%.1fem @R=%.1fem @!R { +\Qcircuit @C=%.1fem @R=%.1fem @!R { \\ """ output = io.StringIO() output.write(header_1) - output.write("%% img_width = %d, img_depth = %d\n" % (self.img_width, self.img_depth)) - output.write(beamer_line % self._get_beamer_page()) output.write(header_2) + output.write(header_scale) if self.global_phase: output.write( r"""{$\mathrm{%s} \mathrm{%s}$}""" @@ -195,9 +188,8 @@ def latex(self): if j != self.img_depth: output.write(" & ") else: - output.write(r"\\" + "\n") - output.write("\t }\n") - output.write("\\end{equation*}\n\n") + output.write(r"\\ " + "\n") + output.write(r"\\ " + "}}\n") output.write("\\end{document}") contents = output.getvalue() output.close() @@ -228,24 +220,20 @@ def _initialize_latex_array(self): if isinstance(self.ordered_bits[i], Clbit): if self.cregbundle: reg = self.bit_locations[self.ordered_bits[i + offset]]["register"] - self._latex[i][0] = "\\lstick{" + reg.name + ":" + label = reg.name + ":" clbitsize = self.cregs[reg] self._latex[i][1] = "\\lstick{/_{_{" + str(clbitsize) + "}}} \\cw" offset += clbitsize - 1 else: - self._latex[i][0] = ( - "\\lstick{" - + self.bit_locations[self.ordered_bits[i]]["register"].name - + "_{" - + str(self.bit_locations[self.ordered_bits[i]]["index"]) - + "}:" - ) + label = self.bit_locations[self.ordered_bits[i]]["register"].name + "_{" + label += str(self.bit_locations[self.ordered_bits[i]]["index"]) + "}:" if self.initial_state: - self._latex[i][0] += "0" - self._latex[i][0] += "}" + label += "0" + label += "}" + self._latex[i][0] = "\\nghost{" + label + " & " + "\\lstick{" + label else: if self.layout is None: - label = "\\lstick{{ {{{}}}_{{{}}} : ".format( + label = " {{{}}}_{{{}}} : ".format( self.bit_locations[self.ordered_bits[i]]["register"].name, self.bit_locations[self.ordered_bits[i]]["index"], ) @@ -257,17 +245,17 @@ def _initialize_latex_array(self): virt_reg = next( reg for reg in self.layout.get_registers() if virt_bit in reg ) - label = "\\lstick{{ {{{}}}_{{{}}}\\mapsto{{{}}} : ".format( + label = " {{{}}}_{{{}}}\\mapsto{{{}}} : ".format( virt_reg.name, virt_reg[:].index(virt_bit), bit_location["index"] ) except StopIteration: - label = "\\lstick{{ {{{}}} : ".format(bit_location["index"]) + label = " {{{}}} : ".format(bit_location["index"]) else: - label = "\\lstick{{ {{{}}} : ".format(bit_location["index"]) + label = " {{{}}} : ".format(bit_location["index"]) if self.initial_state: label += "\\ket{{0}}" label += " }" - self._latex[i][0] = label + self._latex[i][0] = "\\nghost{" + label + " & " + "\\lstick{" + label def _get_image_depth(self): """Get depth information for the circuit.""" diff --git a/test/python/visualization/references/test_latex_4597.tex b/test/python/visualization/references/test_latex_4597.tex index 5262924d3c7b..1cd225023326 100644 --- a/test/python/visualization/references/test_latex_4597.tex +++ b/test/python/visualization/references/test_latex_4597.tex @@ -1,26 +1,14 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 4, img_depth = 4 -\usepackage[size=custom,height=10,width=10,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{1} : } & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{2} : } & \qw & \gate{\mathrm{X}} & \qw & \qw\\ - \lstick{c:} & \lstick{/_{_{3}}} \cw & \dstick{_{_{=2}}} \cw \cwx[-1] & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \qw & \gate{\mathrm{X}} & \qw & \qw\\ + \nghost{c:} & \lstick{c:} & \lstick{/_{_{3}}} \cw & \dstick{_{_{=2}}} \cw \cwx[-1] & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_big_gates.tex b/test/python/visualization/references/test_latex_big_gates.tex index f6a0bf86365b..cdd25ebc217c 100644 --- a/test/python/visualization/references/test_latex_big_gates.tex +++ b/test/python/visualization/references/test_latex_big_gates.tex @@ -1,28 +1,16 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 6, img_depth = 4 -\usepackage[size=custom,height=10,width=40,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=1.0em @!R { - \lstick{ {q}_{0} : } & \multigate{2}{\mathrm{iqp:[[6\,5\,3];\,[5\,4\,5];\,[3\,5\,1]]}}_<<<{0} & \gate{\mathrm{Unitary}} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \ghost{\mathrm{iqp:[[6\,5\,3];\,[5\,4\,5];\,[3\,5\,1]]}}_<<<{1} & \multigate{1}{\mathrm{Hamiltonian}}_<<<{0} & \qw & \qw\\ - \lstick{ {q}_{2} : } & \ghost{\mathrm{iqp:[[6\,5\,3];\,[5\,4\,5];\,[3\,5\,1]]}}_<<<{2} & \ghost{\mathrm{Hamiltonian}}_<<<{1} & \qw & \qw\\ - \lstick{ {q}_{3} : } & \multigate{2}{|\psi\rangle\,\mathrm{(}\mathrm{0.25\jmath},\mathrm{0.3536},\mathrm{0.25+0.25\jmath},\mathrm{0},...\mathrm{)}}_<<<{0} & \multigate{1}{\mathrm{Isometry}}_<<<{0} & \qw & \qw\\ - \lstick{ {q}_{4} : } & \ghost{|\psi\rangle\,\mathrm{(}\mathrm{0.25\jmath},\mathrm{0.3536},\mathrm{0.25+0.25\jmath},\mathrm{0},...\mathrm{)}}_<<<{1} & \ghost{\mathrm{Isometry}}_<<<{1} & \qw & \qw\\ - \lstick{ {q}_{5} : } & \ghost{|\psi\rangle\,\mathrm{(}\mathrm{0.25\jmath},\mathrm{0.3536},\mathrm{0.25+0.25\jmath},\mathrm{0},...\mathrm{)}}_<<<{2} & \qw & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=1.0em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \multigate{2}{\mathrm{iqp:[[6\,5\,3];\,[5\,4\,5];\,[3\,5\,1]]}}_<<<{0} & \gate{\mathrm{Unitary}} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \ghost{\mathrm{iqp:[[6\,5\,3];\,[5\,4\,5];\,[3\,5\,1]]}}_<<<{1} & \multigate{1}{\mathrm{Hamiltonian}}_<<<{0} & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \ghost{\mathrm{iqp:[[6\,5\,3];\,[5\,4\,5];\,[3\,5\,1]]}}_<<<{2} & \ghost{\mathrm{Hamiltonian}}_<<<{1} & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \multigate{2}{|\psi\rangle\,\mathrm{(}\mathrm{0.25\jmath},\mathrm{0.3536},\mathrm{0.25+0.25\jmath},\mathrm{0},...\mathrm{)}}_<<<{0} & \multigate{1}{\mathrm{Isometry}}_<<<{0} & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \ghost{|\psi\rangle\,\mathrm{(}\mathrm{0.25\jmath},\mathrm{0.3536},\mathrm{0.25+0.25\jmath},\mathrm{0},...\mathrm{)}}_<<<{1} & \ghost{\mathrm{Isometry}}_<<<{1} & \qw & \qw\\ + \nghost{ {q}_{5} : } & \lstick{ {q}_{5} : } & \ghost{|\psi\rangle\,\mathrm{(}\mathrm{0.25\jmath},\mathrm{0.3536},\mathrm{0.25+0.25\jmath},\mathrm{0},...\mathrm{)}}_<<<{2} & \qw & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_cnot.tex b/test/python/visualization/references/test_latex_cnot.tex index eab804e87b0a..72569cea4973 100644 --- a/test/python/visualization/references/test_latex_cnot.tex +++ b/test/python/visualization/references/test_latex_cnot.tex @@ -1,27 +1,15 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 5, img_depth = 7 -\usepackage[size=custom,height=10,width=16,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \ctrl{1} & \ctrl{1} & \ctrlo{1} & \ctrl{1} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \qw & \targ & \ctrl{1} & \targ & \ctrlo{1} & \qw & \qw\\ - \lstick{ {q}_{2} : } & \qw & \qw & \targ & \ctrlo{-1} & \ctrl{2} & \qw & \qw\\ - \lstick{ {q}_{3} : } & \qw & \qw & \qw & \ctrl{-1} & \qw & \qw & \qw\\ - \lstick{ {q}_{4} : } & \qw & \qw & \qw & \qw & \targ & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \ctrl{1} & \ctrl{1} & \ctrlo{1} & \ctrl{1} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \qw & \targ & \ctrl{1} & \targ & \ctrlo{1} & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \qw & \qw & \targ & \ctrlo{-1} & \ctrl{2} & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \qw & \qw & \qw & \ctrl{-1} & \qw & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \qw & \qw & \qw & \qw & \targ & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_conditional.tex b/test/python/visualization/references/test_latex_conditional.tex index f5c1e13e4da1..7e19e3eac95e 100644 --- a/test/python/visualization/references/test_latex_conditional.tex +++ b/test/python/visualization/references/test_latex_conditional.tex @@ -1,25 +1,13 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 3, img_depth = 6 -\usepackage[size=custom,height=10,width=15,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \meter & \qw & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \meter & \qw & \qw & \qw\\ - \lstick{c:} & \lstick{/_{_{2}}} \cw & \dstick{_{_{0}}} \cw \cwx[-2] & \dstick{_{_{1}}} \cw \cwx[-1] & \dstick{_{_{=2}}} \cw \cwx[-2] & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \meter & \qw & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \meter & \qw & \qw & \qw\\ + \nghost{c:} & \lstick{c:} & \lstick{/_{_{2}}} \cw & \dstick{_{_{0}}} \cw \cwx[-2] & \dstick{_{_{1}}} \cw \cwx[-1] & \dstick{_{_{=2}}} \cw \cwx[-2] & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_creg_initial_false.tex b/test/python/visualization/references/test_latex_creg_initial_false.tex index bb9b2c44655e..87ac82713295 100644 --- a/test/python/visualization/references/test_latex_creg_initial_false.tex +++ b/test/python/visualization/references/test_latex_creg_initial_false.tex @@ -1,26 +1,14 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 4, img_depth = 4 -\usepackage[size=custom,height=10,width=12,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{X}} & \qw & \qw & \qw\\ - \lstick{c_{0}:} & \cw & \cw & \cw & \cw\\ - \lstick{c_{1}:} & \cw & \cw & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{X}} & \qw & \qw & \qw\\ + \nghost{c_{0}:} & \lstick{c_{0}:} & \cw & \cw & \cw & \cw\\ + \nghost{c_{1}:} & \lstick{c_{1}:} & \cw & \cw & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_creg_initial_true.tex b/test/python/visualization/references/test_latex_creg_initial_true.tex index a35437dfe787..de02ba28977e 100644 --- a/test/python/visualization/references/test_latex_creg_initial_true.tex +++ b/test/python/visualization/references/test_latex_creg_initial_true.tex @@ -1,25 +1,13 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 3, img_depth = 4 -\usepackage[size=custom,height=10,width=12,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : \ket{{0}} } & \gate{\mathrm{X}} & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{1} : \ket{{0}} } & \gate{\mathrm{X}} & \qw & \qw & \qw\\ - \lstick{c:0} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : \ket{{0}} } & \lstick{ {q}_{0} : \ket{{0}} } & \gate{\mathrm{X}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{1} : \ket{{0}} } & \lstick{ {q}_{1} : \ket{{0}} } & \gate{\mathrm{X}} & \qw & \qw & \qw\\ + \nghost{c:0} & \lstick{c:0} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_cswap_rzz.tex b/test/python/visualization/references/test_latex_cswap_rzz.tex index 6f26a8b1dcb3..a5f21e41d499 100644 --- a/test/python/visualization/references/test_latex_cswap_rzz.tex +++ b/test/python/visualization/references/test_latex_cswap_rzz.tex @@ -1,27 +1,15 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 5, img_depth = 8 -\usepackage[size=custom,height=10,width=16,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \ctrl{1} & \control \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{X}} & \qswap & \ctrl{-1} & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{2} : } & \qw & \qswap \qwx[-1] & \ctrlo{-1} & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{3} : } & \qw & \qw & \ctrl{-3} & \dstick{\hspace{2.0em}\mathrm{ZZ}\,\mathrm{(}\mathrm{\frac{3\pi}{4}}\mathrm{)}} \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{4} : } & \qw & \qw & \ctrlo{-1} & \qw & \qw & \qw & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \ctrl{1} & \control \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{X}} & \qswap & \ctrl{-1} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \qw & \qswap \qwx[-1] & \ctrlo{-1} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \qw & \qw & \ctrl{-3} & \dstick{\hspace{2.0em}\mathrm{ZZ}\,\mathrm{(}\mathrm{\frac{3\pi}{4}}\mathrm{)}} \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \qw & \qw & \ctrlo{-1} & \qw & \qw & \qw & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_deep.tex b/test/python/visualization/references/test_latex_deep.tex index d486deabb29a..dd3f8732d560 100644 --- a/test/python/visualization/references/test_latex_deep.tex +++ b/test/python/visualization/references/test_latex_deep.tex @@ -1,23 +1,11 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 1, img_depth = 102 -\usepackage[size=custom,height=10,width=159,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_empty.tex b/test/python/visualization/references/test_latex_empty.tex index a7a4910a062a..a27135698c67 100644 --- a/test/python/visualization/references/test_latex_empty.tex +++ b/test/python/visualization/references/test_latex_empty.tex @@ -1,23 +1,11 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 1, img_depth = 2 -\usepackage[size=custom,height=10,width=10,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=1.0em @!R { - \lstick{ {q}_{0} : } & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=1.0em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_ghz_to_gate.tex b/test/python/visualization/references/test_latex_ghz_to_gate.tex index be33d48d3915..0a4ec22338d0 100644 --- a/test/python/visualization/references/test_latex_ghz_to_gate.tex +++ b/test/python/visualization/references/test_latex_ghz_to_gate.tex @@ -1,27 +1,15 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 5, img_depth = 3 -\usepackage[size=custom,height=10,width=10,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \ctrl{1} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \multigate{2}{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{0} & \qw & \qw\\ - \lstick{ {q}_{2} : } & \ghost{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{2} & \qw & \qw\\ - \lstick{ {q}_{3} : } & \ghost{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{1} & \qw & \qw\\ - \lstick{ {q}_{4} : } & \ctrlo{-1} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \ctrl{1} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \multigate{2}{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{0} & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \ghost{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{2} & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \ghost{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{1} & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \ctrlo{-1} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_global_phase.tex b/test/python/visualization/references/test_latex_global_phase.tex index a02ebff3fd27..15cca8b98461 100644 --- a/test/python/visualization/references/test_latex_global_phase.tex +++ b/test/python/visualization/references/test_latex_global_phase.tex @@ -1,25 +1,13 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 3, img_depth = 3 -\usepackage[size=custom,height=10,width=10,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} -{$\mathrm{global\,phase:\,} \mathrm{\frac{\pi}{2}}$} -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{2} : } & \gate{\mathrm{H}} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{{$\mathrm{global\,phase:\,} \mathrm{\frac{\pi}{2}}$} +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \gate{\mathrm{H}} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_huge.tex b/test/python/visualization/references/test_latex_huge.tex index bbc176f21657..660f99ea8e8b 100644 --- a/test/python/visualization/references/test_latex_huge.tex +++ b/test/python/visualization/references/test_latex_huge.tex @@ -1,62 +1,50 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 40, img_depth = 42 -\usepackage[size=custom,height=60,width=69,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \ctrl{39} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \ctrl{38} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{2} : } & \gate{\mathrm{H}} & \qw & \qw & \ctrl{37} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{3} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \ctrl{36} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{4} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \ctrl{35} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{5} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \ctrl{34} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{6} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{33} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{7} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{32} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{8} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{31} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{9} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{30} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{10} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{29} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{11} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{28} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{12} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{27} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{13} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{26} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{14} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{25} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{15} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{24} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{16} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{23} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{17} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{22} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{18} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{21} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{19} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{20} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{20} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{19} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{21} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{18} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{22} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{17} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{23} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{16} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{24} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{15} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{25} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{14} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{26} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{13} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{27} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{12} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{28} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{11} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{29} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{10} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{30} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{9} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{31} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{8} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{32} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{7} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{33} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{6} & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{34} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{5} & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{35} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{4} & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{36} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{3} & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{37} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{2} & \qw & \qw & \qw\\ - \lstick{ {q}_{38} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{1} & \qw & \qw\\ - \lstick{ {q}_{39} : } & \qw & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \ctrl{39} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \ctrl{38} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \gate{\mathrm{H}} & \qw & \qw & \ctrl{37} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \ctrl{36} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \ctrl{35} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{5} : } & \lstick{ {q}_{5} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \ctrl{34} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{6} : } & \lstick{ {q}_{6} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{33} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{7} : } & \lstick{ {q}_{7} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{32} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{8} : } & \lstick{ {q}_{8} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{31} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{9} : } & \lstick{ {q}_{9} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{30} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{10} : } & \lstick{ {q}_{10} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{29} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{11} : } & \lstick{ {q}_{11} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{28} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{12} : } & \lstick{ {q}_{12} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{27} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{13} : } & \lstick{ {q}_{13} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{26} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{14} : } & \lstick{ {q}_{14} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{25} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{15} : } & \lstick{ {q}_{15} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{24} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{16} : } & \lstick{ {q}_{16} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{23} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{17} : } & \lstick{ {q}_{17} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{22} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{18} : } & \lstick{ {q}_{18} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{21} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{19} : } & \lstick{ {q}_{19} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{20} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{20} : } & \lstick{ {q}_{20} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{19} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{21} : } & \lstick{ {q}_{21} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{18} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{22} : } & \lstick{ {q}_{22} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{17} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{23} : } & \lstick{ {q}_{23} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{16} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{24} : } & \lstick{ {q}_{24} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{15} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{25} : } & \lstick{ {q}_{25} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{14} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{26} : } & \lstick{ {q}_{26} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{13} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{27} : } & \lstick{ {q}_{27} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{12} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{28} : } & \lstick{ {q}_{28} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{11} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{29} : } & \lstick{ {q}_{29} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{10} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{30} : } & \lstick{ {q}_{30} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{9} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{31} : } & \lstick{ {q}_{31} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{8} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{32} : } & \lstick{ {q}_{32} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{7} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{33} : } & \lstick{ {q}_{33} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{6} & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{34} : } & \lstick{ {q}_{34} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{5} & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{35} : } & \lstick{ {q}_{35} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{4} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{36} : } & \lstick{ {q}_{36} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{3} & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{37} : } & \lstick{ {q}_{37} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{2} & \qw & \qw & \qw\\ + \nghost{ {q}_{38} : } & \lstick{ {q}_{38} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \ctrl{1} & \qw & \qw\\ + \nghost{ {q}_{39} : } & \lstick{ {q}_{39} : } & \qw & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \targ & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_init_reset.tex b/test/python/visualization/references/test_latex_init_reset.tex index 5270e1563c5e..738b88fbb632 100644 --- a/test/python/visualization/references/test_latex_init_reset.tex +++ b/test/python/visualization/references/test_latex_init_reset.tex @@ -1,24 +1,12 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 2, img_depth = 4 -\usepackage[size=custom,height=10,width=22,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=1.0em @!R { - \lstick{ {q}_{0} : } & \gate{|\psi\rangle\,\mathrm{(}\mathrm{0},\mathrm{1}\mathrm{)}} & \multigate{1}{|\psi\rangle\,\mathrm{(}\mathrm{0},\mathrm{1},\mathrm{0},\mathrm{0}\mathrm{)}}_<<<{0} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\left|0\right\rangle} & \ghost{|\psi\rangle\,\mathrm{(}\mathrm{0},\mathrm{1},\mathrm{0},\mathrm{0}\mathrm{)}}_<<<{1} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=1.0em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{|\psi\rangle\,\mathrm{(}\mathrm{0},\mathrm{1}\mathrm{)}} & \multigate{1}{|\psi\rangle\,\mathrm{(}\mathrm{0},\mathrm{1},\mathrm{0},\mathrm{0}\mathrm{)}}_<<<{0} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\left|0\right\rangle} & \ghost{|\psi\rangle\,\mathrm{(}\mathrm{0},\mathrm{1},\mathrm{0},\mathrm{0}\mathrm{)}}_<<<{1} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_inst_with_cbits.tex b/test/python/visualization/references/test_latex_inst_with_cbits.tex index 29f5ce9ae565..0491e37c7eb4 100644 --- a/test/python/visualization/references/test_latex_inst_with_cbits.tex +++ b/test/python/visualization/references/test_latex_inst_with_cbits.tex @@ -1,30 +1,18 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 8, img_depth = 3 -\usepackage[size=custom,height=12,width=10,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=1.0em @!R { - \lstick{ {qr}_{0} : } & \qw & \qw & \qw\\ - \lstick{ {qr}_{1} : } & \multigate{5}{\mathrm{instruction}}_<<<{0} & \qw & \qw\\ - \lstick{ {qr}_{2} : } & \ghost{\mathrm{instruction}}_<<<{1} & \qw & \qw\\ - \lstick{ {qr}_{3} : } & \ghost{\mathrm{instruction}} & \qw & \qw\\ - \lstick{cr_{0}:} & \cghost{\mathrm{instruction}} & \cw & \cw\\ - \lstick{cr_{1}:} & \cghost{\mathrm{instruction}}_<<<{1} & \cw & \cw\\ - \lstick{cr_{2}:} & \cghost{\mathrm{instruction}}_<<<{0} & \cw & \cw\\ - \lstick{cr_{3}:} & \cw & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=1.0em @!R { \\ + \nghost{ {qr}_{0} : } & \lstick{ {qr}_{0} : } & \qw & \qw & \qw\\ + \nghost{ {qr}_{1} : } & \lstick{ {qr}_{1} : } & \multigate{5}{\mathrm{instruction}}_<<<{0} & \qw & \qw\\ + \nghost{ {qr}_{2} : } & \lstick{ {qr}_{2} : } & \ghost{\mathrm{instruction}}_<<<{1} & \qw & \qw\\ + \nghost{ {qr}_{3} : } & \lstick{ {qr}_{3} : } & \ghost{\mathrm{instruction}} & \qw & \qw\\ + \nghost{cr_{0}:} & \lstick{cr_{0}:} & \cghost{\mathrm{instruction}} & \cw & \cw\\ + \nghost{cr_{1}:} & \lstick{cr_{1}:} & \cghost{\mathrm{instruction}}_<<<{1} & \cw & \cw\\ + \nghost{cr_{2}:} & \lstick{cr_{2}:} & \cghost{\mathrm{instruction}}_<<<{0} & \cw & \cw\\ + \nghost{cr_{3}:} & \lstick{cr_{3}:} & \cw & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_iqx.tex b/test/python/visualization/references/test_latex_iqx.tex index b609c199307a..deb5378a4524 100644 --- a/test/python/visualization/references/test_latex_iqx.tex +++ b/test/python/visualization/references/test_latex_iqx.tex @@ -1,29 +1,17 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 7, img_depth = 15 -\usepackage[size=custom,height=10,width=39,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \gate{\mathrm{X}} & \qw & \qw & \qw & \ctrl{1} & \ctrl{1} & \qswap & \ctrl{1} & \ctrl{1} & \multigate{1}{\mathrm{Dcx}}_<<<{0} & \ctrl{1} & \ctrl{1} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \qw & \qw & \qw & \qw & \qw & \targ & \ctrl{1} & \qswap \qwx[-1] & \qswap & \ctrl{1} & \ghost{\mathrm{Dcx}}_<<<{1} & \multigate{1}{\mathrm{Dcx}}_<<<{0} & \ctrl{1} & \qw & \qw\\ - \lstick{ {q}_{2} : } & \qw & \qw & \qw & \qw & \qw & \qw & \targ & \qw & \qswap \qwx[-1] & \qswap & \qw & \ghost{\mathrm{Dcx}}_<<<{1} & \multigate{1}{\mathrm{Dcx}}_<<<{0} & \qw & \qw\\ - \lstick{ {q}_{3} : } & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qswap \qwx[-1] & \qw & \qw & \ghost{\mathrm{Dcx}}_<<<{1} & \qw & \qw\\ - \lstick{ {q}_{4} : } & \gate{\mathrm{Z}} & \gate{\mathrm{S}} & \qw & \qw & \qw & \gate{\mathrm{S}^\dagger} & \gate{\mathrm{T}} & \gate{\mathrm{T}^\dagger} & \gate{\mathrm{P}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} & \gate{\mathrm{U}_1\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{5} : } & \ctrl{1} & \ctrl{1} & \dstick{\hspace{2.0em}\mathrm{U}_1\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} \qw & \qw & \qw & \gate{\mathrm{Y}} & \gate{\mathrm{R}_\mathrm{X}\,\mathrm{(}\mathrm{\frac{\pi}{3}}\mathrm{)}} & \multigate{1}{\mathrm{R}_{\mathrm{ZX}}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}}_<<<{0} & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{\frac{\pi}{2}},\mathrm{\frac{\pi}{2}}\mathrm{)}} \barrier[0em]{1} & \qw & \gate{\left|0\right\rangle} & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{6} : } & \control\qw & \control \qw & \qw & \qw & \qw & \qw & \qw & \ghost{\mathrm{R}_{\mathrm{ZX}}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}}_<<<{1} & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \gate{\mathrm{X}} & \qw & \qw & \qw & \ctrl{1} & \ctrl{1} & \qswap & \ctrl{1} & \ctrl{1} & \multigate{1}{\mathrm{Dcx}}_<<<{0} & \ctrl{1} & \ctrl{1} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \qw & \qw & \qw & \qw & \qw & \targ & \ctrl{1} & \qswap \qwx[-1] & \qswap & \ctrl{1} & \ghost{\mathrm{Dcx}}_<<<{1} & \multigate{1}{\mathrm{Dcx}}_<<<{0} & \ctrl{1} & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \qw & \qw & \qw & \qw & \qw & \qw & \targ & \qw & \qswap \qwx[-1] & \qswap & \qw & \ghost{\mathrm{Dcx}}_<<<{1} & \multigate{1}{\mathrm{Dcx}}_<<<{0} & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qw & \qswap \qwx[-1] & \qw & \qw & \ghost{\mathrm{Dcx}}_<<<{1} & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \gate{\mathrm{Z}} & \gate{\mathrm{S}} & \qw & \qw & \qw & \gate{\mathrm{S}^\dagger} & \gate{\mathrm{T}} & \gate{\mathrm{T}^\dagger} & \gate{\mathrm{P}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} & \gate{\mathrm{P}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{5} : } & \lstick{ {q}_{5} : } & \ctrl{1} & \ctrl{1} & \dstick{\hspace{2.0em}\mathrm{P}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} \qw & \qw & \qw & \gate{\mathrm{Y}} & \gate{\mathrm{R}_\mathrm{X}\,\mathrm{(}\mathrm{\frac{\pi}{3}}\mathrm{)}} & \multigate{1}{\mathrm{R}_{\mathrm{ZX}}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}}_<<<{0} & \gate{\mathrm{U}\,\mathrm{(}\mathrm{\frac{\pi}{2}},\mathrm{\frac{\pi}{2}},\mathrm{\frac{\pi}{2}}\mathrm{)}} \barrier[0em]{1} & \qw & \gate{\left|0\right\rangle} & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{6} : } & \lstick{ {q}_{6} : } & \control\qw & \control \qw & \qw & \qw & \qw & \qw & \qw & \ghost{\mathrm{R}_{\mathrm{ZX}}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}}_<<<{1} & \qw & \qw & \qw & \qw & \qw & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_long_name.tex b/test/python/visualization/references/test_latex_long_name.tex index d0252c1aff9b..2fe6c106ce9c 100644 --- a/test/python/visualization/references/test_latex_long_name.tex +++ b/test/python/visualization/references/test_latex_long_name.tex @@ -1,27 +1,15 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 5, img_depth = 5 -\usepackage[size=custom,height=10,width=25,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {veryLongQuantumRegisterName}_{0} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {veryLongQuantumRegisterName}_{1} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {veryLongQuantumRegisterName}_{2} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {veryLongQuantumRegisterName}_{3} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q0}_{0} : } & \qw & \qw & \qw & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {veryLongQuantumRegisterName}_{0} : } & \lstick{ {veryLongQuantumRegisterName}_{0} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {veryLongQuantumRegisterName}_{1} : } & \lstick{ {veryLongQuantumRegisterName}_{1} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {veryLongQuantumRegisterName}_{2} : } & \lstick{ {veryLongQuantumRegisterName}_{2} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {veryLongQuantumRegisterName}_{3} : } & \lstick{ {veryLongQuantumRegisterName}_{3} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q0}_{0} : } & \lstick{ {q0}_{0} : } & \qw & \qw & \qw & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_meas_condition.tex b/test/python/visualization/references/test_latex_meas_condition.tex index 2ab4d70fa992..b3fabab133cb 100644 --- a/test/python/visualization/references/test_latex_meas_condition.tex +++ b/test/python/visualization/references/test_latex_meas_condition.tex @@ -1,25 +1,13 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 3, img_depth = 5 -\usepackage[size=custom,height=10,width=13,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {qr}_{0} : } & \gate{\mathrm{H}} & \meter & \qw & \qw & \qw\\ - \lstick{ {qr}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{cr:} & \lstick{/_{_{2}}} \cw & \dstick{_{_{0}}} \cw \cwx[-2] & \dstick{_{_{=1}}} \cw \cwx[-1] & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {qr}_{0} : } & \lstick{ {qr}_{0} : } & \gate{\mathrm{H}} & \meter & \qw & \qw & \qw\\ + \nghost{ {qr}_{1} : } & \lstick{ {qr}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{cr:} & \lstick{cr:} & \lstick{/_{_{2}}} \cw & \dstick{_{_{0}}} \cw \cwx[-2] & \dstick{_{_{=1}}} \cw \cwx[-1] & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_no_barriers_false.tex b/test/python/visualization/references/test_latex_no_barriers_false.tex index f42ea532b252..c02df66760ef 100644 --- a/test/python/visualization/references/test_latex_no_barriers_false.tex +++ b/test/python/visualization/references/test_latex_no_barriers_false.tex @@ -1,25 +1,13 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 3, img_depth = 3 -\usepackage[size=custom,height=10,width=10,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{c:} & \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_no_ops.tex b/test/python/visualization/references/test_latex_no_ops.tex index f95a3ba4cc91..ce478cd7051d 100644 --- a/test/python/visualization/references/test_latex_no_ops.tex +++ b/test/python/visualization/references/test_latex_no_ops.tex @@ -1,25 +1,13 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 3, img_depth = 2 -\usepackage[size=custom,height=10,width=10,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=1.0em @!R { - \lstick{ {q}_{0} : } & \qw & \qw\\ - \lstick{ {q}_{1} : } & \qw & \qw\\ - \lstick{c:} & \lstick{/_{_{3}}} \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=1.0em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \qw & \qw\\ + \nghost{c:} & \lstick{c:} & \lstick{/_{_{3}}} \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_normal.tex b/test/python/visualization/references/test_latex_normal.tex index 8bf4ce855ff0..badc566cf7a9 100644 --- a/test/python/visualization/references/test_latex_normal.tex +++ b/test/python/visualization/references/test_latex_normal.tex @@ -1,27 +1,15 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 5, img_depth = 3 -\usepackage[size=custom,height=10,width=10,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{2} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{3} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{4} : } & \gate{\mathrm{H}} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \gate{\mathrm{H}} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_partial_layout.tex b/test/python/visualization/references/test_latex_partial_layout.tex index 638fdfacde1e..ee303e0cf39a 100644 --- a/test/python/visualization/references/test_latex_partial_layout.tex +++ b/test/python/visualization/references/test_latex_partial_layout.tex @@ -1,27 +1,15 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 5, img_depth = 3 -\usepackage[size=custom,height=10,width=13,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{2}\mapsto{0} : } & \qw & \qw & \qw\\ - \lstick{ {q}_{0}\mapsto{1} : } & \qw & \qw & \qw\\ - \lstick{ {q}_{1}\mapsto{2} : } & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{0},\mathrm{\pi}\mathrm{)}} & \qw & \qw\\ - \lstick{ {ancilla}_{0}\mapsto{3} : } & \qw & \qw & \qw\\ - \lstick{ {ancilla}_{1}\mapsto{4} : } & \qw & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{2}\mapsto{0} : } & \lstick{ {q}_{2}\mapsto{0} : } & \qw & \qw & \qw\\ + \nghost{ {q}_{0}\mapsto{1} : } & \lstick{ {q}_{0}\mapsto{1} : } & \qw & \qw & \qw\\ + \nghost{ {q}_{1}\mapsto{2} : } & \lstick{ {q}_{1}\mapsto{2} : } & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{0},\mathrm{\pi}\mathrm{)}} & \qw & \qw\\ + \nghost{ {ancilla}_{0}\mapsto{3} : } & \lstick{ {ancilla}_{0}\mapsto{3} : } & \qw & \qw & \qw\\ + \nghost{ {ancilla}_{1}\mapsto{4} : } & \lstick{ {ancilla}_{1}\mapsto{4} : } & \qw & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_pauli_clifford.tex b/test/python/visualization/references/test_latex_pauli_clifford.tex index c9f6bb29b416..daa59be9c186 100644 --- a/test/python/visualization/references/test_latex_pauli_clifford.tex +++ b/test/python/visualization/references/test_latex_pauli_clifford.tex @@ -1,27 +1,15 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 5, img_depth = 7 -\usepackage[size=custom,height=10,width=16,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \gate{\mathrm{Y}} & \gate{\mathrm{Z}} & \gate{\mathrm{I}} & \qw & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \ctrl{1} & \ctrl{1} & \ctrl{1} & \qw & \qw & \qw\\ - \lstick{ {q}_{2} : } & \qw & \targ & \gate{\mathrm{Y}} & \control\qw & \qw & \qw & \qw\\ - \lstick{ {q}_{3} : } & \qswap & \gate{\mathrm{S}} & \gate{\mathrm{S}^\dagger} & \multigate{1}{\mathrm{Iswap}}_<<<{0} & \multigate{1}{\mathrm{Dcx}}_<<<{0} & \qw & \qw\\ - \lstick{ {q}_{4} : } & \qswap \qwx[-1] & \qw & \qw & \ghost{\mathrm{Iswap}}_<<<{1} & \ghost{\mathrm{Dcx}}_<<<{1} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \gate{\mathrm{Y}} & \gate{\mathrm{Z}} & \gate{\mathrm{I}} & \qw & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \ctrl{1} & \ctrl{1} & \ctrl{1} & \qw & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \qw & \targ & \gate{\mathrm{Y}} & \control\qw & \qw & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \qswap & \gate{\mathrm{S}} & \gate{\mathrm{S}^\dagger} & \multigate{1}{\mathrm{Iswap}}_<<<{0} & \multigate{1}{\mathrm{Dcx}}_<<<{0} & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \qswap \qwx[-1] & \qw & \qw & \ghost{\mathrm{Iswap}}_<<<{1} & \ghost{\mathrm{Dcx}}_<<<{1} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_pi_param_expr.tex b/test/python/visualization/references/test_latex_pi_param_expr.tex index 93a64b5dfc54..1ddde1b91d8c 100644 --- a/test/python/visualization/references/test_latex_pi_param_expr.tex +++ b/test/python/visualization/references/test_latex_pi_param_expr.tex @@ -1,23 +1,11 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 1, img_depth = 3 -\usepackage[size=custom,height=10,width=22,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{R}_\mathrm{X}\,\mathrm{(}\mathrm{(\pi\,-\,x)*(\pi\,-\,y)}\mathrm{)}} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{R}_\mathrm{X}\,\mathrm{(}\mathrm{(\pi\,-\,x)*(\pi\,-\,y)}\mathrm{)}} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_plot_barriers_false.tex b/test/python/visualization/references/test_latex_plot_barriers_false.tex index beafda187112..45c8ccad087d 100644 --- a/test/python/visualization/references/test_latex_plot_barriers_false.tex +++ b/test/python/visualization/references/test_latex_plot_barriers_false.tex @@ -1,25 +1,13 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 3, img_depth = 6 -\usepackage[size=custom,height=10,width=15,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw & \qw\\ - \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw & \qw\\ + \nghost{c:} & \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_plot_barriers_true.tex b/test/python/visualization/references/test_latex_plot_barriers_true.tex index c9d8289f91b9..87d45dc5c031 100644 --- a/test/python/visualization/references/test_latex_plot_barriers_true.tex +++ b/test/python/visualization/references/test_latex_plot_barriers_true.tex @@ -1,25 +1,13 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 3, img_depth = 6 -\usepackage[size=custom,height=10,width=15,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} \barrier[0em]{1} & \qw & \qw \barrier[0em]{1} & \qw & \qw & \qw\\ - \lstick{ {q}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw & \qw\\ - \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} \barrier[0em]{1} & \qw & \qw \barrier[0em]{1} & \qw & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw & \qw\\ + \nghost{c:} & \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_plot_partial_barriers.tex b/test/python/visualization/references/test_latex_plot_partial_barriers.tex index 9f04a8c36ec2..61b2d54626dc 100644 --- a/test/python/visualization/references/test_latex_plot_partial_barriers.tex +++ b/test/python/visualization/references/test_latex_plot_partial_barriers.tex @@ -1,25 +1,13 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 3, img_depth = 5 -\usepackage[size=custom,height=10,width=13,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} \barrier[0em]{0} & \qw & \gate{\mathrm{H}} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \qw & \qw & \qw & \qw & \qw\\ - \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} \barrier[0em]{0} & \qw & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \qw & \qw & \qw & \qw & \qw\\ + \nghost{c:} & \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_r_gates.tex b/test/python/visualization/references/test_latex_r_gates.tex index 6a17db43571e..eb86b872a3ef 100644 --- a/test/python/visualization/references/test_latex_r_gates.tex +++ b/test/python/visualization/references/test_latex_r_gates.tex @@ -1,26 +1,14 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 4, img_depth = 8 -\usepackage[size=custom,height=10,width=24,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{R}\,\mathrm{(}\mathrm{\frac{3\pi}{4}},\mathrm{\frac{3\pi}{8}}\mathrm{)}} & \multigate{1}{\mathrm{R}_{\mathrm{XX}}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}}_<<<{0} & \multigate{1}{\mathrm{R}_{\mathrm{ZX}}\,\mathrm{(}\mathrm{\frac{-\pi}{2}}\mathrm{)}}_<<<{0} & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{R}_\mathrm{X}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} & \ghost{\mathrm{R}_{\mathrm{XX}}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}}_<<<{1} & \ghost{\mathrm{R}_{\mathrm{ZX}}\,\mathrm{(}\mathrm{\frac{-\pi}{2}}\mathrm{)}}_<<<{1} & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{2} : } & \gate{\mathrm{R}_\mathrm{Y}\,\mathrm{(}\mathrm{\frac{-\pi}{2}}\mathrm{)}} & \multigate{1}{\mathrm{R}_{\mathrm{YY}}\,\mathrm{(}\mathrm{\frac{3\pi}{4}}\mathrm{)}}_<<<{0} & \ctrl{1} & \dstick{\hspace{2.0em}\mathrm{ZZ}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{3} : } & \gate{\mathrm{R}_\mathrm{Z}\,\mathrm{(}\mathrm{\frac{3\pi}{4}}\mathrm{)}} & \ghost{\mathrm{R}_{\mathrm{YY}}\,\mathrm{(}\mathrm{\frac{3\pi}{4}}\mathrm{)}}_<<<{1} & \control \qw & \qw & \qw & \qw & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{R}\,\mathrm{(}\mathrm{\frac{3\pi}{4}},\mathrm{\frac{3\pi}{8}}\mathrm{)}} & \multigate{1}{\mathrm{R}_{\mathrm{XX}}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}}_<<<{0} & \multigate{1}{\mathrm{R}_{\mathrm{ZX}}\,\mathrm{(}\mathrm{\frac{-\pi}{2}}\mathrm{)}}_<<<{0} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{R}_\mathrm{X}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} & \ghost{\mathrm{R}_{\mathrm{XX}}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}}_<<<{1} & \ghost{\mathrm{R}_{\mathrm{ZX}}\,\mathrm{(}\mathrm{\frac{-\pi}{2}}\mathrm{)}}_<<<{1} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \gate{\mathrm{R}_\mathrm{Y}\,\mathrm{(}\mathrm{\frac{-\pi}{2}}\mathrm{)}} & \multigate{1}{\mathrm{R}_{\mathrm{YY}}\,\mathrm{(}\mathrm{\frac{3\pi}{4}}\mathrm{)}}_<<<{0} & \ctrl{1} & \dstick{\hspace{2.0em}\mathrm{ZZ}\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \gate{\mathrm{R}_\mathrm{Z}\,\mathrm{(}\mathrm{\frac{3\pi}{4}}\mathrm{)}} & \ghost{\mathrm{R}_{\mathrm{YY}}\,\mathrm{(}\mathrm{\frac{3\pi}{4}}\mathrm{)}}_<<<{1} & \control \qw & \qw & \qw & \qw & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_reverse_bits.tex b/test/python/visualization/references/test_latex_reverse_bits.tex index 41e87e232ba9..3bc7b4cc6fc3 100644 --- a/test/python/visualization/references/test_latex_reverse_bits.tex +++ b/test/python/visualization/references/test_latex_reverse_bits.tex @@ -1,25 +1,13 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 3, img_depth = 5 -\usepackage[size=custom,height=10,width=13,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{2} : } & \qw & \qw & \ctrl{1} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \qw & \targ & \ctrl{1} & \qw & \qw\\ - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \ctrl{-1} & \targ & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \qw & \qw & \ctrl{1} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \qw & \targ & \ctrl{1} & \qw & \qw\\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \ctrl{-1} & \targ & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_scale_default.tex b/test/python/visualization/references/test_latex_scale_default.tex index e03f106541a1..10885e1cea87 100644 --- a/test/python/visualization/references/test_latex_scale_default.tex +++ b/test/python/visualization/references/test_latex_scale_default.tex @@ -1,27 +1,15 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 5, img_depth = 3 -\usepackage[size=custom,height=10,width=10,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=1.0em @!R { - \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ - \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ - \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ - \lstick{ {q}_{4} : } & \ghost{\mathrm{Unitary}}_<<<{4} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=1.0em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \ghost{\mathrm{Unitary}}_<<<{4} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_scale_double.tex b/test/python/visualization/references/test_latex_scale_double.tex index 12979ef155b0..ba57264f9e2d 100644 --- a/test/python/visualization/references/test_latex_scale_double.tex +++ b/test/python/visualization/references/test_latex_scale_double.tex @@ -1,27 +1,15 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 5, img_depth = 3 -\usepackage[size=custom,height=10,width=10,scale=2.0]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=1.0em @!R { - \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ - \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ - \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ - \lstick{ {q}_{4} : } & \ghost{\mathrm{Unitary}}_<<<{4} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{2.0}{ +\Qcircuit @C=1.0em @R=1.0em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \ghost{\mathrm{Unitary}}_<<<{4} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_scale_half.tex b/test/python/visualization/references/test_latex_scale_half.tex index cf25f180f1e8..0f33d9d09d0a 100644 --- a/test/python/visualization/references/test_latex_scale_half.tex +++ b/test/python/visualization/references/test_latex_scale_half.tex @@ -1,27 +1,15 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 5, img_depth = 3 -\usepackage[size=custom,height=10,width=10,scale=0.5]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=1.0em @!R { - \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ - \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ - \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ - \lstick{ {q}_{4} : } & \ghost{\mathrm{Unitary}}_<<<{4} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{0.5}{ +\Qcircuit @C=1.0em @R=1.0em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ + \nghost{ {q}_{4} : } & \lstick{ {q}_{4} : } & \ghost{\mathrm{Unitary}}_<<<{4} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_teleport.tex b/test/python/visualization/references/test_latex_teleport.tex index abc1878d0087..1a904dc38287 100644 --- a/test/python/visualization/references/test_latex_teleport.tex +++ b/test/python/visualization/references/test_latex_teleport.tex @@ -1,26 +1,14 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 4, img_depth = 11 -\usepackage[size=custom,height=10,width=27,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{U}_3\,\mathrm{(}\mathrm{0.3},\mathrm{0.2},\mathrm{0.1}\mathrm{)}} & \qw \barrier[0em]{2} & \qw & \ctrl{1} & \gate{\mathrm{H}} & \meter & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \ctrl{1} & \qw & \targ & \meter & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{2} : } & \qw & \targ & \qw & \qw & \qw & \qw & \gate{\mathrm{Z}} & \gate{\mathrm{X}} & \meter & \qw & \qw\\ - \lstick{c:} & \lstick{/_{_{3}}} \cw & \cw & \cw & \cw & \dstick{_{_{1}}} \cw \cwx[-2] & \dstick{_{_{0}}} \cw \cwx[-3] & \dstick{_{_{=1}}} \cw \cwx[-1] & \dstick{_{_{=2}}} \cw \cwx[-1] & \dstick{_{_{2}}} \cw \cwx[-1] & \cw & \cw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{U}\,\mathrm{(}\mathrm{0.3},\mathrm{0.2},\mathrm{0.1}\mathrm{)}} & \qw \barrier[0em]{2} & \qw & \ctrl{1} & \gate{\mathrm{H}} & \meter & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \ctrl{1} & \qw & \targ & \meter & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \qw & \targ & \qw & \qw & \qw & \qw & \gate{\mathrm{Z}} & \gate{\mathrm{X}} & \meter & \qw & \qw\\ + \nghost{c:} & \lstick{c:} & \lstick{/_{_{3}}} \cw & \cw & \cw & \cw & \dstick{_{_{1}}} \cw \cwx[-2] & \dstick{_{_{0}}} \cw \cwx[-3] & \dstick{_{_{=1}}} \cw \cwx[-1] & \dstick{_{_{=2}}} \cw \cwx[-1] & \dstick{_{_{2}}} \cw \cwx[-1] & \cw & \cw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_tiny.tex b/test/python/visualization/references/test_latex_tiny.tex index d159fb910712..9ea6881f641e 100644 --- a/test/python/visualization/references/test_latex_tiny.tex +++ b/test/python/visualization/references/test_latex_tiny.tex @@ -1,23 +1,11 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 1, img_depth = 3 -\usepackage[size=custom,height=10,width=10,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/references/test_latex_u_gates.tex b/test/python/visualization/references/test_latex_u_gates.tex index 378ca2b6cd96..6dc9adf57690 100644 --- a/test/python/visualization/references/test_latex_u_gates.tex +++ b/test/python/visualization/references/test_latex_u_gates.tex @@ -1,26 +1,14 @@ -% \documentclass[preview]{standalone} -% If the image is too large to fit on this documentclass use -\documentclass[draft]{beamer} -% img_width = 4, img_depth = 8 -\usepackage[size=custom,height=10,width=34,scale=0.7]{beamerposter} -% instead and customize the height and width (in cm) to fit. -% Large images may run out of memory quickly. -% To fix this use the LuaLaTeX compiler, which dynamically -% allocates memory. +\documentclass[border=2px]{standalone} + \usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\pdfmapfile{+sansmathaccent.map} -% \usepackage[landscape]{geometry} -% Comment out the above line if using the beamer documentclass. -\begin{document} - -\begin{equation*} - \Qcircuit @C=1.0em @R=0.2em @!R { - \lstick{ {q}_{0} : } & \gate{\mathrm{U}_1\,\mathrm{(}\mathrm{\frac{3\pi}{2}}\mathrm{)}} & \ctrl{1} & \dstick{\hspace{2.0em}\mathrm{U}_1\,\mathrm{(}\mathrm{\frac{\pi}{4}}\mathrm{)}} \qw & \qw & \qw & \ctrl{1} & \qw & \qw\\ - \lstick{ {q}_{1} : } & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{\frac{3\pi}{2}},\mathrm{\frac{2\pi}{3}}\mathrm{)}} & \control \qw & \qw & \qw & \qw & \gate{\mathrm{U}_3\,\mathrm{(}\mathrm{\frac{3\pi}{2}},\mathrm{\frac{-3\pi}{4}},\mathrm{\frac{-\pi}{2}}\mathrm{)}} & \qw & \qw\\ - \lstick{ {q}_{2} : } & \gate{\mathrm{U}_3\,\mathrm{(}\mathrm{\frac{3\pi}{2}},\mathrm{4.5},\mathrm{\frac{\pi}{4}}\mathrm{)}} & \ctrl{1} & \qw & \qw & \qw & \qw & \qw & \qw\\ - \lstick{ {q}_{3} : } & \qw & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{\frac{\pi}{2}},\mathrm{\frac{3\pi}{2}}\mathrm{)}} & \qw & \qw & \qw & \qw & \qw & \qw\\ - } -\end{equation*} +\usepackage{graphicx} +\begin{document} +\scalebox{1.0}{ +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{ {q}_{0} : } & \lstick{ {q}_{0} : } & \gate{\mathrm{U}_1\,\mathrm{(}\mathrm{\frac{3\pi}{2}}\mathrm{)}} & \ctrl{1} & \dstick{\hspace{2.0em}\mathrm{U}_1\,\mathrm{(}\mathrm{\frac{\pi}{4}}\mathrm{)}} \qw & \qw & \qw & \ctrl{1} & \qw & \qw\\ + \nghost{ {q}_{1} : } & \lstick{ {q}_{1} : } & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{\frac{3\pi}{2}},\mathrm{\frac{2\pi}{3}}\mathrm{)}} & \control \qw & \qw & \qw & \qw & \gate{\mathrm{U}_3\,\mathrm{(}\mathrm{\frac{3\pi}{2}},\mathrm{\frac{-3\pi}{4}},\mathrm{\frac{-\pi}{2}}\mathrm{)}} & \qw & \qw\\ + \nghost{ {q}_{2} : } & \lstick{ {q}_{2} : } & \gate{\mathrm{U}_3\,\mathrm{(}\mathrm{\frac{3\pi}{2}},\mathrm{4.5},\mathrm{\frac{\pi}{4}}\mathrm{)}} & \ctrl{1} & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{ {q}_{3} : } & \lstick{ {q}_{3} : } & \qw & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{\frac{\pi}{2}},\mathrm{\frac{3\pi}{2}}\mathrm{)}} & \qw & \qw & \qw & \qw & \qw & \qw\\ +\\ }} \end{document} \ No newline at end of file diff --git a/test/python/visualization/test_circuit_latex.py b/test/python/visualization/test_circuit_latex.py index cb051487cc12..57be6c468784 100644 --- a/test/python/visualization/test_circuit_latex.py +++ b/test/python/visualization/test_circuit_latex.py @@ -112,7 +112,7 @@ def test_teleport(self): cr = ClassicalRegister(3, "c") circuit = QuantumCircuit(qr, cr) # Prepare an initial state - circuit.u3(0.3, 0.2, 0.1, [qr[0]]) + circuit.u(0.3, 0.2, 0.1, [qr[0]]) # Prepare a Bell pair circuit.h(qr[1]) circuit.cx(qr[1], qr[2]) @@ -492,13 +492,13 @@ def test_iqx_colors(self): circuit.t(4) circuit.tdg(4) circuit.p(pi / 2, 4) - circuit.u1(pi / 2, 4) + circuit.p(pi / 2, 4) circuit.cz(5, 6) - circuit.cu1(pi / 2, 5, 6) + circuit.cp(pi / 2, 5, 6) circuit.y(5) circuit.rx(pi / 3, 5) circuit.rzx(pi / 2, 5, 6) - circuit.u2(pi / 2, pi / 2, 5) + circuit.u(pi / 2, pi / 2, pi / 2, 5) circuit.barrier(5, 6) circuit.reset(5)