![Page 1: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/1.jpg)
Quantum Circuit Decomposition
from unitary matrices
into elementary gates
![Page 2: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/2.jpg)
Prologue
In classical logic synthesis, one may trivially decompose any boolean function into an OR of ANDs (sum of products)
Local optimizations may then be applied to shrink the resulting circuit
Can the same be done in the quantum case?
![Page 3: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/3.jpg)
Objectives
Introduce the “controlled-U” gate– Exhibit a decomposition of a controlled-U into CNOT
gates and 1-qubit rotation gates
Introduce the QR-decomposition Use QR to decompose a unitary matrix into
controlled-U gates– Conclude that any operator can be built of CNOT
gates and 1-qubit rotations
![Page 4: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/4.jpg)
References
The A. Barenko et. Al. paper, and how to write a controlled-U gate in elementary gates– U(2) and SU(2) matrices– Controlled-U gates
The Cybenko paper, and how to write an arbitrary unitary matrix in elementary gates– QR decomposition– Making it a circuit
![Page 5: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/5.jpg)
Objectives
Introduce the “controlled-U” gate– Exhibit a decomposition of a controlled-U into CNOT
gates and 1-qubit rotation gates
Introduce the QR-decomposition Use QR to decompose a unitary matrix into
controlled-U gates– Conclude that any operator can be built of CNOT
gates and 1-qubit rotations
![Page 6: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/6.jpg)
The “controlled-U”
The block-matrix form of a “controlled-U” gate
These can be decomposed into – CNOT gates– 1-qubit rotations
U
IN0
02
![Page 7: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/7.jpg)
Objectives
Introduce the “controlled-U” gate– Exhibit a decomposition of a controlled-U into CNOT
gates and 1-qubit rotation gates
Introduce the QR-decomposition Use QR to decompose a unitary matrix into
controlled-U gates– Conclude that any operator can be built of CNOT
gates and 1-qubit rotations
![Page 8: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/8.jpg)
One Qubit Rotations
Let U be a SU(2) matrix. U must take the form
Where
2/
2/
2/
2/
2/2/
2/)(2/
2221
1211
0
0
2/cos2/sin
2/sin2/cos
0
0
2/cos2/sin
2/sin2/cos
i
i
i
i
ii
ii
e
e
e
e
ee
ee
uu
uuU
21
11
2111
2111
arctan
argarg
argarg
q
q
![Page 9: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/9.jpg)
One Qubit Rotations
Define
So that
2/cos2/sin
2/sin2/cos)(
yR
2/
2/
0
0)(
i
i
ze
eR
01
10X
)()()( zyz RRRU
2/
2/
2/
2/
0
0
2/cos2/sin
2/sin2/cos
0
0
i
i
i
i
e
e
e
eU
![Page 10: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/10.jpg)
Some Quick Facts
R takes sums to products (R=Rz or Ry)
R(0)=I. So:
Finally,
XRXR )()(
)()()( RRR
)()( 1 RR
2/cos2/sin
2/sin2/cos)(
yR
2/
2/
0
0)(
i
i
ze
eR
01
10X
![Page 11: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/11.jpg)
Circuit Decompositions
The A. Barenko et. Al. paper, and how to write a controlled-U gate in elementary gates– U(2) and SU(2) matrices– Controlled-U gates
The Cybenko paper, and how to write an arbitrary unitary matrix in elementary gates– QR decomposition– Making it a circuit
![Page 12: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/12.jpg)
Controlled-U Gates
Consider the “controlled-U” gate
Claim: this circuit is equivalent
)(1010 bUaba U
2
22/
2/
z
zy
yz
RC
RRB
RRA
)()()( zyz RRRU
BA C
2/cos2/sin
2/sin2/cos)(
yR
2/
2/
0
0)(
i
i
ze
eR
01
10X
![Page 13: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/13.jpg)
Controlled-U Gates
Check this circuit on basis states
One observes
ABCaa 00
2222
zzyyz RRRRRABC
AXBXCbb 11
BA C
2
22/
2/
z
zy
yz
RC
RRB
RRA
![Page 14: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/14.jpg)
Controlled-U Gates
Check this circuit on basis states
One observes
ABCaa 00
22
zzz RRRABC
AXBXCbb 11
BA C
2
22/
2/
z
zy
yz
RC
RRB
RRA
![Page 15: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/15.jpg)
Controlled-U Gates
Check this circuit on basis states
One observes
ABCaa 00
)( zz RRABC
AXBXCbb 11
BA C
2
22/
2/
z
zy
yz
RC
RRB
RRA
![Page 16: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/16.jpg)
Controlled-U Gates
Check this circuit on basis states
One observes
ABCaa 00
IABC
AXBXCbb 11
BA C
2
22/
2/
z
zy
yz
RC
RRB
RRA
![Page 17: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/17.jpg)
Controlled-U Gates
Check this circuit on basis states
One observes
And similarly,
ABCaa 00
IABC
AXBXCbb 11
2222
zzyyz XRRXRRRAXBXC
BA C
2
22/
2/
z
zy
yz
RC
RRB
RRA
![Page 18: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/18.jpg)
Controlled-U Gates
Check this circuit on basis states
One observes
And similarly,
ABCaa 00
IABC
AXBXCbb 11
2222
zzyyz XRXRRRRAXBXC
BA C
2
22/
2/
z
zy
yz
RC
RRB
RRA
![Page 19: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/19.jpg)
Controlled-U Gates
Check this circuit on basis states
One observes
And similarly,
ABCaa 00
IABC
AXBXCbb 11
2222
zzyyz XXRRRRRAXBXC
BA C
2
22/
2/
z
zy
yz
RC
RRB
RRA
![Page 20: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/20.jpg)
Controlled-U Gates
Check this circuit on basis states
One observes
And similarly,
ABCaa 00
IABC
AXBXCbb 11
zyz RRRAXBXC
BA C
2
22/
2/
z
zy
yz
RC
RRB
RRA
![Page 21: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/21.jpg)
Controlled-U Gates
Check this circuit on basis states
One observes
And similarly,
ABCaa 00
IABC
AXBXCbb 11
UAXBXC
BA C
2
22/
2/
z
zy
yz
RC
RRB
RRA
![Page 22: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/22.jpg)
Controlled-U Gates
Check this circuit on basis states
By linearity, this circuit performs “controlled-U”
aa 00 )(11 bUb
BA C
2
22/
2/
z
zy
yz
RC
RRB
RRA
![Page 23: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/23.jpg)
Controlled-U Gates
If U’ is in U(2) (as opposed to SU(2)), – write U’=d U, where d2=det U’, U in SU(2)
Then
U’ U
D= =
dD
0
01
BA C
D
![Page 24: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/24.jpg)
Higher Order Controlled-U Gates
Recall (from two weeks ago)
– Where V is a square root of U.
This generalizes straight-forwardly to higher numbers of qubits
U
=
V V* V
![Page 25: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/25.jpg)
Objectives
Introduce the “controlled-U” gate– Exhibit a decomposition of a controlled-U into CNOT
gates and 1-qubit rotation gates
Introduce the QR-decomposition Use QR to decompose a unitary matrix into
controlled-U gates– Conclude that any operator can be built of CNOT
gates and 1-qubit rotations
![Page 26: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/26.jpg)
QR-Decomposition
Given a vector (a,b), this SU(2) matrix kills the second coordinate
0
1 22
22
bab
a
ab
ba
ba
![Page 27: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/27.jpg)
QR-Decomposition
The vector (a,b) might be sitting inside a matrix:
Think of this as a rotation of the plane in which the 3rd and 4th coordinates live
Note that this matrix is unitary
*'*'*'0
*'*'*'
****
****
***
***
****
****
//00
//00
0010
0001
C
b
a
CaCb
CbCa22
baC
0
1 22
22
bab
a
ab
ba
ba
![Page 28: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/28.jpg)
Making it a Circuit
The matrix used to kill coordinates in the bottom row looks like
This is a (higher order) controlled-U gate!
U
IN0
02
![Page 29: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/29.jpg)
QR-Decomposition
One may iterate this process
***0
****
****
****
****
****
****
****
0
1 22
22
bab
a
ab
ba
ba
![Page 30: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/30.jpg)
QR-Decomposition
One may iterate this process
***0
***0
****
****
***0
****
****
****
0
1 22
22
bab
a
ab
ba
ba
![Page 31: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/31.jpg)
QR-Decomposition
One may iterate this process
***0
***0
***0
****
***0
***0
****
****
0
1 22
22
bab
a
ab
ba
ba
![Page 32: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/32.jpg)
QR-Decomposition
One may iterate this process
**00
***0
***0
****
***0
***0
***0
****
0
1 22
22
bab
a
ab
ba
ba
![Page 33: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/33.jpg)
QR-Decomposition
One may iterate this process
**00
**00
***0
****
**00
***0
***0
****
0
1 22
22
bab
a
ab
ba
ba
![Page 34: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/34.jpg)
QR-Decomposition
One may iterate this process
*000
**00
***0
****
**00
**00
***0
****
0
1 22
22
bab
a
ab
ba
ba
![Page 35: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/35.jpg)
QR-Decomposition
This yields the formula
– Where X was the original matrix, the Ui are planar rotations, and R is upper triangular with nonnegative real entries on the diagonal
RXUU n ...1
0
1 22
22
bab
a
ab
ba
ba
![Page 36: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/36.jpg)
QR-Decomposition
Inverting the Q,
RXUU n ...1
RUUX n1
11...
![Page 37: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/37.jpg)
QR-Decomposition
If X is unitary, then R is the product of unitary matrices and hence unitary.
A triangular unitary matrix must be diagonal A diagonal unitary matrix with nonnegative real
entries must be the identity
RUUX n1
11...
RXUU n ...1
11
1... UUX n
![Page 38: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/38.jpg)
Objectives
Introduce the “controlled-U” gate– Exhibit a decomposition of a controlled-U into CNOT
gates and 1-qubit rotation gates
Introduce the QR-decomposition Use QR to decompose a unitary matrix into
controlled-U gates– Conclude that any operator can be built of CNOT
gates and 1-qubit rotations
![Page 39: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/39.jpg)
Making it a Circuit
The matrix used to kill coordinates in the bottom row looks like
This is a (higher order) controlled-U gate!
U
IN0
02
![Page 40: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/40.jpg)
Making it a Circuit
Need to make other planar rotations controlled-U gates
For some j, given an operator Pj
PjUPj-1 is a rotation in the j,j+1 plane. (where U is a
rotation in the n-2,n-1 plane)
11
2
Nj
Nj
![Page 41: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/41.jpg)
Making it a Circuit
Built the operator out of NOT and CNOT gates How to do it for the case of 4 qubits, j=5
11
2
Nj
Nj
![Page 42: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/42.jpg)
Making it a Circuit
Built the operator out of NOT and CNOT gates How to do it for the case of 4 qubits, j=5
11
2
Nj
Nj
1
0
0
0
1
0
0
1
1
0
1
1
1
1
1
1
1
1
1
1
![Page 43: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/43.jpg)
Making it a Circuit
Built the operator out of NOT and CNOT gates How to do it for the case of 4 qubits, j=5
11
2
Nj
Nj
0
1
1
0
0
1
1
1
0
1
1
1
0
1
1
1
1
0
1
1
![Page 44: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/44.jpg)
Making it a Circuit
The general case is not much harder– First, flip all bits that are 0 in both j,j+1– Then, CNOT every remaining bit that is zero in j+1,
controlling by the unique bit that is 1 in j+1 and 0 in j– Finally, switch this unique bit with the low bit
11
2
Nj
Nj
![Page 45: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/45.jpg)
Objectives
Introduce the “controlled-U” gate– Exhibit a decomposition of a controlled-U into CNOT
gates and 1-qubit rotation gates
Introduce the QR-decomposition Use QR to decompose a unitary matrix into
controlled-U gates– Conclude that any operator can be built of CNOT
gates and 1-qubit rotations
![Page 46: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/46.jpg)
Conclusion
A unitary matrix can be written as a product of planar rotations
A planar rotation can be written as ZUZ-1, where Z can be decomposed into CNOT and NOT gates, and U is a (higher order) controlled-U gate
A higher order controlled-U gate can be written as a sequence of CNOT gates and singly controlled-U gates
A controlled-U gate can be written as a sequence of CNOT gates and one-qubit rotations
![Page 47: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/47.jpg)
Epilogue
The number of gates in this decomposition is exponential in the number of qubits
For certain operators, much smaller circuits are known to exist
Can we automate the process of moving towards these?
![Page 48: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/48.jpg)
Reduction
Could try to shrink a long circuit by local optimization techniques
One experimentally observed obstacle: long chains of CNOT gates
These long chains of CNOTs result from certain identities
![Page 49: Quantum Circuit Decomposition from unitary matrices into elementary gates](https://reader035.vdocument.in/reader035/viewer/2022081421/5519b77955034660578b4843/html5/thumbnails/49.jpg)
Reduction
Could apply classical techniques…