Skip to content

Commit 500ff44

Browse files
dwierichscognigami
andauthored
[Demo] Add: Unitary synthesis with recursive KAK decompositions (#1372)
**Title:** Unitary synthesis with recursive KAK decompositions **Summary:** Unitary synthesis, the process of compiling a unitary matrix into a quantum circuit, has been a topic of study for over 25 years. Three interesting techniques for unitary synthesis, namely the first, the (probably) most widely known, and the minimal-CNOT-count ("the best"), all use the same recursive KAK decomposition under the hood, as we recently elaborated [in a paper](https://arxiv.org/abs/2503.19014). This demo builds on our demo on KAK decompositions (added in #1227) and explains how such decompositions can be applied recursively to construct a many-qubit circuit and how the three mentioned techniques all are powered by the same recursion. It defers some optimization details to the literature but provides a brief gate count overview and showcases a simplified numerical implementation of all three techniques. **Relevant references:** Quite a few, see metadata file. **Possible Drawbacks:** N/A **Related GitHub Issues:** [sc-87548] To do - [x] Redo circuit diagrams - [x] Add .tex files to repo - [x] add examples/code ---- If you are writing a demonstration, please answer these questions to facilitate the marketing process. * GOALS — Why are we working on this now? - Promote `qml.liealg` features - [promote a paper we recently did (see link above)] - Follow up on started line of demos (#1227, #1261) * AUDIENCE — Who is this for? - Researchers in quantum compilation and quantum information - Practicioners that want to learn where the complexity of their operations comes from * KEYWORDS — What words should be included in the marketing post? - (Recursive) KAK decomposition - Quantum Shannon decomposition - Block-ZXZ decomposition - Unitary synthesis - Compilation * Which of the following types of documentation is most similar to your file? (more details [here](https://www.notion.so/xanaduai/Different-kinds-of-documentation-69200645fe59442991c71f9e7d8a77f8)) - [ ] Tutorial - [x] Demo - [ ] How-to --------- Co-authored-by: cognigami <[email protected]>
1 parent eabf9ee commit 500ff44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1495
-0
lines changed
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
\documentclass[]{standalone}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor}
3+
4+
\begin{document}
5+
\begin{quantikz}
6+
& & \gate{R_Y}\wire[d][3]{q} & \\
7+
& \qwbundle{n-3} & |[operator]| & \\
8+
& & |[operator]| & \\
9+
& & |[operator]| &
10+
\end{quantikz}
11+
=
12+
\begin{quantikz}
13+
& & \gate{R_Y(\theta_0)} & \gate{R_Y(\theta_1)} & \gate{R_Y(\theta_2)} & \ \ldots \ & \gate{R_Y(\theta_{2^{n-1}-1})} & \\
14+
& \qwbundle{n-3} & \octrl{-1} & \octrl{-1} & \octrl{-1} & \ \ldots \ & \ctrl{-1} & \\
15+
& & \octrl{-1} & \octrl{-1} & \ctrl{-1} & \ \ldots \ & \ctrl{-1} & \\
16+
& & \octrl{-1} & \ctrl{-1} & \octrl{-1} & \ \ldots \ & \ctrl{-1} &
17+
\end{quantikz}
18+
\end{document}
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
\documentclass[]{standalone}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor}
3+
4+
\begin{document}
5+
\begin{quantikz}
6+
& & \gate[2]{U(2^n)} &\\
7+
& \qwbundle{n-1} & &
8+
\end{quantikz}
9+
=
10+
\begin{quantikz}
11+
& & |[operator]| & \gate{R_Y}\wire[d]{q} & |[operator]| &\\
12+
& \qwbundle{n-1} & \gate{U(2^{n-1})}\wire[u]{q} & |[operator]| & \gate{U(2^{n-1})}\wire[u]{q} &
13+
\end{quantikz}
14+
15+
\end{document}
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
\documentclass[]{standalone}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor}
3+
4+
\begin{document}
5+
\begin{quantikz}
6+
& \ghost{R_Z} & |[operator]| &\\
7+
& \qwbundle{n-1} & \gate{U(2^{n-1})}\wire[u]{q} &
8+
\end{quantikz}
9+
=
10+
\begin{quantikz}
11+
& & & \gate{R_Z}\wire[d]{q} & &\\
12+
& \qwbundle{n-1} & \gate{U(2^{n-1})} & |[operator]| & \gate{U(2^{n-1})} &
13+
\end{quantikz}
14+
15+
\end{document}
Binary file not shown.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
\documentclass[]{standalone}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor}
3+
4+
\begin{document}
5+
\begin{quantikz}
6+
& \gate[2]{G} & \\
7+
&&
8+
\end{quantikz}
9+
=
10+
\begin{quantikz}
11+
& \gate[2]{K_2} & \gate[2]{A} & \gate[2]{K_1} & \\
12+
&&&&
13+
\end{quantikz}
14+
% Iterate the above:
15+
16+
% \begin{align*}
17+
% \begin{quantikz}
18+
% & \ctrl[open]{1} & \ctrl[open]{1} & \ctrl{1} & \ctrl{1} & \\
19+
% & \ctrl[open]{1} & \ctrl{1} & \ctrl[open]{1} & \ctrl{1} & \\
20+
% & \gate{A} & \gate{B} & \gate{C} & \gate{D} &
21+
% \end{quantikz}
22+
% &=
23+
% \begin{quantikz}
24+
% & \ctrl[open]{1} & \ctrl{1} & \\
25+
% & \gate[2]{A\oplus B} & \gate[2]{C\oplus D} & \\
26+
% & & &
27+
% \end{quantikz}\\
28+
% &=
29+
% \begin{quantikz}
30+
% & & \ctrl{1} & \\
31+
% & \gate[2]{A\oplus B} & \gate[2]{A^\dagger C\oplus B^\dagger D} & \\
32+
% & & &
33+
% \end{quantikz}\\
34+
% &=
35+
% \begin{quantikz}
36+
% & & & \ctrl{1} & \ctrl{1} & \\
37+
% & \ctrl[open]{1} & \ctrl{1} & \ctrl[open]{1} & \ctrl{1} & \\
38+
% & \gate{A} & \gate{B} & \gate{A^\dagger C} & \gate{B^\dagger D} &
39+
% \end{quantikz}\\
40+
% &=
41+
% \begin{quantikz}
42+
% & & & \ctrl{2} & \ctrl{1} & \\
43+
% & & \ctrl{1} & & \ctrl{1} & \\
44+
% & \gate{A} & \gate{A^\dagger B} & \gate{A^\dagger C} & \gate{C^\dagger A B^\dagger D} &
45+
% \end{quantikz}
46+
% \end{align*}
47+
\end{document}
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
\documentclass[]{standalone}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor}
3+
4+
5+
\begin{document}
6+
% \begin{align*}
7+
\begin{quantikz}
8+
& & \gate[3]{U(2^n)} &
9+
\midstick[3,brackets=none]{=}
10+
& & & &[-0.5cm] \gate{R_Z}\wire[d][2]{q} &[-0.5cm] & & &[-0.5cm] \gate{R_X}\wire[d][2]{q} &[-0.5cm] & & &[-0.5cm] \gate{R_Z}\wire[d][2]{q} &[-0.5cm] & & \\
11+
& \qwbundle{n-3} & &
12+
& \qwbundle{n-3} & \gate[2]{U(2^{n-1})} & \gate{H} & |[operator]| & \gate{H} & \gate[2]{U(2^{n-1})} & \gate{H} & |[operator]| & \gate{H} & \gate[2]{U(2^{n-1})} & \gate{H} & |[operator]| & \gate{H} & \gate[2]{U(2^{n-1})} & \\
13+
& \qwbundle{2} & &
14+
& \qwbundle{2} & & \gate{E^\dagger} & |[operator]| & \gate{E} & & \gate{E^\dagger} & |[operator]| & \gate{E} & & \gate{E^\dagger} & |[operator]| & \gate{E} & &
15+
\end{quantikz}
16+
17+
\end{document}
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
\documentclass[]{standalone}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor}
3+
4+
\begin{document}
5+
\begin{quantikz}
6+
& & \gate[2]{U(2^n)} &\\
7+
& \qwbundle{n-1} & &
8+
\end{quantikz}
9+
=
10+
\begin{quantikz}
11+
& & & \gate{R_Z}\wire[d]{q} & & \gate{R_Y}\wire[d]{q} & & \gate{R_Z}\wire[d]{q} & &\\
12+
& \qwbundle{n-1} & \gate{U(2^{n-1})} & |[operator]| & \gate{U(2^{n-1})} & |[operator]| & \gate{U(2^{n-1})} & |[operator]| & \gate{U(2^{n-1})} &
13+
\end{quantikz}
14+
15+
\end{document}
Binary file not shown.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
\documentclass[preview]{standalone}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor,amssymb,amsfonts}
3+
4+
\definecolor{yellow}{HTML}{E2A300}
5+
\definecolor{blue}{HTML}{4D53C8}
6+
\definecolor{green}{HTML}{52BD7C}
7+
\definecolor{red}{HTML}{D7333B}
8+
9+
\begin{document}
10+
\begin{align*}
11+
\begin{quantikz}
12+
\ \ldots \ & &
13+
\gate[style={dashed}]{\phantom{U}}\wire[d][2]{q} & &
14+
\gate[style={dashed}]{\phantom{U}}\wire[d][2]{q} & & \\
15+
\ \ldots \ & \gate[2]{SU(4)} &
16+
|[operator]| & \gate[2]{SU(4)} &
17+
|[operator]| & \gate[2]{SU(4)} & \\
18+
\ \ldots \ & &
19+
|[operator]| & &
20+
|[operator]| & &
21+
\end{quantikz}
22+
&=
23+
\begin{quantikz}
24+
\ \ldots \ & &
25+
\gate[style={dashed}]{\phantom{U}}\wire[d][2]{q} & &
26+
\gate[style={dashed}]{\phantom{U}}\wire[d][2]{q} &[-0.9cm] & [0.2cm] & & & & & & \\
27+
\ \ldots \ & \gate[2]{SU(4)} &
28+
|[operator]| & \gate[2]{SU(4)} &
29+
|[operator]| & \gategroup[2,steps=2,style={inner sep=0pt, rounded corners, color=red}]{} & \gate[2]{\Delta} & \gate[style={dotted}]{\phantom{U}} & \ctrl{1} & \gate{R_Y} & \ctrl{1} & \gate[style={dotted}]{\phantom{U}} & \\
30+
\ \ldots \ & &
31+
|[operator]| & &
32+
|[operator]| & & & \gate[style={dotted}]{\phantom{U}} & \targ{} & \gate{R_Y} & \targ{} & \gate[style={dotted}]{\phantom{U}} &
33+
\end{quantikz}\\
34+
&=
35+
\begin{quantikz}
36+
\ \ldots \ & &
37+
\gate[style={dashed}]{\phantom{U}}\wire[d][2]{q} & & &
38+
\gate[style={dashed}]{\phantom{U}}\wire[d][2]{q} & & & & & & \\
39+
\ \ldots \ & \gate[2]{SU(4)} &
40+
|[operator]| & \gate[2]{SU(4)}\gategroup[2,steps=2,style={inner sep=0pt, rounded corners, color=blue}]{} &
41+
\gate[2]{\Delta} & |[operator]| & \gate[style={dotted}]{\phantom{U}} & \ctrl{1} & \gate{R_Y} & \ctrl{1} & \gate[style={dotted}]{\phantom{U}} & \\
42+
\ \ldots \ & &
43+
|[operator]| & &
44+
& |[operator]| & \gate[style={dotted}]{\phantom{U}} & \targ{} & \gate{R_Y} & \targ{} & \gate[style={dotted}]{\phantom{U}} &
45+
\end{quantikz}\\
46+
&=
47+
\begin{quantikz}
48+
\ \ldots \ & &
49+
\gate[style={dashed}]{\phantom{U}}\wire[d][2]{q} &[-0.9cm] & [0.2cm] & & & & & &
50+
\gate[style={dashed}]{\phantom{U}}\wire[d][2]{q} & & & & & & \\
51+
\ \ldots \ & \gate[2]{SU(4)} &
52+
|[operator]| &\gategroup[2,steps=2,style={inner sep=0pt, rounded corners, color=red}]{} & \gate[2]{\Delta} & \gate[style={dotted}]{\phantom{U}} & \ctrl{1} & \gate{R_Y} & \ctrl{1} & \gate[style={dotted}]{\phantom{U}} & |[operator]| & \gate[style={dotted}]{\phantom{U}} & \ctrl{1} & \gate{R_Y} & \ctrl{1} & \gate[style={dotted}]{\phantom{U}} & \\
53+
\ \ldots \ & &
54+
|[operator]| & & & \gate[style={dotted}]{\phantom{U}} & \targ{} & \gate{R_Y} & \targ{} & \gate[style={dotted}]{\phantom{U}}
55+
& |[operator]| & \gate[style={dotted}]{\phantom{U}} & \targ{} & \gate{R_Y} & \targ{} & \gate[style={dotted}]{\phantom{U}} &
56+
\end{quantikz}\\
57+
% &=
58+
% \begin{quantikz}
59+
% & & & \gate{R_Z}\wire[d][2]{q} & & \gate{R_X}\wire[d][2]{q} & & \gate{R_Z}\wire[d][2]{q} & &\\
60+
% & & \gate[2]{U(2^{n-1})} & |[operator]| & \gate[2]{U(2^{n-1})} & |[operator]| & \gate[2]{U(2^{n-1})} & |[operator]| & \gate[2]{U(2^{n-1})} & \\
61+
% & \qwbundle{n-2} & & |[operator]| & & |[operator]| & & |[operator]| & &
62+
% \end{quantikz}\\
63+
% &=\begin{quantikz}
64+
% & & & \gate{R_Z}\wire[d][2]{q} & \gate{H} & \gategroup[3,steps=3,style={inner
65+
% sep=3pt, rounded corners,color=green}]{} & \gate{R_Z}\wire[d][2]{q} & & \gate{H} & \gate{R_Z}\wire[d][2]{q} & &\\
66+
% & & \gate[2]{U(2^{n-1})} & |[operator]| & & \gate[2]{U(2^{n-1})} & |[operator]| & \gate[2]{U(2^{n-1})} & & |[operator]| & \gate[2]{U(2^{n-1})} & \\
67+
% & \qwbundle{n-2} & & |[operator]| & & & |[operator]| & & & |[operator]| & &
68+
% \end{quantikz}\\
69+
% &=\begin{quantikz}
70+
% & & & \gate{R_Z}\wire[d][2]{q} & \targ{}\gategroup[2,steps=3,style={inner
71+
% sep=0pt, rounded corners,color=yellow}]{} & \gate{H} & \ctrl{0}\gategroup[3,steps=3,style={inner
72+
% sep=3pt, rounded corners,color=blue}]{} & |[operator]| & \ctrl{0}\gategroup[2,steps=3,style={inner
73+
% sep=0pt, rounded corners,color=yellow}]{} & \gate{H} & \targ{} & \gate{R_Z}\wire[d][2]{q} & &\\
74+
% & & \gate[2]{U(2^{n-1})} & |[operator]| & \ctrl{-1} & &\ctrl{-1} & \gate[2]{U(2^{n-1})}\wire[u]{q} & \ctrl{-1} & & \ctrl{-1}& |[operator]| & \gate[2]{U(2^{n-1})} & \\
75+
% & \qwbundle{n-2} & & |[operator]| & & & & & & & & |[operator]| & &
76+
% \end{quantikz}\\
77+
% &=\begin{quantikz}
78+
% & & & \gate{R_Z}\wire[d][2]{q}\gategroup[3,steps=2,style={inner
79+
% sep=0pt, rounded corners,color=red}]{} & \targ{} & & \gate{R_X}\wire[d][2]{q} & & \targ{}\gategroup[3,steps=2,style={inner
80+
% sep=0pt, rounded corners,color=red}]{} & \gate{R_Z}\wire[d][2]{q} & &\\
81+
% & & \gate[2]{U(2^{n-1})} & |[operator]| & \ctrl{-1} & \gate[2]{U(2^{n-1})} & |[operator]| & \gate[2]{U(2^{n-1})} & \ctrl{-1} & |[operator]| & \gate[2]{U(2^{n-1})} & \\
82+
% & \qwbundle{n-2} & & |[operator]| & & & |[operator]| & & & |[operator]| & &
83+
% \end{quantikz}
84+
\end{align*}
85+
\end{document}
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
\documentclass[]{standalone}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor}
3+
4+
5+
\begin{document}
6+
% \begin{align*}
7+
\begin{quantikz}
8+
& & \gate[2]{U(2^n)} &\\
9+
& \qwbundle{n-1} & &
10+
\end{quantikz}
11+
=
12+
\begin{quantikz}
13+
& & & \gate{R_Z}\wire[d]{q} & & \gate{R_X}\wire[d]{q} & & \gate{R_Z}\wire[d]{q} & &\\
14+
& \qwbundle{n-1} & \gate{U(2^{n-1})} & |[operator]| & \gate{U(2^{n-1})} & |[operator]| & \gate{U(2^{n-1})} & |[operator]| & \gate{U(2^{n-1})} &
15+
\end{quantikz}
16+
17+
\end{document}
Binary file not shown.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
\documentclass[]{article}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor,amssymb,amsfonts}
3+
4+
\definecolor{yellow}{HTML}{E2A300}
5+
\definecolor{blue}{HTML}{4D53C8}
6+
\definecolor{green}{HTML}{52BD7C}
7+
\definecolor{red}{HTML}{D7333B}
8+
9+
\begin{document}
10+
\begin{align*}
11+
\hspace{-5cm}\begin{quantikz}
12+
& & \gate[3]{U(2^n)} &\\
13+
& & &\\
14+
& \qwbundle{n-2} & &
15+
\end{quantikz}
16+
&=
17+
\begin{quantikz}
18+
& & & \gate{R_Z}\wire[d][2]{q} & & \gate{R_X}\wire[d][2]{q} & & \gate{R_Z}\wire[d][2]{q} & &\\
19+
& & \gate[2]{U(2^{n-1})} & |[operator]| & \gate[2]{U(2^{n-1})} & |[operator]| & \gate[2]{U(2^{n-1})} & |[operator]| & \gate[2]{U(2^{n-1})} & \\
20+
& \qwbundle{n-2} & & |[operator]| & & |[operator]| & & |[operator]| & &
21+
\end{quantikz}\\
22+
&=\begin{quantikz}
23+
& & & \gate{R_Z}\wire[d][2]{q} & \gate{H} & \gategroup[3,steps=3,style={inner
24+
sep=3pt, rounded corners,color=green}]{} & \gate{R_Z}\wire[d][2]{q} & & \gate{H} & \gate{R_Z}\wire[d][2]{q} & &\\
25+
& & \gate[2]{U(2^{n-1})} & |[operator]| & & \gate[2]{U(2^{n-1})} & |[operator]| & \gate[2]{U(2^{n-1})} & & |[operator]| & \gate[2]{U(2^{n-1})} & \\
26+
& \qwbundle{n-2} & & |[operator]| & & & |[operator]| & & & |[operator]| & &
27+
\end{quantikz}\\
28+
&=\begin{quantikz}
29+
& & & \gate{R_Z}\wire[d][2]{q} & \targ{}\gategroup[2,steps=3,style={inner
30+
sep=0pt, rounded corners,color=yellow}]{} & \gate{H} & \ctrl{0}\gategroup[3,steps=3,style={inner
31+
sep=3pt, rounded corners,color=blue}]{} & |[operator]| & \ctrl{0}\gategroup[2,steps=3,style={inner
32+
sep=0pt, rounded corners,color=yellow}]{} & \gate{H} & \targ{} & \gate{R_Z}\wire[d][2]{q} & &\\
33+
& & \gate[2]{U(2^{n-1})} & |[operator]| & \ctrl{-1} & &\ctrl{-1} & \gate[2]{U(2^{n-1})}\wire[u]{q} & \ctrl{-1} & & \ctrl{-1}& |[operator]| & \gate[2]{U(2^{n-1})} & \\
34+
& \qwbundle{n-2} & & |[operator]| & & & & & & & & |[operator]| & &
35+
\end{quantikz}\\
36+
&=\begin{quantikz}
37+
& & & \gate{R_Z}\wire[d][2]{q}\gategroup[3,steps=2,style={inner
38+
sep=0pt, rounded corners,color=red}]{} & \targ{} & & \gate{R_X}\wire[d][2]{q} & & \targ{}\gategroup[3,steps=2,style={inner
39+
sep=0pt, rounded corners,color=red}]{} & \gate{R_Z}\wire[d][2]{q} & &\\
40+
& & \gate[2]{U(2^{n-1})} & |[operator]| & \ctrl{-1} & \gate[2]{U(2^{n-1})} & |[operator]| & \gate[2]{U(2^{n-1})} & \ctrl{-1} & |[operator]| & \gate[2]{U(2^{n-1})} & \\
41+
& \qwbundle{n-2} & & |[operator]| & & & |[operator]| & & & |[operator]| & &
42+
\end{quantikz}
43+
\end{align*}
44+
\end{document}
Binary file not shown.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
\documentclass[]{article}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor,amssymb,amsfonts}
3+
4+
\begin{document}
5+
\begin{align*}
6+
\begin{quantikz}
7+
& & \gate[2]{U(2^n)} &\\
8+
& \qwbundle{n-1} & &
9+
\end{quantikz}
10+
&=
11+
\begin{quantikz}
12+
& & |[operator]| & \gate{R_X(\vec{\theta})}\wire[d]{q} & |[operator]| &\\
13+
& \qwbundle{n-1} & \gate{W_0,W_1}\wire[u]{q} & |[operator]| & \gate{V_0,V_1}\wire[u]{q} &
14+
\end{quantikz}\\
15+
&=
16+
\begin{quantikz}
17+
& & |[operator]| & \gate{H} & \gate{R_Z(\vec{\theta})}\wire[d]{q} & \gate{H} & |[operator]| &\\
18+
& \qwbundle{n-1} & \gate{W_0,W_1}\wire[u]{q} & & |[operator]| & & \gate{V_0,V_1}\wire[u]{q} &
19+
\end{quantikz}\\
20+
&=
21+
\begin{quantikz}
22+
& & |[operator]| & \gate{H} & & \gate{R_Z(\vec{\theta})}\wire[d]{q} & \gate{H} & |[operator]| &\\
23+
& \qwbundle{n-1} & \gate{W_0,W_1}\wire[u]{q} & \gate{W_0^\dagger} & \gate{W_0} & |[operator]| & & \gate{V_0,V_1}\wire[u]{q} &
24+
\end{quantikz}\\
25+
&=
26+
\begin{quantikz}
27+
& & |[operator]| & \gate{H} & \gate{R_Z(\vec{\theta})}\wire[d]{q} & & \gate{H} & |[operator]| &\\
28+
& \qwbundle{n-1} & \gate{\mathbb{I},W_0^\dagger W_1}\wire[u]{q} & \gate{W_0} & |[operator]| & \gate{\Delta(-\vec{\theta})} & \gate{\Delta(\vec{\theta})} & \gate{V_0,V_1}\wire[u]{q} &
29+
\end{quantikz}\\
30+
&=
31+
\begin{quantikz}
32+
& & \ctrl{1} & \gate{H} & \ctrl{1} & & & \gate{H} & |[operator]| &\\
33+
& \qwbundle{n-1} & \gate{W_0^\dagger W_1}\wire[u]{q} & \gate{W_0} & \gate{\Delta(-2\vec{\theta})} & \gate{W_0^\dagger} & \gate{W_0} & \gate{\Delta(\vec{\theta})} & \gate{V_0,V_1}\wire[u]{q} &
34+
\end{quantikz}\\
35+
&=
36+
\begin{quantikz}
37+
& & \ctrl{1} & \gate{H} & \ctrl{1} & \gate{H} & |[operator]| &\\
38+
& \qwbundle{n-1} & \gate{W_0^\dagger W_1}\wire[u]{q} & & \gate{W_0^\dagger \Delta(-2\vec{\theta}) W_0} & & \gate{V_0 \Delta(\vec{\theta})W_0,V_1\Delta(\vec{\theta})W_0}\wire[u]{q} &
39+
\end{quantikz}
40+
\end{align*}
41+
42+
\end{document}
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
\documentclass[]{standalone}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor}
3+
4+
\begin{document}
5+
\begin{quantikz}
6+
& \gate[2]{E} & \midstick[2,brackets=none]{=}
7+
& \gate{R_Z(\tfrac{\pi}{2})} & \targ{} & & \\
8+
& &
9+
& \gate{R_X(-\tfrac{\pi}{2})} & \ctrl{-1} & \gate{R_Z(-\tfrac{\pi}{2})} &
10+
\end{quantikz}
11+
12+
\end{document}
Binary file not shown.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
\documentclass[]{standalone}
2+
\usepackage{amsmath,quantikz,graphicx,xcolor}
3+
4+
\begin{document}
5+
% \begin{quantikz} % Intermediate decompositions
6+
% & |[operator]| & \midstick[3,brackets=none]{=} & & \ctrl{2} & & \ctrl{2} & \\
7+
% & |[operator]| & & |[operator]| & & |[operator]| & & \\
8+
% & \gate{R_P}\wire[u][2]{q} & & \gate{R_P}\wire[u][1]{q} & \targ{} & \gate{R_P}\wire[u][1]{q} & \targ{} &
9+
% \end{quantikz}
10+
11+
% \begin{quantikz}
12+
% & |[operator]| & \midstick[3,brackets=none]{=}
13+
% & & \ctrl{2} & & \ctrl{2} & \midstick[3,brackets=none]{=}
14+
% & & & & \ctrl{2} & & & & \ctrl{2} & \\
15+
% & |[operator]| &
16+
% & |[operator]| & & |[operator]| & &
17+
% & & \ctrl{1} & & & & \ctrl{1} & & & \\
18+
% & \gate{R_P}\wire[u][2]{q} &
19+
% & \gate{R_P}\wire[u][1]{q} & \targ{} & \gate{R_P}\wire[u][1]{q} & \targ{} &
20+
% & \gate{R_P} & \targ{} & \gate{R_P} & \targ{} & \gate{R_P} & \targ{} & \gate{R_P} & \targ{} &
21+
% \end{quantikz}
22+
23+
\begin{quantikz}
24+
& |[operator]| & \midstick[3,brackets=none]{=}
25+
& & & & \ctrl{2} & & & & \ctrl{2} & \\
26+
& |[operator]| &
27+
& & \ctrl{1} & & & & \ctrl{1} & & & \\
28+
& \gate{R_P}\wire[u][2]{q} &
29+
& \gate{R_P} & \targ{} & \gate{R_P} & \targ{} & \gate{R_P} & \targ{} & \gate{R_P} & \targ{} &
30+
\end{quantikz}
31+
32+
\end{document}
Binary file not shown.

0 commit comments

Comments
 (0)