From 6cd5a82088f463d238e845e648ea0a04286af077 Mon Sep 17 00:00:00 2001 From: JoshDumo Date: Sat, 29 May 2021 09:22:42 +0900 Subject: [PATCH 1/6] fixed issue 6447 to use standalone and fewer cleaner lines --- qiskit/visualization/latex.py | 84 ++++++++------ .../references/test_latex_4597.tex | 31 ++---- .../references/test_latex_big_gates.tex | 35 ++---- .../references/test_latex_cnot.tex | 33 ++---- .../references/test_latex_conditional.tex | 29 ++--- .../test_latex_creg_initial_false.tex | 31 ++---- .../test_latex_creg_initial_true.tex | 29 ++--- .../references/test_latex_cswap_rzz.tex | 33 ++---- .../references/test_latex_deep.tex | 25 +---- .../references/test_latex_empty.tex | 25 +---- .../references/test_latex_ghz_to_gate.tex | 33 ++---- .../references/test_latex_global_phase.tex | 31 ++---- .../references/test_latex_huge.tex | 103 ++++++++---------- .../references/test_latex_init_reset.tex | 27 ++--- .../references/test_latex_inst_with_cbits.tex | 39 +++---- .../references/test_latex_iqx.tex | 37 ++----- .../references/test_latex_long_name.tex | 33 ++---- .../references/test_latex_meas_condition.tex | 29 ++--- .../test_latex_no_barriers_false.tex | 29 ++--- .../references/test_latex_no_ops.tex | 29 ++--- .../references/test_latex_normal.tex | 33 ++---- .../references/test_latex_partial_layout.tex | 33 ++---- .../references/test_latex_pauli_clifford.tex | 33 ++---- .../references/test_latex_pi_param_expr.tex | 25 +---- .../test_latex_plot_barriers_false.tex | 29 ++--- .../test_latex_plot_barriers_true.tex | 29 ++--- .../test_latex_plot_partial_barriers.tex | 29 ++--- .../references/test_latex_r_gates.tex | 31 ++---- .../references/test_latex_reverse_bits.tex | 29 ++--- .../references/test_latex_scale_default.tex | 33 ++---- .../references/test_latex_scale_double.tex | 33 ++---- .../references/test_latex_scale_half.tex | 33 ++---- .../references/test_latex_teleport.tex | 31 ++---- .../references/test_latex_tiny.tex | 25 +---- .../references/test_latex_u_gates.tex | 31 ++---- 35 files changed, 387 insertions(+), 815 deletions(-) diff --git a/qiskit/visualization/latex.py b/qiskit/visualization/latex.py index 7fb98d8bc8df..38fa1b0fc957 100644 --- a/qiskit/visualization/latex.py +++ b/qiskit/visualization/latex.py @@ -157,30 +157,41 @@ 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[preview]{standalone} +#% If the image is too large to fit on this documentclass use +#\documentclass[draft]{beamer} +#""" + header_1 = r"""\documentclass[border=2px]{standalone} + """ +# 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. +#\usepackage[braket, qm]{qcircuit} +#\usepackage{amsmath} +#\pdfmapfile{+sansmathaccent.map} +#% \usepackage[landscape]{geometry} +#% Comment out the above line if using the beamer documentclass. +#\begin{document} +#""" +# qcircuit_line = r""" +#\begin{equation*} +# \Qcircuit @C=%.1fem @R=%.1fem @!R { +#""" + + 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} + +\begin{document} """ 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("%% 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) if self.global_phase: output.write( @@ -195,9 +206,10 @@ 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("\t }\n") + output.write(r"\\ " + "}\n") + #output.write("\\end{equation*}\n\n") output.write("\\end{document}") contents = output.getvalue() output.close() @@ -228,27 +240,27 @@ 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 + ":" + self._latex[i][0] = "\\nghost{" + reg.name + "} & " + "\\lstick{" + 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"]) - + "}:" + "\\nghost{" + self.bit_locations[self.ordered_bits[i]]["register"].name + + "_" + str(self.bit_locations[self.ordered_bits[i]]["index"]) + "} & " + + "\\lstick{" + self.bit_locations[self.ordered_bits[i]]["register"].name + + "_{" + str(self.bit_locations[self.ordered_bits[i]]["index"]) + "}:" ) if self.initial_state: self._latex[i][0] += "0" self._latex[i][0] += "}" else: if self.layout is None: - label = "\\lstick{{ {{{}}}_{{{}}} : ".format( + label = "\\nghost{" + self.bit_locations[self.ordered_bits[i]]["register"].name + label += "_" + str(self.bit_locations[self.ordered_bits[i]]["index"]) + "} & " + label += "\\lstick{{ {{{}}}_{{{}}} : ".format( self.bit_locations[self.ordered_bits[i]]["register"].name, - self.bit_locations[self.ordered_bits[i]]["index"], - ) + self.bit_locations[self.ordered_bits[i]]["index"],) else: bit_location = self.bit_locations[self.ordered_bits[i]] if bit_location and self.layout[bit_location["index"]]: @@ -257,13 +269,15 @@ 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( - virt_reg.name, virt_reg[:].index(virt_bit), bit_location["index"] - ) + label = "\\nghost{" + virt_reg.name + "} & " + label += "\\lstick{{ {{{}}}_{{{}}}\\mapsto{{{}}} : ".format( + virt_reg.name, virt_reg[:].index(virt_bit), bit_location["index"]) except StopIteration: - label = "\\lstick{{ {{{}}} : ".format(bit_location["index"]) + label = "\\nghost{" + bit_location["index"] + "} & " + label += "\\lstick{{ {{{}}} : ".format(bit_location["index"]) else: - label = "\\lstick{{ {{{}}} : ".format(bit_location["index"]) + label = "\\nghost{" + bit_location["index"] + "} & " + label += "\\lstick{{ {{{}}} : ".format(bit_location["index"]) if self.initial_state: label += "\\ket{{0}}" label += " }" diff --git a/test/python/visualization/references/test_latex_4597.tex b/test/python/visualization/references/test_latex_4597.tex index 5262924d3c7b..89cd6f7dadec 100644 --- a/test/python/visualization/references/test_latex_4597.tex +++ b/test/python/visualization/references/test_latex_4597.tex @@ -1,26 +1,13 @@ -% \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*} +\begin{document} +\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..a220974c5565 100644 --- a/test/python/visualization/references/test_latex_big_gates.tex +++ b/test/python/visualization/references/test_latex_big_gates.tex @@ -1,28 +1,15 @@ -% \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*} +\begin{document} +\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..658525f1e990 100644 --- a/test/python/visualization/references/test_latex_cnot.tex +++ b/test/python/visualization/references/test_latex_cnot.tex @@ -1,27 +1,14 @@ -% \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*} +\begin{document} +\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..f44fe53e434c 100644 --- a/test/python/visualization/references/test_latex_conditional.tex +++ b/test/python/visualization/references/test_latex_conditional.tex @@ -1,25 +1,12 @@ -% \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*} +\begin{document} +\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..f4245fa271e0 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,13 @@ -% \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*} +\begin{document} +\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..0e4423a65667 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,12 @@ -% \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*} +\begin{document} +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{q_0} & \lstick{ {q}_{0} : \ket{{0}} } & \gate{\mathrm{X}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{q_1} & \lstick{ {q}_{1} : \ket{{0}} } & \gate{\mathrm{X}} & \qw & \qw & \qw\\ + \nghost{c} & \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..96a213990aae 100644 --- a/test/python/visualization/references/test_latex_cswap_rzz.tex +++ b/test/python/visualization/references/test_latex_cswap_rzz.tex @@ -1,27 +1,14 @@ -% \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*} +\begin{document} +\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..117e4d59f15a 100644 --- a/test/python/visualization/references/test_latex_deep.tex +++ b/test/python/visualization/references/test_latex_deep.tex @@ -1,23 +1,10 @@ -% \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*} +\begin{document} +\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..b862fdb69184 100644 --- a/test/python/visualization/references/test_latex_empty.tex +++ b/test/python/visualization/references/test_latex_empty.tex @@ -1,23 +1,10 @@ -% \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*} +\begin{document} +\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..e509a688a0f8 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,14 @@ -% \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*} +\begin{document} +\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..8f260006610e 100644 --- a/test/python/visualization/references/test_latex_global_phase.tex +++ b/test/python/visualization/references/test_latex_global_phase.tex @@ -1,25 +1,12 @@ -% \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*} +\begin{document} +{$\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..4e06fb0b02d5 100644 --- a/test/python/visualization/references/test_latex_huge.tex +++ b/test/python/visualization/references/test_latex_huge.tex @@ -1,62 +1,49 @@ -% \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*} +\begin{document} +\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..cc0936ac7e12 100644 --- a/test/python/visualization/references/test_latex_init_reset.tex +++ b/test/python/visualization/references/test_latex_init_reset.tex @@ -1,24 +1,11 @@ -% \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*} +\begin{document} +\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..c10b0dffeb7e 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,17 @@ -% \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*} +\begin{document} +\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..b71cb599af2d 100644 --- a/test/python/visualization/references/test_latex_iqx.tex +++ b/test/python/visualization/references/test_latex_iqx.tex @@ -1,29 +1,16 @@ -% \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*} +\begin{document} +\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{U}_1\,\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{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\\ + \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..dca117ef5dee 100644 --- a/test/python/visualization/references/test_latex_long_name.tex +++ b/test/python/visualization/references/test_latex_long_name.tex @@ -1,27 +1,14 @@ -% \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*} +\begin{document} +\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..83b767baef48 100644 --- a/test/python/visualization/references/test_latex_meas_condition.tex +++ b/test/python/visualization/references/test_latex_meas_condition.tex @@ -1,25 +1,12 @@ -% \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*} +\begin{document} +\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..466c0d874f2a 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,12 @@ -% \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*} +\begin{document} +\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..66908ee6f279 100644 --- a/test/python/visualization/references/test_latex_no_ops.tex +++ b/test/python/visualization/references/test_latex_no_ops.tex @@ -1,25 +1,12 @@ -% \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*} +\begin{document} +\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..fc75e45410a8 100644 --- a/test/python/visualization/references/test_latex_normal.tex +++ b/test/python/visualization/references/test_latex_normal.tex @@ -1,27 +1,14 @@ -% \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*} +\begin{document} +\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..4c898e8ec71f 100644 --- a/test/python/visualization/references/test_latex_partial_layout.tex +++ b/test/python/visualization/references/test_latex_partial_layout.tex @@ -1,27 +1,14 @@ -% \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*} +\begin{document} +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{q} & \lstick{ {q}_{2}\mapsto{0} : } & \qw & \qw & \qw\\ + \nghost{q} & \lstick{ {q}_{0}\mapsto{1} : } & \qw & \qw & \qw\\ + \nghost{q} & \lstick{ {q}_{1}\mapsto{2} : } & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{0},\mathrm{\pi}\mathrm{)}} & \qw & \qw\\ + \nghost{ancilla} & \lstick{ {ancilla}_{0}\mapsto{3} : } & \qw & \qw & \qw\\ + \nghost{ancilla} & \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..257e0e65bb81 100644 --- a/test/python/visualization/references/test_latex_pauli_clifford.tex +++ b/test/python/visualization/references/test_latex_pauli_clifford.tex @@ -1,27 +1,14 @@ -% \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*} +\begin{document} +\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..1bf1b242b72d 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,10 @@ -% \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*} +\begin{document} +\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..b637e301a4ec 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,12 @@ -% \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*} +\begin{document} +\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..20ba9f032e7a 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,12 @@ -% \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*} +\begin{document} +\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..983dc49cce87 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,12 @@ -% \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*} +\begin{document} +\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..f5d8222e04a0 100644 --- a/test/python/visualization/references/test_latex_r_gates.tex +++ b/test/python/visualization/references/test_latex_r_gates.tex @@ -1,26 +1,13 @@ -% \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*} +\begin{document} +\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..d2ed5761b7cf 100644 --- a/test/python/visualization/references/test_latex_reverse_bits.tex +++ b/test/python/visualization/references/test_latex_reverse_bits.tex @@ -1,25 +1,12 @@ -% \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*} +\begin{document} +\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..9eac52cc07e4 100644 --- a/test/python/visualization/references/test_latex_scale_default.tex +++ b/test/python/visualization/references/test_latex_scale_default.tex @@ -1,27 +1,14 @@ -% \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*} +\begin{document} +\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..9eac52cc07e4 100644 --- a/test/python/visualization/references/test_latex_scale_double.tex +++ b/test/python/visualization/references/test_latex_scale_double.tex @@ -1,27 +1,14 @@ -% \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*} +\begin{document} +\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..9eac52cc07e4 100644 --- a/test/python/visualization/references/test_latex_scale_half.tex +++ b/test/python/visualization/references/test_latex_scale_half.tex @@ -1,27 +1,14 @@ -% \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*} +\begin{document} +\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..1ebb9ae85bae 100644 --- a/test/python/visualization/references/test_latex_teleport.tex +++ b/test/python/visualization/references/test_latex_teleport.tex @@ -1,26 +1,13 @@ -% \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*} +\begin{document} +\Qcircuit @C=1.0em @R=0.2em @!R { \\ + \nghost{q_0} & \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\\ + \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..b0059cfec423 100644 --- a/test/python/visualization/references/test_latex_tiny.tex +++ b/test/python/visualization/references/test_latex_tiny.tex @@ -1,23 +1,10 @@ -% \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*} +\begin{document} +\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..7a49f7ec4026 100644 --- a/test/python/visualization/references/test_latex_u_gates.tex +++ b/test/python/visualization/references/test_latex_u_gates.tex @@ -1,26 +1,13 @@ -% \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*} +\begin{document} +\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 From 817a37f93c558848a928879efbef227f5955598d Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Sat, 29 May 2021 22:30:05 +0200 Subject: [PATCH 2/6] blacking and removing comments --- qiskit/visualization/latex.py | 58 +++++++++++++---------------------- 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/qiskit/visualization/latex.py b/qiskit/visualization/latex.py index 38fa1b0fc957..b07311e7747f 100644 --- a/qiskit/visualization/latex.py +++ b/qiskit/visualization/latex.py @@ -157,28 +157,8 @@ 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} -#""" header_1 = r"""\documentclass[border=2px]{standalone} """ -# 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. -#\usepackage[braket, qm]{qcircuit} -#\usepackage{amsmath} -#\pdfmapfile{+sansmathaccent.map} -#% \usepackage[landscape]{geometry} -#% Comment out the above line if using the beamer documentclass. -#\begin{document} -#""" -# qcircuit_line = r""" -#\begin{equation*} -# \Qcircuit @C=%.1fem @R=%.1fem @!R { -#""" header_2 = r""" \usepackage[braket, qm]{qcircuit} @@ -190,8 +170,6 @@ def latex(self): """ 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) if self.global_phase: output.write( @@ -207,9 +185,7 @@ def latex(self): output.write(" & ") else: output.write(r"\\ " + "\n") - #output.write("\t }\n") - output.write(r"\\ " + "}\n") - #output.write("\\end{equation*}\n\n") + output.write(r"\\ " + "}\n") output.write("\\end{document}") contents = output.getvalue() output.close() @@ -240,16 +216,24 @@ 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] = "\\nghost{" + reg.name + "} & " + "\\lstick{" + reg.name + ":" + self._latex[i][0] = ( + "\\nghost{" + reg.name + "} & " + "\\lstick{" + reg.name + ":" + ) clbitsize = self.cregs[reg] self._latex[i][1] = "\\lstick{/_{_{" + str(clbitsize) + "}}} \\cw" offset += clbitsize - 1 else: self._latex[i][0] = ( - "\\nghost{" + self.bit_locations[self.ordered_bits[i]]["register"].name - + "_" + str(self.bit_locations[self.ordered_bits[i]]["index"]) + "} & " - + "\\lstick{" + self.bit_locations[self.ordered_bits[i]]["register"].name - + "_{" + str(self.bit_locations[self.ordered_bits[i]]["index"]) + "}:" + "\\nghost{" + + self.bit_locations[self.ordered_bits[i]]["register"].name + + "_" + + str(self.bit_locations[self.ordered_bits[i]]["index"]) + + "} & " + + "\\lstick{" + + self.bit_locations[self.ordered_bits[i]]["register"].name + + "_{" + + str(self.bit_locations[self.ordered_bits[i]]["index"]) + + "}:" ) if self.initial_state: self._latex[i][0] += "0" @@ -260,7 +244,8 @@ def _initialize_latex_array(self): label += "_" + str(self.bit_locations[self.ordered_bits[i]]["index"]) + "} & " label += "\\lstick{{ {{{}}}_{{{}}} : ".format( self.bit_locations[self.ordered_bits[i]]["register"].name, - self.bit_locations[self.ordered_bits[i]]["index"],) + self.bit_locations[self.ordered_bits[i]]["index"], + ) else: bit_location = self.bit_locations[self.ordered_bits[i]] if bit_location and self.layout[bit_location["index"]]: @@ -269,15 +254,16 @@ def _initialize_latex_array(self): virt_reg = next( reg for reg in self.layout.get_registers() if virt_bit in reg ) - label = "\\nghost{" + virt_reg.name + "} & " + label = "\\nghost{" + virt_reg.name + "} & " label += "\\lstick{{ {{{}}}_{{{}}}\\mapsto{{{}}} : ".format( - virt_reg.name, virt_reg[:].index(virt_bit), bit_location["index"]) + virt_reg.name, virt_reg[:].index(virt_bit), bit_location["index"] + ) except StopIteration: - label = "\\nghost{" + bit_location["index"] + "} & " + label = "\\nghost{" + bit_location["index"] + "} & " label += "\\lstick{{ {{{}}} : ".format(bit_location["index"]) else: - label = "\\nghost{" + bit_location["index"] + "} & " - label += "\\lstick{{ {{{}}} : ".format(bit_location["index"]) + label = "\\nghost{" + bit_location["index"] + "} & " + label += "\\lstick{{ {{{}}} : ".format(bit_location["index"]) if self.initial_state: label += "\\ket{{0}}" label += " }" From 19d188e366be070c7a4d22a21a01194c33c6a948 Mon Sep 17 00:00:00 2001 From: JoshDumo Date: Wed, 2 Jun 2021 08:21:44 +0900 Subject: [PATCH 3/6] fixed cropping of latex image labels when initial_state is True --- qiskit/visualization/latex.py | 14 ++-- .../references/test_latex_4597.tex | 8 +- .../references/test_latex_big_gates.tex | 12 +-- .../references/test_latex_cnot.tex | 10 +-- .../references/test_latex_conditional.tex | 6 +- .../test_latex_creg_initial_false.tex | 8 +- .../test_latex_creg_initial_true.tex | 6 +- .../references/test_latex_cswap_rzz.tex | 10 +-- .../references/test_latex_deep.tex | 2 +- .../references/test_latex_empty.tex | 2 +- .../references/test_latex_ghz_to_gate.tex | 10 +-- .../references/test_latex_global_phase.tex | 6 +- .../references/test_latex_huge.tex | 80 +++++++++---------- .../references/test_latex_init_reset.tex | 4 +- .../references/test_latex_inst_with_cbits.tex | 16 ++-- .../references/test_latex_iqx.tex | 14 ++-- .../references/test_latex_long_name.tex | 10 +-- .../references/test_latex_meas_condition.tex | 6 +- .../test_latex_no_barriers_false.tex | 6 +- .../references/test_latex_no_ops.tex | 6 +- .../references/test_latex_normal.tex | 10 +-- .../references/test_latex_partial_layout.tex | 10 +-- .../references/test_latex_pauli_clifford.tex | 10 +-- .../references/test_latex_pi_param_expr.tex | 2 +- .../test_latex_plot_barriers_false.tex | 6 +- .../test_latex_plot_barriers_true.tex | 6 +- .../test_latex_plot_partial_barriers.tex | 6 +- .../references/test_latex_r_gates.tex | 8 +- .../references/test_latex_reverse_bits.tex | 6 +- .../references/test_latex_scale_default.tex | 10 +-- .../references/test_latex_scale_double.tex | 10 +-- .../references/test_latex_scale_half.tex | 10 +-- .../references/test_latex_teleport.tex | 8 +- .../references/test_latex_tiny.tex | 2 +- .../references/test_latex_u_gates.tex | 8 +- 35 files changed, 175 insertions(+), 173 deletions(-) diff --git a/qiskit/visualization/latex.py b/qiskit/visualization/latex.py index b07311e7747f..0230da572a8a 100644 --- a/qiskit/visualization/latex.py +++ b/qiskit/visualization/latex.py @@ -217,14 +217,14 @@ def _initialize_latex_array(self): if self.cregbundle: reg = self.bit_locations[self.ordered_bits[i + offset]]["register"] self._latex[i][0] = ( - "\\nghost{" + reg.name + "} & " + "\\lstick{" + reg.name + ":" + "\\nghost{Register: " + reg.name + "} & " + "\\lstick{" + reg.name + ":" ) clbitsize = self.cregs[reg] self._latex[i][1] = "\\lstick{/_{_{" + str(clbitsize) + "}}} \\cw" offset += clbitsize - 1 else: self._latex[i][0] = ( - "\\nghost{" + "\\nghost{Register: " + self.bit_locations[self.ordered_bits[i]]["register"].name + "_" + str(self.bit_locations[self.ordered_bits[i]]["index"]) @@ -240,7 +240,8 @@ def _initialize_latex_array(self): self._latex[i][0] += "}" else: if self.layout is None: - label = "\\nghost{" + self.bit_locations[self.ordered_bits[i]]["register"].name + label = "\\nghost{Register: " + label += self.bit_locations[self.ordered_bits[i]]["register"].name label += "_" + str(self.bit_locations[self.ordered_bits[i]]["index"]) + "} & " label += "\\lstick{{ {{{}}}_{{{}}} : ".format( self.bit_locations[self.ordered_bits[i]]["register"].name, @@ -254,17 +255,18 @@ def _initialize_latex_array(self): virt_reg = next( reg for reg in self.layout.get_registers() if virt_bit in reg ) - label = "\\nghost{" + virt_reg.name + "} & " + label = "\\nghost{Register: " + virt_reg.name + "} & " label += "\\lstick{{ {{{}}}_{{{}}}\\mapsto{{{}}} : ".format( virt_reg.name, virt_reg[:].index(virt_bit), bit_location["index"] ) except StopIteration: - label = "\\nghost{" + bit_location["index"] + "} & " + label = "\\nghost{Register: " + bit_location["index"] + "} & " label += "\\lstick{{ {{{}}} : ".format(bit_location["index"]) else: - label = "\\nghost{" + bit_location["index"] + "} & " + label = "\\nghost{Register: " + bit_location["index"] + "} & " label += "\\lstick{{ {{{}}} : ".format(bit_location["index"]) if self.initial_state: + #label += "\\ket{{0}}" label += "\\ket{{0}}" label += " }" self._latex[i][0] = label diff --git a/test/python/visualization/references/test_latex_4597.tex b/test/python/visualization/references/test_latex_4597.tex index 89cd6f7dadec..2e3253df5604 100644 --- a/test/python/visualization/references/test_latex_4597.tex +++ b/test/python/visualization/references/test_latex_4597.tex @@ -5,9 +5,9 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \qw & \qw & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \qw & \qw & \qw\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \gate{\mathrm{X}} & \qw & \qw\\ + \nghost{Register: 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 a220974c5565..8397afe323e5 100644 --- a/test/python/visualization/references/test_latex_big_gates.tex +++ b/test/python/visualization/references/test_latex_big_gates.tex @@ -5,11 +5,11 @@ \begin{document} \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\\ + \nghost{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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 658525f1e990..7bea9eede921 100644 --- a/test/python/visualization/references/test_latex_cnot.tex +++ b/test/python/visualization/references/test_latex_cnot.tex @@ -5,10 +5,10 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \ctrl{1} & \ctrl{1} & \ctrlo{1} & \ctrl{1} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \targ & \ctrl{1} & \targ & \ctrlo{1} & \qw & \qw\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \qw & \targ & \ctrlo{-1} & \ctrl{2} & \qw & \qw\\ + \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \qw & \qw & \qw & \ctrl{-1} & \qw & \qw & \qw\\ + \nghost{Register: 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 f44fe53e434c..4f8a7cb5acfd 100644 --- a/test/python/visualization/references/test_latex_conditional.tex +++ b/test/python/visualization/references/test_latex_conditional.tex @@ -5,8 +5,8 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \meter & \qw & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \meter & \qw & \qw & \qw\\ + \nghost{Register: 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 f4245fa271e0..97e3feff7302 100644 --- a/test/python/visualization/references/test_latex_creg_initial_false.tex +++ b/test/python/visualization/references/test_latex_creg_initial_false.tex @@ -5,9 +5,9 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{X}} & \qw & \qw & \qw\\ + \nghost{Register: c_0} & \lstick{c_{0}:} & \cw & \cw & \cw & \cw\\ + \nghost{Register: 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 0e4423a65667..274eb5fc64c0 100644 --- a/test/python/visualization/references/test_latex_creg_initial_true.tex +++ b/test/python/visualization/references/test_latex_creg_initial_true.tex @@ -5,8 +5,8 @@ \begin{document} \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{q_0} & \lstick{ {q}_{0} : \ket{{0}} } & \gate{\mathrm{X}} & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{q_1} & \lstick{ {q}_{1} : \ket{{0}} } & \gate{\mathrm{X}} & \qw & \qw & \qw\\ - \nghost{c} & \lstick{c:0} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : \ket{{0}} } & \gate{\mathrm{X}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : \ket{{0}} } & \gate{\mathrm{X}} & \qw & \qw & \qw\\ + \nghost{Register: c} & \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 96a213990aae..5c4305d6bc67 100644 --- a/test/python/visualization/references/test_latex_cswap_rzz.tex +++ b/test/python/visualization/references/test_latex_cswap_rzz.tex @@ -5,10 +5,10 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \ctrl{1} & \control \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{X}} & \qswap & \ctrl{-1} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \qswap \qwx[-1] & \ctrlo{-1} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{Register: 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{Register: 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 117e4d59f15a..e6edebbbfa3e 100644 --- a/test/python/visualization/references/test_latex_deep.tex +++ b/test/python/visualization/references/test_latex_deep.tex @@ -5,6 +5,6 @@ \begin{document} \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\\ + \nghost{Register: 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 b862fdb69184..01d7defdf9ce 100644 --- a/test/python/visualization/references/test_latex_empty.tex +++ b/test/python/visualization/references/test_latex_empty.tex @@ -5,6 +5,6 @@ \begin{document} \Qcircuit @C=1.0em @R=1.0em @!R { \\ - \nghost{q_0} & \lstick{ {q}_{0} : } & \qw & \qw\\ + \nghost{Register: 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 e509a688a0f8..fbc703108e7f 100644 --- a/test/python/visualization/references/test_latex_ghz_to_gate.tex +++ b/test/python/visualization/references/test_latex_ghz_to_gate.tex @@ -5,10 +5,10 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \ctrl{1} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \multigate{2}{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{0} & \qw & \qw\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \ghost{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{2} & \qw & \qw\\ + \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \ghost{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{1} & \qw & \qw\\ + \nghost{Register: 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 8f260006610e..d5c9e039f10d 100644 --- a/test/python/visualization/references/test_latex_global_phase.tex +++ b/test/python/visualization/references/test_latex_global_phase.tex @@ -5,8 +5,8 @@ \begin{document} {$\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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: 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 4e06fb0b02d5..4e69ea00a5e4 100644 --- a/test/python/visualization/references/test_latex_huge.tex +++ b/test/python/visualization/references/test_latex_huge.tex @@ -5,45 +5,45 @@ \begin{document} \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\\ + \nghost{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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 cc0936ac7e12..bd2d109e9ff7 100644 --- a/test/python/visualization/references/test_latex_init_reset.tex +++ b/test/python/visualization/references/test_latex_init_reset.tex @@ -5,7 +5,7 @@ \begin{document} \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\\ + \nghost{Register: 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{Register: 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 c10b0dffeb7e..928803b708e1 100644 --- a/test/python/visualization/references/test_latex_inst_with_cbits.tex +++ b/test/python/visualization/references/test_latex_inst_with_cbits.tex @@ -5,13 +5,13 @@ \begin{document} \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\\ + \nghost{Register: qr_0} & \lstick{ {qr}_{0} : } & \qw & \qw & \qw\\ + \nghost{Register: qr_1} & \lstick{ {qr}_{1} : } & \multigate{5}{\mathrm{instruction}}_<<<{0} & \qw & \qw\\ + \nghost{Register: qr_2} & \lstick{ {qr}_{2} : } & \ghost{\mathrm{instruction}}_<<<{1} & \qw & \qw\\ + \nghost{Register: qr_3} & \lstick{ {qr}_{3} : } & \ghost{\mathrm{instruction}} & \qw & \qw\\ + \nghost{Register: cr_0} & \lstick{cr_{0}:} & \cghost{\mathrm{instruction}} & \cw & \cw\\ + \nghost{Register: cr_1} & \lstick{cr_{1}:} & \cghost{\mathrm{instruction}}_<<<{1} & \cw & \cw\\ + \nghost{Register: cr_2} & \lstick{cr_{2}:} & \cghost{\mathrm{instruction}}_<<<{0} & \cw & \cw\\ + \nghost{Register: 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 b71cb599af2d..40585d86414d 100644 --- a/test/python/visualization/references/test_latex_iqx.tex +++ b/test/python/visualization/references/test_latex_iqx.tex @@ -5,12 +5,12 @@ \begin{document} \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{U}_1\,\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{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\\ - \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\\ + \nghost{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{U}_1\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{Register: q_5} & \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\\ + \nghost{Register: 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 dca117ef5dee..9b71f7ab795d 100644 --- a/test/python/visualization/references/test_latex_long_name.tex +++ b/test/python/visualization/references/test_latex_long_name.tex @@ -5,10 +5,10 @@ \begin{document} \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\\ + \nghost{Register: veryLongQuantumRegisterName_0} & \lstick{ {veryLongQuantumRegisterName}_{0} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: veryLongQuantumRegisterName_1} & \lstick{ {veryLongQuantumRegisterName}_{1} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: veryLongQuantumRegisterName_2} & \lstick{ {veryLongQuantumRegisterName}_{2} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: veryLongQuantumRegisterName_3} & \lstick{ {veryLongQuantumRegisterName}_{3} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: 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 83b767baef48..8ebeca3ce973 100644 --- a/test/python/visualization/references/test_latex_meas_condition.tex +++ b/test/python/visualization/references/test_latex_meas_condition.tex @@ -5,8 +5,8 @@ \begin{document} \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\\ + \nghost{Register: qr_0} & \lstick{ {qr}_{0} : } & \gate{\mathrm{H}} & \meter & \qw & \qw & \qw\\ + \nghost{Register: qr_1} & \lstick{ {qr}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: 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 466c0d874f2a..b919ae9398d8 100644 --- a/test/python/visualization/references/test_latex_no_barriers_false.tex +++ b/test/python/visualization/references/test_latex_no_barriers_false.tex @@ -5,8 +5,8 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: 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 66908ee6f279..885c96214ba3 100644 --- a/test/python/visualization/references/test_latex_no_ops.tex +++ b/test/python/visualization/references/test_latex_no_ops.tex @@ -5,8 +5,8 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \qw\\ + \nghost{Register: 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 fc75e45410a8..44cad86065fd 100644 --- a/test/python/visualization/references/test_latex_normal.tex +++ b/test/python/visualization/references/test_latex_normal.tex @@ -5,10 +5,10 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: 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 4c898e8ec71f..5291a115b7d4 100644 --- a/test/python/visualization/references/test_latex_partial_layout.tex +++ b/test/python/visualization/references/test_latex_partial_layout.tex @@ -5,10 +5,10 @@ \begin{document} \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{q} & \lstick{ {q}_{2}\mapsto{0} : } & \qw & \qw & \qw\\ - \nghost{q} & \lstick{ {q}_{0}\mapsto{1} : } & \qw & \qw & \qw\\ - \nghost{q} & \lstick{ {q}_{1}\mapsto{2} : } & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{0},\mathrm{\pi}\mathrm{)}} & \qw & \qw\\ - \nghost{ancilla} & \lstick{ {ancilla}_{0}\mapsto{3} : } & \qw & \qw & \qw\\ - \nghost{ancilla} & \lstick{ {ancilla}_{1}\mapsto{4} : } & \qw & \qw & \qw\\ + \nghost{Register: q} & \lstick{ {q}_{2}\mapsto{0} : } & \qw & \qw & \qw\\ + \nghost{Register: q} & \lstick{ {q}_{0}\mapsto{1} : } & \qw & \qw & \qw\\ + \nghost{Register: q} & \lstick{ {q}_{1}\mapsto{2} : } & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{0},\mathrm{\pi}\mathrm{)}} & \qw & \qw\\ + \nghost{Register: ancilla} & \lstick{ {ancilla}_{0}\mapsto{3} : } & \qw & \qw & \qw\\ + \nghost{Register: ancilla} & \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 257e0e65bb81..b47dd46da8e9 100644 --- a/test/python/visualization/references/test_latex_pauli_clifford.tex +++ b/test/python/visualization/references/test_latex_pauli_clifford.tex @@ -5,10 +5,10 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \gate{\mathrm{Y}} & \gate{\mathrm{Z}} & \gate{\mathrm{I}} & \qw & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \ctrl{1} & \ctrl{1} & \ctrl{1} & \qw & \qw & \qw\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \targ & \gate{\mathrm{Y}} & \control\qw & \qw & \qw & \qw\\ + \nghost{Register: 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{Register: 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 1bf1b242b72d..aafb146af06f 100644 --- a/test/python/visualization/references/test_latex_pi_param_expr.tex +++ b/test/python/visualization/references/test_latex_pi_param_expr.tex @@ -5,6 +5,6 @@ \begin{document} \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\\ + \nghost{Register: 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 b637e301a4ec..1e9ff8ebb27f 100644 --- a/test/python/visualization/references/test_latex_plot_barriers_false.tex +++ b/test/python/visualization/references/test_latex_plot_barriers_false.tex @@ -5,8 +5,8 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw & \qw\\ + \nghost{Register: 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 20ba9f032e7a..e17c0a6d5420 100644 --- a/test/python/visualization/references/test_latex_plot_barriers_true.tex +++ b/test/python/visualization/references/test_latex_plot_barriers_true.tex @@ -5,8 +5,8 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} \barrier[0em]{1} & \qw & \qw \barrier[0em]{1} & \qw & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw & \qw\\ + \nghost{Register: 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 983dc49cce87..637af3200c2d 100644 --- a/test/python/visualization/references/test_latex_plot_partial_barriers.tex +++ b/test/python/visualization/references/test_latex_plot_partial_barriers.tex @@ -5,8 +5,8 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} \barrier[0em]{0} & \qw & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \qw & \qw & \qw & \qw\\ + \nghost{Register: 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 f5d8222e04a0..7408c3ccd094 100644 --- a/test/python/visualization/references/test_latex_r_gates.tex +++ b/test/python/visualization/references/test_latex_r_gates.tex @@ -5,9 +5,9 @@ \begin{document} \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\\ + \nghost{Register: 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{Register: 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{Register: 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{Register: 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 d2ed5761b7cf..c756be517ebf 100644 --- a/test/python/visualization/references/test_latex_reverse_bits.tex +++ b/test/python/visualization/references/test_latex_reverse_bits.tex @@ -5,8 +5,8 @@ \begin{document} \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\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \qw & \ctrl{1} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \targ & \ctrl{1} & \qw & \qw\\ + \nghost{Register: 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 9eac52cc07e4..7db7815b8072 100644 --- a/test/python/visualization/references/test_latex_scale_default.tex +++ b/test/python/visualization/references/test_latex_scale_default.tex @@ -5,10 +5,10 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ + \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ + \nghost{Register: 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 9eac52cc07e4..7db7815b8072 100644 --- a/test/python/visualization/references/test_latex_scale_double.tex +++ b/test/python/visualization/references/test_latex_scale_double.tex @@ -5,10 +5,10 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ + \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ + \nghost{Register: 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 9eac52cc07e4..7db7815b8072 100644 --- a/test/python/visualization/references/test_latex_scale_half.tex +++ b/test/python/visualization/references/test_latex_scale_half.tex @@ -5,10 +5,10 @@ \begin{document} \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\\ + \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ + \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ + \nghost{Register: 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 1ebb9ae85bae..831665d9bba8 100644 --- a/test/python/visualization/references/test_latex_teleport.tex +++ b/test/python/visualization/references/test_latex_teleport.tex @@ -5,9 +5,9 @@ \begin{document} \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{q_0} & \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\\ - \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\\ + \nghost{Register: q_0} & \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\\ + \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \ctrl{1} & \qw & \targ & \meter & \qw & \qw & \qw & \qw & \qw & \qw\\ + \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \targ & \qw & \qw & \qw & \qw & \gate{\mathrm{Z}} & \gate{\mathrm{X}} & \meter & \qw & \qw\\ + \nghost{Register: 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 b0059cfec423..3163ed841a29 100644 --- a/test/python/visualization/references/test_latex_tiny.tex +++ b/test/python/visualization/references/test_latex_tiny.tex @@ -5,6 +5,6 @@ \begin{document} \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ + \nghost{Register: 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 7a49f7ec4026..7f7a5588d5ea 100644 --- a/test/python/visualization/references/test_latex_u_gates.tex +++ b/test/python/visualization/references/test_latex_u_gates.tex @@ -5,9 +5,9 @@ \begin{document} \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\\ + \nghost{Register: 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{Register: 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{Register: 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{Register: 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 From 5eaaf4286d8d2449f25bf559698e82e84d7f112a Mon Sep 17 00:00:00 2001 From: JoshDumo Date: Sat, 12 Jun 2021 13:22:19 +0900 Subject: [PATCH 4/6] fixed scaling issue using scalebox. Improved label strings --- qiskit/visualization/latex.py | 48 ++++------- .../references/test_latex_4597.tex | 13 +-- .../references/test_latex_big_gates.tex | 17 ++-- .../references/test_latex_cnot.tex | 15 ++-- .../references/test_latex_conditional.tex | 11 +-- .../test_latex_creg_initial_false.tex | 13 +-- .../test_latex_creg_initial_true.tex | 11 +-- .../references/test_latex_cswap_rzz.tex | 15 ++-- .../references/test_latex_deep.tex | 7 +- .../references/test_latex_empty.tex | 7 +- .../references/test_latex_ghz_to_gate.tex | 15 ++-- .../references/test_latex_global_phase.tex | 11 +-- .../references/test_latex_huge.tex | 85 ++++++++++--------- .../references/test_latex_init_reset.tex | 9 +- .../references/test_latex_inst_with_cbits.tex | 21 ++--- .../references/test_latex_iqx.tex | 19 +++-- .../references/test_latex_long_name.tex | 15 ++-- .../references/test_latex_meas_condition.tex | 11 +-- .../test_latex_no_barriers_false.tex | 11 +-- .../references/test_latex_no_ops.tex | 11 +-- .../references/test_latex_normal.tex | 15 ++-- .../references/test_latex_partial_layout.tex | 15 ++-- .../references/test_latex_pauli_clifford.tex | 15 ++-- .../references/test_latex_pi_param_expr.tex | 7 +- .../test_latex_plot_barriers_false.tex | 11 +-- .../test_latex_plot_barriers_true.tex | 11 +-- .../test_latex_plot_partial_barriers.tex | 11 +-- .../references/test_latex_r_gates.tex | 13 +-- .../references/test_latex_reverse_bits.tex | 11 +-- .../references/test_latex_scale_default.tex | 15 ++-- .../references/test_latex_scale_double.tex | 15 ++-- .../references/test_latex_scale_half.tex | 15 ++-- .../references/test_latex_teleport.tex | 13 +-- .../references/test_latex_tiny.tex | 7 +- .../references/test_latex_u_gates.tex | 13 +-- 35 files changed, 286 insertions(+), 266 deletions(-) diff --git a/qiskit/visualization/latex.py b/qiskit/visualization/latex.py index 0230da572a8a..78ef0f4a7d10 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 = {} @@ -162,15 +162,19 @@ def latex(self): header_2 = r""" \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} """ + header_scale = "\\scalebox{{{}}}".format(self.scale) + "{" + qcircuit_line = r""" \Qcircuit @C=%.1fem @R=%.1fem @!R { \\ """ output = io.StringIO() output.write(header_1) output.write(header_2) + output.write(header_scale) if self.global_phase: output.write( r"""{$\mathrm{%s} \mathrm{%s}$}""" @@ -185,7 +189,7 @@ def latex(self): output.write(" & ") else: output.write(r"\\ " + "\n") - output.write(r"\\ " + "}\n") + output.write(r"\\ " + "}}\n") output.write("\\end{document}") contents = output.getvalue() output.close() @@ -216,34 +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] = ( - "\\nghost{Register: " + reg.name + "} & " + "\\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] = ( - "\\nghost{Register: " - + self.bit_locations[self.ordered_bits[i]]["register"].name - + "_" - + str(self.bit_locations[self.ordered_bits[i]]["index"]) - + "} & " - + "\\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 = "\\nghost{Register: " - label += self.bit_locations[self.ordered_bits[i]]["register"].name - label += "_" + str(self.bit_locations[self.ordered_bits[i]]["index"]) + "} & " - label += "\\lstick{{ {{{}}}_{{{}}} : ".format( + label = " {{{}}}_{{{}}} : ".format( self.bit_locations[self.ordered_bits[i]]["register"].name, self.bit_locations[self.ordered_bits[i]]["index"], ) @@ -255,21 +245,17 @@ def _initialize_latex_array(self): virt_reg = next( reg for reg in self.layout.get_registers() if virt_bit in reg ) - label = "\\nghost{Register: " + virt_reg.name + "} & " - label += "\\lstick{{ {{{}}}_{{{}}}\\mapsto{{{}}} : ".format( + label = " {{{}}}_{{{}}}\\mapsto{{{}}} : ".format( virt_reg.name, virt_reg[:].index(virt_bit), bit_location["index"] ) except StopIteration: - label = "\\nghost{Register: " + bit_location["index"] + "} & " - label += "\\lstick{{ {{{}}} : ".format(bit_location["index"]) + label = " {{{}}} : ".format(bit_location["index"]) else: - label = "\\nghost{Register: " + bit_location["index"] + "} & " - label += "\\lstick{{ {{{}}} : ".format(bit_location["index"]) + label = " {{{}}} : ".format(bit_location["index"]) if self.initial_state: - #label += "\\ket{{0}}" 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 2e3253df5604..1cd225023326 100644 --- a/test/python/visualization/references/test_latex_4597.tex +++ b/test/python/visualization/references/test_latex_4597.tex @@ -1,13 +1,14 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \qw & \qw & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \qw & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \gate{\mathrm{X}} & \qw & \qw\\ - \nghost{Register: c} & \lstick{c:} & \lstick{/_{_{3}}} \cw & \dstick{_{_{=2}}} \cw \cwx[-1] & \cw & \cw\\ -\\ } + \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 8397afe323e5..cdd25ebc217c 100644 --- a/test/python/visualization/references/test_latex_big_gates.tex +++ b/test/python/visualization/references/test_latex_big_gates.tex @@ -1,15 +1,16 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=1.0em @!R { \\ - \nghost{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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\\ -\\ } + \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 7bea9eede921..72569cea4973 100644 --- a/test/python/visualization/references/test_latex_cnot.tex +++ b/test/python/visualization/references/test_latex_cnot.tex @@ -1,14 +1,15 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \ctrl{1} & \ctrl{1} & \ctrlo{1} & \ctrl{1} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \targ & \ctrl{1} & \targ & \ctrlo{1} & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \qw & \targ & \ctrlo{-1} & \ctrl{2} & \qw & \qw\\ - \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \qw & \qw & \qw & \ctrl{-1} & \qw & \qw & \qw\\ - \nghost{Register: q_4} & \lstick{ {q}_{4} : } & \qw & \qw & \qw & \qw & \targ & \qw & \qw\\ -\\ } + \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 4f8a7cb5acfd..7e19e3eac95e 100644 --- a/test/python/visualization/references/test_latex_conditional.tex +++ b/test/python/visualization/references/test_latex_conditional.tex @@ -1,12 +1,13 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \meter & \qw & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \meter & \qw & \qw & \qw\\ - \nghost{Register: c} & \lstick{c:} & \lstick{/_{_{2}}} \cw & \dstick{_{_{0}}} \cw \cwx[-2] & \dstick{_{_{1}}} \cw \cwx[-1] & \dstick{_{_{=2}}} \cw \cwx[-2] & \cw & \cw\\ -\\ } + \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 97e3feff7302..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,13 +1,14 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{X}} & \qw & \qw & \qw\\ - \nghost{Register: c_0} & \lstick{c_{0}:} & \cw & \cw & \cw & \cw\\ - \nghost{Register: c_1} & \lstick{c_{1}:} & \cw & \cw & \cw & \cw\\ -\\ } + \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 274eb5fc64c0..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,12 +1,13 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : \ket{{0}} } & \gate{\mathrm{X}} & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : \ket{{0}} } & \gate{\mathrm{X}} & \qw & \qw & \qw\\ - \nghost{Register: c} & \lstick{c:0} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw\\ -\\ } + \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 5c4305d6bc67..a5f21e41d499 100644 --- a/test/python/visualization/references/test_latex_cswap_rzz.tex +++ b/test/python/visualization/references/test_latex_cswap_rzz.tex @@ -1,14 +1,15 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \ctrl{1} & \control \qw & \qw & \qw & \qw & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{X}} & \qswap & \ctrl{-1} & \qw & \qw & \qw & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \qswap \qwx[-1] & \ctrlo{-1} & \qw & \qw & \qw & \qw & \qw\\ - \nghost{Register: 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{Register: q_4} & \lstick{ {q}_{4} : } & \qw & \qw & \ctrlo{-1} & \qw & \qw & \qw & \qw & \qw\\ -\\ } + \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 e6edebbbfa3e..dd3f8732d560 100644 --- a/test/python/visualization/references/test_latex_deep.tex +++ b/test/python/visualization/references/test_latex_deep.tex @@ -1,10 +1,11 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: 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\\ -\\ } + \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 01d7defdf9ce..a27135698c67 100644 --- a/test/python/visualization/references/test_latex_empty.tex +++ b/test/python/visualization/references/test_latex_empty.tex @@ -1,10 +1,11 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=1.0em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \qw & \qw\\ -\\ } + \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 fbc703108e7f..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,14 +1,15 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \ctrl{1} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \multigate{2}{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{0} & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \ghost{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{2} & \qw & \qw\\ - \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \ghost{\mathrm{Ctrl\mbox{-}GHZ\,Circuit}}_<<<{1} & \qw & \qw\\ - \nghost{Register: q_4} & \lstick{ {q}_{4} : } & \ctrlo{-1} & \qw & \qw\\ -\\ } + \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 d5c9e039f10d..15cca8b98461 100644 --- a/test/python/visualization/references/test_latex_global_phase.tex +++ b/test/python/visualization/references/test_latex_global_phase.tex @@ -1,12 +1,13 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} -{$\mathrm{global\,phase:\,} \mathrm{\frac{\pi}{2}}$} +\scalebox{1.0}{{$\mathrm{global\,phase:\,} \mathrm{\frac{\pi}{2}}$} \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \gate{\mathrm{H}} & \qw & \qw\\ -\\ } + \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 4e69ea00a5e4..660f99ea8e8b 100644 --- a/test/python/visualization/references/test_latex_huge.tex +++ b/test/python/visualization/references/test_latex_huge.tex @@ -1,49 +1,50 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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\\ -\\ } + \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 bd2d109e9ff7..738b88fbb632 100644 --- a/test/python/visualization/references/test_latex_init_reset.tex +++ b/test/python/visualization/references/test_latex_init_reset.tex @@ -1,11 +1,12 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=1.0em @!R { \\ - \nghost{Register: 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{Register: 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\\ -\\ } + \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 928803b708e1..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,17 +1,18 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=1.0em @!R { \\ - \nghost{Register: qr_0} & \lstick{ {qr}_{0} : } & \qw & \qw & \qw\\ - \nghost{Register: qr_1} & \lstick{ {qr}_{1} : } & \multigate{5}{\mathrm{instruction}}_<<<{0} & \qw & \qw\\ - \nghost{Register: qr_2} & \lstick{ {qr}_{2} : } & \ghost{\mathrm{instruction}}_<<<{1} & \qw & \qw\\ - \nghost{Register: qr_3} & \lstick{ {qr}_{3} : } & \ghost{\mathrm{instruction}} & \qw & \qw\\ - \nghost{Register: cr_0} & \lstick{cr_{0}:} & \cghost{\mathrm{instruction}} & \cw & \cw\\ - \nghost{Register: cr_1} & \lstick{cr_{1}:} & \cghost{\mathrm{instruction}}_<<<{1} & \cw & \cw\\ - \nghost{Register: cr_2} & \lstick{cr_{2}:} & \cghost{\mathrm{instruction}}_<<<{0} & \cw & \cw\\ - \nghost{Register: cr_3} & \lstick{cr_{3}:} & \cw & \cw & \cw\\ -\\ } + \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 40585d86414d..9ff04ec203e6 100644 --- a/test/python/visualization/references/test_latex_iqx.tex +++ b/test/python/visualization/references/test_latex_iqx.tex @@ -1,16 +1,17 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: 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{Register: 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{Register: 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{Register: 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{Register: 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{U}_1\,\mathrm{(}\mathrm{\frac{\pi}{2}}\mathrm{)}} & \qw & \qw & \qw & \qw & \qw\\ - \nghost{Register: q_5} & \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\\ - \nghost{Register: 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\\ -\\ } + \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{U}_1\,\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{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\\ + \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 9b71f7ab795d..2fe6c106ce9c 100644 --- a/test/python/visualization/references/test_latex_long_name.tex +++ b/test/python/visualization/references/test_latex_long_name.tex @@ -1,14 +1,15 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: veryLongQuantumRegisterName_0} & \lstick{ {veryLongQuantumRegisterName}_{0} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: veryLongQuantumRegisterName_1} & \lstick{ {veryLongQuantumRegisterName}_{1} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: veryLongQuantumRegisterName_2} & \lstick{ {veryLongQuantumRegisterName}_{2} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: veryLongQuantumRegisterName_3} & \lstick{ {veryLongQuantumRegisterName}_{3} : } & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q0_0} & \lstick{ {q0}_{0} : } & \qw & \qw & \qw & \qw & \qw\\ -\\ } + \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 8ebeca3ce973..b3fabab133cb 100644 --- a/test/python/visualization/references/test_latex_meas_condition.tex +++ b/test/python/visualization/references/test_latex_meas_condition.tex @@ -1,12 +1,13 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: qr_0} & \lstick{ {qr}_{0} : } & \gate{\mathrm{H}} & \meter & \qw & \qw & \qw\\ - \nghost{Register: qr_1} & \lstick{ {qr}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: cr} & \lstick{cr:} & \lstick{/_{_{2}}} \cw & \dstick{_{_{0}}} \cw \cwx[-2] & \dstick{_{_{=1}}} \cw \cwx[-1] & \cw & \cw\\ -\\ } + \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 b919ae9398d8..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,12 +1,13 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: c} & \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw\\ -\\ } + \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 885c96214ba3..ce478cd7051d 100644 --- a/test/python/visualization/references/test_latex_no_ops.tex +++ b/test/python/visualization/references/test_latex_no_ops.tex @@ -1,12 +1,13 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=1.0em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \qw\\ - \nghost{Register: c} & \lstick{c:} & \lstick{/_{_{3}}} \cw & \cw\\ -\\ } + \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 44cad86065fd..badc566cf7a9 100644 --- a/test/python/visualization/references/test_latex_normal.tex +++ b/test/python/visualization/references/test_latex_normal.tex @@ -1,14 +1,15 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_4} & \lstick{ {q}_{4} : } & \gate{\mathrm{H}} & \qw & \qw\\ -\\ } + \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 5291a115b7d4..ee303e0cf39a 100644 --- a/test/python/visualization/references/test_latex_partial_layout.tex +++ b/test/python/visualization/references/test_latex_partial_layout.tex @@ -1,14 +1,15 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q} & \lstick{ {q}_{2}\mapsto{0} : } & \qw & \qw & \qw\\ - \nghost{Register: q} & \lstick{ {q}_{0}\mapsto{1} : } & \qw & \qw & \qw\\ - \nghost{Register: q} & \lstick{ {q}_{1}\mapsto{2} : } & \gate{\mathrm{U}_2\,\mathrm{(}\mathrm{0},\mathrm{\pi}\mathrm{)}} & \qw & \qw\\ - \nghost{Register: ancilla} & \lstick{ {ancilla}_{0}\mapsto{3} : } & \qw & \qw & \qw\\ - \nghost{Register: ancilla} & \lstick{ {ancilla}_{1}\mapsto{4} : } & \qw & \qw & \qw\\ -\\ } + \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 b47dd46da8e9..daa59be9c186 100644 --- a/test/python/visualization/references/test_latex_pauli_clifford.tex +++ b/test/python/visualization/references/test_latex_pauli_clifford.tex @@ -1,14 +1,15 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{X}} & \gate{\mathrm{Y}} & \gate{\mathrm{Z}} & \gate{\mathrm{I}} & \qw & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \ctrl{1} & \ctrl{1} & \ctrl{1} & \qw & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \targ & \gate{\mathrm{Y}} & \control\qw & \qw & \qw & \qw\\ - \nghost{Register: 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{Register: q_4} & \lstick{ {q}_{4} : } & \qswap \qwx[-1] & \qw & \qw & \ghost{\mathrm{Iswap}}_<<<{1} & \ghost{\mathrm{Dcx}}_<<<{1} & \qw & \qw\\ -\\ } + \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 aafb146af06f..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,10 +1,11 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{R}_\mathrm{X}\,\mathrm{(}\mathrm{(\pi\,-\,x)*(\pi\,-\,y)}\mathrm{)}} & \qw & \qw\\ -\\ } + \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 1e9ff8ebb27f..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,12 +1,13 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw & \qw & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw & \qw\\ - \nghost{Register: c} & \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw & \cw & \cw\\ -\\ } + \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 e17c0a6d5420..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,12 +1,13 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} \barrier[0em]{1} & \qw & \qw \barrier[0em]{1} & \qw & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \qw & \gate{\mathrm{H}} & \qw & \qw & \qw\\ - \nghost{Register: c} & \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw & \cw & \cw\\ -\\ } + \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 637af3200c2d..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,12 +1,13 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} \barrier[0em]{0} & \qw & \gate{\mathrm{H}} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \qw & \qw & \qw & \qw\\ - \nghost{Register: c} & \lstick{c:} & \lstick{/_{_{2}}} \cw & \cw & \cw & \cw & \cw\\ -\\ } + \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 7408c3ccd094..eb86b872a3ef 100644 --- a/test/python/visualization/references/test_latex_r_gates.tex +++ b/test/python/visualization/references/test_latex_r_gates.tex @@ -1,13 +1,14 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: 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{Register: 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{Register: 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{Register: 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\\ -\\ } + \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 c756be517ebf..3bc7b4cc6fc3 100644 --- a/test/python/visualization/references/test_latex_reverse_bits.tex +++ b/test/python/visualization/references/test_latex_reverse_bits.tex @@ -1,12 +1,13 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \qw & \ctrl{1} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \qw & \targ & \ctrl{1} & \qw & \qw\\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \ctrl{-1} & \targ & \qw & \qw\\ -\\ } + \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 7db7815b8072..10885e1cea87 100644 --- a/test/python/visualization/references/test_latex_scale_default.tex +++ b/test/python/visualization/references/test_latex_scale_default.tex @@ -1,14 +1,15 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=1.0em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ - \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ - \nghost{Register: q_4} & \lstick{ {q}_{4} : } & \ghost{\mathrm{Unitary}}_<<<{4} & \qw & \qw\\ -\\ } + \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 7db7815b8072..ba57264f9e2d 100644 --- a/test/python/visualization/references/test_latex_scale_double.tex +++ b/test/python/visualization/references/test_latex_scale_double.tex @@ -1,14 +1,15 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{2.0}{ \Qcircuit @C=1.0em @R=1.0em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ - \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ - \nghost{Register: q_4} & \lstick{ {q}_{4} : } & \ghost{\mathrm{Unitary}}_<<<{4} & \qw & \qw\\ -\\ } + \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 7db7815b8072..0f33d9d09d0a 100644 --- a/test/python/visualization/references/test_latex_scale_half.tex +++ b/test/python/visualization/references/test_latex_scale_half.tex @@ -1,14 +1,15 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{0.5}{ \Qcircuit @C=1.0em @R=1.0em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \multigate{4}{\mathrm{Unitary}}_<<<{0} & \qw & \qw\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \ghost{\mathrm{Unitary}}_<<<{1} & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \ghost{\mathrm{Unitary}}_<<<{2} & \qw & \qw\\ - \nghost{Register: q_3} & \lstick{ {q}_{3} : } & \ghost{\mathrm{Unitary}}_<<<{3} & \qw & \qw\\ - \nghost{Register: q_4} & \lstick{ {q}_{4} : } & \ghost{\mathrm{Unitary}}_<<<{4} & \qw & \qw\\ -\\ } + \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 831665d9bba8..3fd829a44279 100644 --- a/test/python/visualization/references/test_latex_teleport.tex +++ b/test/python/visualization/references/test_latex_teleport.tex @@ -1,13 +1,14 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \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\\ - \nghost{Register: q_1} & \lstick{ {q}_{1} : } & \gate{\mathrm{H}} & \ctrl{1} & \qw & \targ & \meter & \qw & \qw & \qw & \qw & \qw & \qw\\ - \nghost{Register: q_2} & \lstick{ {q}_{2} : } & \qw & \targ & \qw & \qw & \qw & \qw & \gate{\mathrm{Z}} & \gate{\mathrm{X}} & \meter & \qw & \qw\\ - \nghost{Register: 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\\ -\\ } + \nghost{ {q}_{0} : } & \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\\ + \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 3163ed841a29..9ea6881f641e 100644 --- a/test/python/visualization/references/test_latex_tiny.tex +++ b/test/python/visualization/references/test_latex_tiny.tex @@ -1,10 +1,11 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: q_0} & \lstick{ {q}_{0} : } & \gate{\mathrm{H}} & \qw & \qw\\ -\\ } + \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 7f7a5588d5ea..6dc9adf57690 100644 --- a/test/python/visualization/references/test_latex_u_gates.tex +++ b/test/python/visualization/references/test_latex_u_gates.tex @@ -1,13 +1,14 @@ \documentclass[border=2px]{standalone} \usepackage[braket, qm]{qcircuit} +\usepackage{graphicx} \begin{document} - +\scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{Register: 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{Register: 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{Register: 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{Register: 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\\ -\\ } + \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 From 2de16979d2ad811dff4ab9be79893bee48c70f80 Mon Sep 17 00:00:00 2001 From: JoshDumo Date: Mon, 14 Jun 2021 08:38:15 +0900 Subject: [PATCH 5/6] blacked code --- docs/conf.py | 65 ++++++++-------- examples/python/circuit_draw.py | 1 + examples/python/ghz.py | 10 +-- examples/python/ibmq/ghz.py | 12 +-- examples/python/ibmq/hello_quantum.py | 17 ++-- examples/python/ibmq/qft.py | 8 +- .../python/ibmq/using_qiskit_terra_level_0.py | 8 +- .../python/ibmq/using_qiskit_terra_level_1.py | 10 +-- .../python/ibmq/using_qiskit_terra_level_2.py | 4 +- examples/python/initialize.py | 13 ++-- examples/python/load_qasm.py | 2 +- examples/python/qft.py | 8 +- examples/python/rippleadd.py | 27 ++++++- examples/python/stochastic_swap.py | 4 +- examples/python/teleport.py | 12 ++- examples/python/using_qiskit_terra_level_0.py | 2 +- qiskit/visualization/latex.py | 4 +- setup.py | 77 +++++++++++-------- 18 files changed, 157 insertions(+), 127 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index bc5904223013..7fcf74a1a8bb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -32,19 +32,20 @@ """ import os + # Set env flag so that we can doc functions that may otherwise not be loaded # see for example interactive visualizations in qiskit.visualization. -os.environ['QISKIT_DOCS'] = 'TRUE' +os.environ["QISKIT_DOCS"] = "TRUE" # -- Project information ----------------------------------------------------- -project = 'Qiskit' -copyright = '2019, Qiskit Development Team' # pylint: disable=redefined-builtin -author = 'Qiskit Development Team' +project = "Qiskit" +copyright = "2019, Qiskit Development Team" # pylint: disable=redefined-builtin +author = "Qiskit Development Team" # The short X.Y version -version = '' +version = "" # The full version, including alpha/beta/rc tags -release = '0.18.0' +release = "0.18.0" # -- General configuration --------------------------------------------------- @@ -56,19 +57,19 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.napoleon', - 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', - 'sphinx.ext.mathjax', - 'sphinx.ext.viewcode', - 'sphinx.ext.extlinks', - 'jupyter_sphinx', - 'sphinx_autodoc_typehints', - 'reno.sphinxext', - 'sphinx_panels', + "sphinx.ext.napoleon", + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.mathjax", + "sphinx.ext.viewcode", + "sphinx.ext.extlinks", + "jupyter_sphinx", + "sphinx_autodoc_typehints", + "reno.sphinxext", + "sphinx_panels", ] -html_static_path = ['_static'] -templates_path = ['_templates'] +html_static_path = ["_static"] +templates_path = ["_templates"] html_css_files = [] # ----------------------------------------------------------------------------- @@ -83,7 +84,7 @@ # ----------------------------------------------------------------------------- autodoc_default_options = { - 'inherited-members': None, + "inherited-members": None, } @@ -94,9 +95,7 @@ # A dictionary mapping 'figure', 'table', 'code-block' and 'section' to # strings that are used for format of figure numbers. As a special character, # %s will be replaced to figure number. -numfig_format = { - 'table': 'Table %s' -} +numfig_format = {"table": "Table %s"} # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # @@ -107,10 +106,10 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', '**.ipynb_checkpoints'] +exclude_patterns = ["_build", "**.ipynb_checkpoints"] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'colorful' +pygments_style = "colorful" # A boolean that decides whether module names are prepended to all object names # (for object types where a “module” of some kind is defined), e.g. for @@ -121,7 +120,7 @@ # (e.g., if this is set to ['foo.'], then foo.bar is shown under B, not F). # This can be handy if you document a project that consists of a single # package. Works only for the HTML builder currently. -modindex_common_prefix = ['qiskit.'] +modindex_common_prefix = ["qiskit."] # -- Configuration for extlinks extension ------------------------------------ # Refer to https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html @@ -132,16 +131,16 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'qiskit_sphinx_theme' # use the theme in subdir 'theme' +html_theme = "qiskit_sphinx_theme" # use the theme in subdir 'theme' -#html_sidebars = {'**': ['globaltoc.html']} -html_last_updated_fmt = '%Y/%m/%d' +# html_sidebars = {'**': ['globaltoc.html']} +html_last_updated_fmt = "%Y/%m/%d" html_theme_options = { - 'logo_only': True, - 'display_version': True, - 'prev_next_buttons_location': 'bottom', - 'style_external_links': True, + "logo_only": True, + "display_version": True, + "prev_next_buttons_location": "bottom", + "style_external_links": True, } -autoclass_content = 'both' +autoclass_content = "both" diff --git a/examples/python/circuit_draw.py b/examples/python/circuit_draw.py index 66ef3436aea9..b8efbbef4910 100644 --- a/examples/python/circuit_draw.py +++ b/examples/python/circuit_draw.py @@ -25,6 +25,7 @@ def build_bell_circuit(): qc.measure([0, 1], [0, 1]) return qc + # Create the circuit bell_circuit = build_bell_circuit() diff --git a/examples/python/ghz.py b/examples/python/ghz.py index 3851333e1e5f..469fdd268797 100644 --- a/examples/python/ghz.py +++ b/examples/python/ghz.py @@ -22,20 +22,20 @@ # Make a quantum circuit for the GHZ state. ############################################################### num_qubits = 5 -qc = QuantumCircuit(num_qubits, num_qubits, name='ghz') +qc = QuantumCircuit(num_qubits, num_qubits, name="ghz") # Create a GHZ state qc.h(0) -for i in range(num_qubits-1): - qc.cx(i, i+1) +for i in range(num_qubits - 1): + qc.cx(i, i + 1) # Insert a barrier before measurement qc.barrier() # Measure all of the qubits in the standard basis for i in range(num_qubits): qc.measure(i, i) -sim_backend = BasicAer.get_backend('qasm_simulator') +sim_backend = BasicAer.get_backend("qasm_simulator") job = execute(qc, sim_backend, shots=1024) result = job.result() -print('Qasm simulator : ') +print("Qasm simulator : ") print(result.get_counts(qc)) diff --git a/examples/python/ibmq/ghz.py b/examples/python/ibmq/ghz.py index e5dc1c841755..767113070825 100644 --- a/examples/python/ibmq/ghz.py +++ b/examples/python/ibmq/ghz.py @@ -22,12 +22,12 @@ # Make a quantum circuit for the GHZ state. ############################################################### num_qubits = 5 -qc = QuantumCircuit(num_qubits, num_qubits, name='ghz') +qc = QuantumCircuit(num_qubits, num_qubits, name="ghz") # Create a GHZ state qc.h(0) -for i in range(num_qubits-1): - qc.cx(i, i+1) +for i in range(num_qubits - 1): + qc.cx(i, i + 1) # Insert a barrier before measurement qc.barrier() # Measure all of the qubits in the standard basis @@ -41,10 +41,10 @@ # Second version: real device least_busy_device = least_busy( - provider.backends(simulator=False, - filters=lambda x: x.configuration().n_qubits > 4)) + provider.backends(simulator=False, filters=lambda x: x.configuration().n_qubits > 4) +) print("Running on current least busy device: ", least_busy_device) job = execute(qc, least_busy_device, shots=1024) result = job.result() -print('Physical device (%s) : ' % least_busy_device) +print("Physical device (%s) : " % least_busy_device) print(result.get_counts(qc)) diff --git a/examples/python/ibmq/hello_quantum.py b/examples/python/ibmq/hello_quantum.py index 29cfdca92d3c..63affd35cbbb 100644 --- a/examples/python/ibmq/hello_quantum.py +++ b/examples/python/ibmq/hello_quantum.py @@ -30,7 +30,7 @@ # See a list of available local simulators print("BasicAer backends: ", BasicAer.backends()) -backend_sim = BasicAer.get_backend('qasm_simulator') +backend_sim = BasicAer.get_backend("qasm_simulator") # Compile and run the Quantum circuit on a simulator backend job_sim = execute(qc, backend_sim) @@ -43,9 +43,11 @@ try: provider = IBMQ.load_account() except: - print("""WARNING: No valid IBMQ credentials found on disk. + print( + """WARNING: No valid IBMQ credentials found on disk. You must store your credentials using IBMQ.save_account(token, url). - For now, there's only access to local simulator backends...""") + For now, there's only access to local simulator backends...""" + ) exit(0) # see a list of available remote backends @@ -55,16 +57,17 @@ # Compile and run the Quantum Program on a real device backend # select those with at least 2 qubits try: - least_busy_device = least_busy(provider.backends( - filters=lambda x: x.configuration().n_qubits >= 2, simulator=False)) + least_busy_device = least_busy( + provider.backends(filters=lambda x: x.configuration().n_qubits >= 2, simulator=False) + ) except: print("All devices are currently unavailable.") print("Running on current least busy device: ", least_busy_device) -#running the job +# running the job job_exp = execute(qc, least_busy_device, shots=1024, max_credits=10) result_exp = job_exp.result() # Show the results -print('Counts: ', result_exp.get_counts(qc)) +print("Counts: ", result_exp.get_counts(qc)) diff --git a/examples/python/ibmq/qft.py b/examples/python/ibmq/qft.py index 2731a2b1c154..4d6822528d24 100644 --- a/examples/python/ibmq/qft.py +++ b/examples/python/ibmq/qft.py @@ -27,14 +27,14 @@ def input_state(circ, n): """n-qubit input state for QFT that produces output 1.""" for j in range(n): circ.h(j) - circ.p(-math.pi/float(2**(j)), j) + circ.p(-math.pi / float(2 ** (j)), j) def qft(circ, n): """n-qubit QFT on q in circ.""" for j in range(n): for k in range(j): - circ.cp(math.pi/float(2**(j-k)), j, k) + circ.cp(math.pi / float(2 ** (j - k)), j, k) circ.h(j) @@ -74,8 +74,8 @@ def qft(circ, n): # Second version: real device least_busy_device = least_busy( - provider.backends(simulator=False, - filters=lambda x: x.configuration().n_qubits > 4)) + provider.backends(simulator=False, filters=lambda x: x.configuration().n_qubits > 4) +) print("Running on current least busy device: ", least_busy_device) job = execute([qft3, qft4, qft5], least_busy_device, shots=1024) result = job.result() diff --git a/examples/python/ibmq/using_qiskit_terra_level_0.py b/examples/python/ibmq/using_qiskit_terra_level_0.py index 9ae6b1ddb4c6..49a8c137104b 100644 --- a/examples/python/ibmq/using_qiskit_terra_level_0.py +++ b/examples/python/ibmq/using_qiskit_terra_level_0.py @@ -37,19 +37,19 @@ qc1 = QuantumCircuit(2, 2) qc1.h(0) qc1.cx(0, 1) -qc1.measure([0,1], [0,1]) +qc1.measure([0, 1], [0, 1]) # making another circuit: superpositions qc2 = QuantumCircuit(2, 2) -qc2.h([0,1]) -qc2.measure([0,1], [0,1]) +qc2.h([0, 1]) +qc2.measure([0, 1], [0, 1]) # setting up the backend print("(BasicAER Backends)") print(BasicAer.backends()) # running the job -job_sim = execute([qc1, qc2], BasicAer.get_backend('qasm_simulator')) +job_sim = execute([qc1, qc2], BasicAer.get_backend("qasm_simulator")) sim_result = job_sim.result() # Show the results diff --git a/examples/python/ibmq/using_qiskit_terra_level_1.py b/examples/python/ibmq/using_qiskit_terra_level_1.py index b3673ad1d937..1722b367e1bc 100644 --- a/examples/python/ibmq/using_qiskit_terra_level_1.py +++ b/examples/python/ibmq/using_qiskit_terra_level_1.py @@ -40,18 +40,18 @@ qc1 = QuantumCircuit(2, 2, name="bell") qc1.h(0) qc1.cx(0, 1) -qc1.measure([0,1], [0,1]) +qc1.measure([0, 1], [0, 1]) # Making another circuit: superpositions qc2 = QuantumCircuit(2, 2, name="superposition") -qc2.h([0,1]) -qc2.measure([0,1], [0,1]) +qc2.h([0, 1]) +qc2.measure([0, 1], [0, 1]) # Setting up the backend print("(Aer Backends)") for backend in BasicAer.backends(): print(backend.status()) -qasm_simulator = BasicAer.get_backend('qasm_simulator') +qasm_simulator = BasicAer.get_backend("qasm_simulator") # Compile and run the circuit on a real device backend @@ -87,7 +87,7 @@ sim_job = qasm_simulator.run(qobj) # Getting the result -sim_result=sim_job.result() +sim_result = sim_job.result() # Show the results print(sim_result.get_counts(qc1)) diff --git a/examples/python/ibmq/using_qiskit_terra_level_2.py b/examples/python/ibmq/using_qiskit_terra_level_2.py index ad5b60ca7ff3..edf2ff02d1a9 100644 --- a/examples/python/ibmq/using_qiskit_terra_level_2.py +++ b/examples/python/ibmq/using_qiskit_terra_level_2.py @@ -56,7 +56,7 @@ print("(Aer Backends)") for backend in BasicAer.backends(): print(backend.status()) -qasm_simulator = BasicAer.get_backend('qasm_simulator') +qasm_simulator = BasicAer.get_backend("qasm_simulator") # Compile and run the circuit on a real device backend @@ -97,7 +97,7 @@ pm.append(CXDirection(coupling_map)) # unroll to single qubit gates -pm.append(Unroller(['u1', 'u2', 'u3', 'id', 'cx'])) +pm.append(Unroller(["u1", "u2", "u3", "id", "cx"])) qc1_new = pm.run(qc1) qc2_new = pm.run(qc2) diff --git a/examples/python/initialize.py b/examples/python/initialize.py index 8132941cafbc..b1e6325e2dad 100644 --- a/examples/python/initialize.py +++ b/examples/python/initialize.py @@ -39,7 +39,8 @@ 0, 0, 1 / math.sqrt(4) * complex(1, 0), - 1 / math.sqrt(8) * complex(1, 0)] + 1 / math.sqrt(8) * complex(1, 0), +] circuit.initialize(desired_vector, [0, 1, 2, 3]) @@ -54,17 +55,15 @@ # Desired vector print("Desired probabilities: ") -print(str(list(map(lambda x: format(abs(x * x), '.3f'), desired_vector)))) +print(str(list(map(lambda x: format(abs(x * x), ".3f"), desired_vector)))) # Initialize on local simulator -sim_backend = BasicAer.get_backend('qasm_simulator') +sim_backend = BasicAer.get_backend("qasm_simulator") job = execute(circuit, sim_backend, shots=shots) result = job.result() counts = result.get_counts(circuit) -qubit_strings = [format(i, '0%sb' % 4) for - i in range(2 ** 4)] +qubit_strings = [format(i, "0%sb" % 4) for i in range(2 ** 4)] print("Probabilities from simulator: ") -print([format(counts.get(s, 0) / shots, '.3f') for - s in qubit_strings]) +print([format(counts.get(s, 0) / shots, ".3f") for s in qubit_strings]) diff --git a/examples/python/load_qasm.py b/examples/python/load_qasm.py index 336482255234..d9da1f1dcd58 100644 --- a/examples/python/load_qasm.py +++ b/examples/python/load_qasm.py @@ -19,7 +19,7 @@ print(circ) # See the backend -sim_backend = BasicAer.get_backend('qasm_simulator') +sim_backend = BasicAer.get_backend("qasm_simulator") # Compile and run the Quantum circuit on a local simulator backend diff --git a/examples/python/qft.py b/examples/python/qft.py index 85ea8191a9c2..5849bb3813ae 100644 --- a/examples/python/qft.py +++ b/examples/python/qft.py @@ -26,14 +26,14 @@ def input_state(circ, n): """n-qubit input state for QFT that produces output 1.""" for j in range(n): circ.h(j) - circ.p(-math.pi/float(2**(j)), j) + circ.p(-math.pi / float(2 ** (j)), j) def qft(circ, n): """n-qubit QFT on q in circ.""" for j in range(n): for k in range(j): - circ.cp(math.pi/float(2**(j-k)), j, k) + circ.cp(math.pi / float(2 ** (j - k)), j, k) circ.h(j) @@ -66,8 +66,8 @@ def qft(circ, n): print(qft4) print(qft5) -print('Qasm simulator') -sim_backend = BasicAer.get_backend('qasm_simulator') +print("Qasm simulator") +sim_backend = BasicAer.get_backend("qasm_simulator") job = execute([qft3, qft4, qft5], sim_backend, shots=1024) result = job.result() print(result.get_counts(qft3)) diff --git a/examples/python/rippleadd.py b/examples/python/rippleadd.py index ebfabb92c490..6036e3d79f4c 100644 --- a/examples/python/rippleadd.py +++ b/examples/python/rippleadd.py @@ -23,9 +23,30 @@ # Set the backend name and coupling map. ############################################################### backend = BasicAer.get_backend("qasm_simulator") -coupling_map = [[0, 1], [0, 8], [1, 2], [1, 9], [2, 3], [2, 10], [3, 4], [3, 11], - [4, 5], [4, 12], [5, 6], [5, 13], [6, 7], [6, 14], [7, 15], [8, 9], - [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15]] +coupling_map = [ + [0, 1], + [0, 8], + [1, 2], + [1, 9], + [2, 3], + [2, 10], + [3, 4], + [3, 11], + [4, 5], + [4, 12], + [5, 6], + [5, 13], + [6, 7], + [6, 14], + [7, 15], + [8, 9], + [9, 10], + [10, 11], + [11, 12], + [12, 13], + [13, 14], + [14, 15], +] ############################################################### # Make a quantum program for the n-bit ripple adder. diff --git a/examples/python/stochastic_swap.py b/examples/python/stochastic_swap.py index 3e617c3c7bf8..c07cc0731a8b 100644 --- a/examples/python/stochastic_swap.py +++ b/examples/python/stochastic_swap.py @@ -18,8 +18,8 @@ from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit coupling = CouplingMap([[0, 1], [1, 2], [1, 3]]) -qr = QuantumRegister(4, 'q') -cr = ClassicalRegister(4, 'c') +qr = QuantumRegister(4, "q") +cr = ClassicalRegister(4, "c") circ = QuantumCircuit(qr, cr) circ.cx(qr[1], qr[2]) circ.cx(qr[0], qr[3]) diff --git a/examples/python/teleport.py b/examples/python/teleport.py index 6cd496aa8c19..507a142ae9df 100644 --- a/examples/python/teleport.py +++ b/examples/python/teleport.py @@ -64,18 +64,16 @@ ############################################################### # First version: not mapped -initial_layout = {q[0]: 0, - q[1]: 1, - q[2]: 2} -job = execute(qc, backend=backend, coupling_map=None, shots=1024, - initial_layout=initial_layout) +initial_layout = {q[0]: 0, q[1]: 1, q[2]: 2} +job = execute(qc, backend=backend, coupling_map=None, shots=1024, initial_layout=initial_layout) result = job.result() print(result.get_counts(qc)) # Second version: mapped to 2x8 array coupling graph -job = execute(qc, backend=backend, coupling_map=coupling_map, shots=1024, - initial_layout=initial_layout) +job = execute( + qc, backend=backend, coupling_map=coupling_map, shots=1024, initial_layout=initial_layout +) result = job.result() print(result.get_counts(qc)) # Both versions should give the same distribution diff --git a/examples/python/using_qiskit_terra_level_0.py b/examples/python/using_qiskit_terra_level_0.py index 3bae3601bc81..ad20728341a5 100644 --- a/examples/python/using_qiskit_terra_level_0.py +++ b/examples/python/using_qiskit_terra_level_0.py @@ -41,7 +41,7 @@ print(BasicAer.backends()) # running the job -job_sim = execute([qc1, qc2], BasicAer.get_backend('qasm_simulator')) +job_sim = execute([qc1, qc2], BasicAer.get_backend("qasm_simulator")) sim_result = job_sim.result() # Show the results diff --git a/qiskit/visualization/latex.py b/qiskit/visualization/latex.py index 78ef0f4a7d10..7ea9889b1ed1 100644 --- a/qiskit/visualization/latex.py +++ b/qiskit/visualization/latex.py @@ -166,7 +166,7 @@ def latex(self): \begin{document} """ - header_scale = "\\scalebox{{{}}}".format(self.scale) + "{" + header_scale = "\\scalebox{{{}}}".format(self.scale) + "{" qcircuit_line = r""" \Qcircuit @C=%.1fem @R=%.1fem @!R { \\ @@ -225,7 +225,7 @@ def _initialize_latex_array(self): self._latex[i][1] = "\\lstick{/_{_{" + str(clbitsize) + "}}} \\cw" offset += clbitsize - 1 else: - label = self.bit_locations[self.ordered_bits[i]]["register"].name + "_{" + label = self.bit_locations[self.ordered_bits[i]]["register"].name + "_{" label += str(self.bit_locations[self.ordered_bits[i]]["index"]) + "}:" if self.initial_state: label += "0" diff --git a/setup.py b/setup.py index 325f759b8e81..13477c3e55ef 100755 --- a/setup.py +++ b/setup.py @@ -16,66 +16,69 @@ import re import sys from setuptools import setup, find_packages, Extension + try: from Cython.Build import cythonize except ImportError: import subprocess - subprocess.call([sys.executable, '-m', 'pip', 'install', 'Cython>=0.27.1']) + + subprocess.call([sys.executable, "-m", "pip", "install", "Cython>=0.27.1"]) from Cython.Build import cythonize -with open('requirements.txt') as f: +with open("requirements.txt") as f: REQUIREMENTS = f.read().splitlines() # Add Cython extensions here CYTHON_EXTS = { - 'qiskit/transpiler/passes/routing/cython/stochastic_swap/utils': - 'qiskit.transpiler.passes.routing.cython.stochastic_swap.utils', - 'qiskit/transpiler/passes/routing/cython/stochastic_swap/swap_trial': - 'qiskit.transpiler.passes.routing.cython.stochastic_swap.swap_trial', - 'qiskit/quantum_info/states/cython/exp_value': - 'qiskit.quantum_info.states.cython.exp_value', + "qiskit/transpiler/passes/routing/cython/stochastic_swap/utils": "qiskit.transpiler.passes.routing.cython.stochastic_swap.utils", + "qiskit/transpiler/passes/routing/cython/stochastic_swap/swap_trial": "qiskit.transpiler.passes.routing.cython.stochastic_swap.swap_trial", + "qiskit/quantum_info/states/cython/exp_value": "qiskit.quantum_info.states.cython.exp_value", } INCLUDE_DIRS = [] # Extra link args LINK_FLAGS = [] # If on Win and not in MSYS2 (i.e. Visual studio compile) -if (sys.platform == 'win32' and os.environ.get('MSYSTEM') is None): - COMPILER_FLAGS = ['/O2'] +if sys.platform == "win32" and os.environ.get("MSYSTEM") is None: + COMPILER_FLAGS = ["/O2"] # Everything else else: - COMPILER_FLAGS = ['-O2', '-funroll-loops', '-std=c++11'] - if sys.platform == 'darwin': + COMPILER_FLAGS = ["-O2", "-funroll-loops", "-std=c++11"] + if sys.platform == "darwin": # These are needed for compiling on OSX 10.14+ - COMPILER_FLAGS.append('-mmacosx-version-min=10.9') - LINK_FLAGS.append('-mmacosx-version-min=10.9') + COMPILER_FLAGS.append("-mmacosx-version-min=10.9") + LINK_FLAGS.append("-mmacosx-version-min=10.9") EXT_MODULES = [] # Add Cython Extensions for src, module in CYTHON_EXTS.items(): - ext = Extension(module, - sources=[src + '.pyx'], - include_dirs=INCLUDE_DIRS, - extra_compile_args=COMPILER_FLAGS, - extra_link_args=LINK_FLAGS, - language='c++') + ext = Extension( + module, + sources=[src + ".pyx"], + include_dirs=INCLUDE_DIRS, + extra_compile_args=COMPILER_FLAGS, + extra_link_args=LINK_FLAGS, + language="c++", + ) EXT_MODULES.append(ext) # Read long description from README. -README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), - 'README.md') +README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), "README.md") with open(README_PATH) as readme_file: README = re.sub( - '.*', '', - readme_file.read(), flags=re.S | re.M) + ".*", + "", + readme_file.read(), + flags=re.S | re.M, + ) setup( name="qiskit-terra", version="0.18.0", description="Software for developing quantum computing programs", long_description=README, - long_description_content_type='text/markdown', + long_description_content_type="text/markdown", url="https://github.com/Qiskit/qiskit-terra", author="Qiskit Development Team", author_email="hello@qiskit.org", @@ -96,18 +99,24 @@ "Topic :: Scientific/Engineering", ], keywords="qiskit sdk quantum", - packages=find_packages(exclude=['test*']), + packages=find_packages(exclude=["test*"]), install_requires=REQUIREMENTS, - setup_requires=['Cython>=0.27.1'], + setup_requires=["Cython>=0.27.1"], include_package_data=True, python_requires=">=3.6", extras_require={ - 'visualization': ['matplotlib>=2.1', 'ipywidgets>=7.3.0', - 'pydot', "pillow>=4.2.1", "pylatexenc>=1.4", - "seaborn>=0.9.0", "pygments>=2.4"], - 'classical-function-compiler': ['tweedledum>=1.0,<2.0'], - 'full-featured-simulators': ['qiskit-aer>=0.1'], - 'crosstalk-pass': ['z3-solver>=4.7'], + "visualization": [ + "matplotlib>=2.1", + "ipywidgets>=7.3.0", + "pydot", + "pillow>=4.2.1", + "pylatexenc>=1.4", + "seaborn>=0.9.0", + "pygments>=2.4", + ], + "classical-function-compiler": ["tweedledum>=1.0,<2.0"], + "full-featured-simulators": ["qiskit-aer>=0.1"], + "crosstalk-pass": ["z3-solver>=4.7"], }, project_urls={ "Bug Tracker": "https://github.com/Qiskit/qiskit-terra/issues", @@ -115,5 +124,5 @@ "Source Code": "https://github.com/Qiskit/qiskit-terra", }, ext_modules=cythonize(EXT_MODULES), - zip_safe=False + zip_safe=False, ) From 8153c113457f6625f9837a32b87335473cc23082 Mon Sep 17 00:00:00 2001 From: JoshDumo Date: Fri, 25 Jun 2021 04:46:15 +0900 Subject: [PATCH 6/6] fixed deprecated gates in test_circuit_latex --- test/python/visualization/references/test_latex_iqx.tex | 4 ++-- .../visualization/references/test_latex_teleport.tex | 2 +- test/python/visualization/test_circuit_latex.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/python/visualization/references/test_latex_iqx.tex b/test/python/visualization/references/test_latex_iqx.tex index 9ff04ec203e6..deb5378a4524 100644 --- a/test/python/visualization/references/test_latex_iqx.tex +++ b/test/python/visualization/references/test_latex_iqx.tex @@ -10,8 +10,8 @@ \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{U}_1\,\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{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\\ + \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_teleport.tex b/test/python/visualization/references/test_latex_teleport.tex index 3fd829a44279..1a904dc38287 100644 --- a/test/python/visualization/references/test_latex_teleport.tex +++ b/test/python/visualization/references/test_latex_teleport.tex @@ -6,7 +6,7 @@ \begin{document} \scalebox{1.0}{ \Qcircuit @C=1.0em @R=0.2em @!R { \\ - \nghost{ {q}_{0} : } & \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\\ + \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\\ 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)