-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlecture7.tex
564 lines (443 loc) · 16.5 KB
/
lecture7.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
\section{Lecture 7: More Multi-Qubit Gates, Reversibility Property,
No-Cloning Theorem}\label{sec:lecture7}
\subsection*{Review Questions}
\qs{Number of Measurement Bases}{
How many different bases can we measure a $n$-qubit system in?
}
\sol{\boxed{\textbf{Infinite}}
\[
P(b) = \norm{\langle b | \psi \rangle}^2
\]
In quantum mechanics, a measurement basis for an $n$-qubit system is a set of
orthonormal basis states in a $2^n$-dimensional Hilbert space. The most
common measurement basis is the \textbf{computational basis}, given by
$\{|0\rangle, |1\rangle\}^{\otimes n}$. However, we can measure in
\textbf{any} orthonormal basis.
The space of all possible measurement bases corresponds to the space of all
possible orthonormal bases, which is parameterized by the unitary group
$U(2^n)$. The set of all $2^n$-dimensional orthonormal bases is described
by the unitary group $U(2^n)$, modulo the global phase $U(1)$. Since this
space is continuous and has infinitely many parameters, there exist an
\textbf{infinite} number of measurement bases.
}
\qs{Output of Quantum Circuit}{
What is the output quantum state of the following quantum circuit:
\[
\begin{quantikz}
q_2 \quad \lstick{$\zero$} & \gate{X} & \gate{X} & \meter{} \\
q_1 \quad \lstick{$\zero$} & \gate{S} & \gate{X} & \meter{} \\
q_0 \quad \lstick{$\zero$} & \gate{X} & & \meter{} \\
\end{quantikz}
\]
}
\sol{
\boxed{011}
\begin{itemize}
\item For $q_2$, the two $X$ gates essentially cancel each other out as
the gate is Hermitian ($XX = I$).
\item For $q_1$, the $S$ gate does not affect the starting state $\zero$,
and then the $X$ gate flips the signal to $\one$.
\item For $q_0$, the $X$ gate simply flips the signal from $\zero$ to
$\one$.
\end{itemize}
Remembering that we read the diagram top-down as the most significant bit
to the least significant bit, respectively, the output is 001.
}
\subsection*{More Multi-Qubit Gates}
\subsubsection*{$CX(q_0 \rightarrow q_1)$ Gate}
\index{quantum gates!multi-qubit gates!CNOT with swapped target and control}
\dfn{$CX(q_0 \rightarrow q_1)$ Gate}{
The control and target qubits of a CNOT gate can be swapped using Hadamard
gates:
\[
(H \otimes H) \cdot CNOT_{\text{control,target}} \cdot (H \otimes H) =
CNOT_{\text{target,control}}
\]
This transformation can be visualized in a circuit diagram:
\begin{align*}
\begin{quantikz}
\lstick{$\ket{c}$} & \gate{H} & \ctrl{1} & \gate{H} & \qw \\
\lstick{$\ket{t}$} & \gate{H} & \gate{X} & \gate{H} & \qw \\
\end{quantikz}
\end{align*}
The $CX(q_0 \rightarrow q_1)$ gate, also known as $CNOT_{target,control}$,
is a variant of the CNOT gate where the control and target qubits are
swapped. Its matrix representation is:
\[
CNOT_{target,control} = \begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0
\end{pmatrix}
\]
This gate flips the target qubit ($q_1$) if the control qubit ($q_0$) is in
state $\ket{1}$.
}
\subsubsection*{Derivation of the $CX(q_0 \rightarrow q_1)$ Gate}
The control and target qubits of a CNOT gate can be swapped using Hadamard
($H$) gates applied to both qubits. Mathematically, this operation is
represented as:
\[
(H \otimes H) \cdot \text{CNOT}_{\text{control,target}} \cdot (H \otimes H)
= \text{CNOT}_{\text{target,control}}
\]
The transformed CNOT gate is:
\[
(H \otimes H) \cdot \text{CNOT} \cdot (H \otimes H).
\]
\vspace{0.3cm}
\textbf{Step 1: Compute $\text{CNOT} \cdot (H \otimes H)$}
First, multiply the CNOT matrix with $H \otimes H$:
\[
\text{CNOT} \cdot (H \otimes H) = \begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{pmatrix} \cdot \frac{1}{2} \begin{pmatrix}
1 & 1 & 1 & 1 \\
1 & -1 & 1 & -1 \\
1 & 1 & -1 & -1 \\
1 & -1 & -1 & 1
\end{pmatrix}
\]
This results in:
\[
\text{CNOT} \cdot (H \otimes H) = \frac{1}{2} \begin{pmatrix}
1 & 1 & 1 & 1 \\
1 & -1 & 1 & -1 \\
1 & -1 & -1 & 1 \\
1 & 1 & -1 & -1
\end{pmatrix}
\]
Notice that the third and fourth rows of the matrix switch places due to the
CNOT gate's effect.
\vspace{0.3cm}
\textbf{Step 2: Multiply $(H \otimes H)$ to the Above Result}
Now, multiply $H \otimes H$ from the left:
\[
(H \otimes H) \cdot \frac{1}{2} \begin{pmatrix}
1 & 1 & 1 & 1 \\
1 & -1 & 1 & -1 \\
1 & -1 & -1 & 1 \\
1 & 1 & -1 & -1
\end{pmatrix}
\]
Expanding this:
\[
\frac{1}{2} \begin{pmatrix}
1 & 1 & 1 & 1 \\
1 & -1 & 1 & -1 \\
1 & 1 & -1 & -1 \\
1 & -1 & -1 & 1
\end{pmatrix} \cdot \frac{1}{2} \begin{pmatrix}
1 & 1 & 1 & 1 \\
1 & -1 & 1 & -1 \\
1 & -1 & -1 & 1 \\
1 & 1 & -1 & -1
\end{pmatrix}
\]
After computation, the resulting matrix is:
\[
\text{CNOT}_{\text{target,control}} = \begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0
\end{pmatrix}
\]
This matrix corresponds to the CNOT gate with the control and target qubits
swapped.
\vspace{0.3cm}
\index{quantum gates!multi-qubit gates!SWAP gate}
\subsubsection*{SWAP Gate}
\dfn{SWAP Gate}{
The SWAP gate exchanges the states of two qubits. Its matrix representation
is:
\[
SWAP = \begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1
\end{pmatrix}
\]
The action of SWAP on basis states is given by:
\[
SWAP\ket{ab} = \ket{ba}, \quad a,b \in \{0,1\}
\]
}
\paragraph{Effects of SWAP Gate}\label{par:Effects of SWAP Gate}
The SWAP gate interchanges the states of two qubits. For any 2-qubit
computational basis state, its action is:
\nt{
\[
\text{SWAP} \ket{00} = \ket{00}, \quad
\text{SWAP} \ket{01} = \ket{10}, \quad
\text{SWAP} \ket{10} = \ket{01}, \quad
\text{SWAP} \ket{11} = \ket{11}
\]
}
Thus, for any superposition of 2-qubit states, the SWAP gate exchanges the
amplitudes corresponding to each qubit's position.
\index{Circuit notation!multi-qubit gates}
\subsubsection*{Circuit Representations}
The standard circuit representations for these 2-qubit gates are:
\begin{align*}
\begin{quantikz}
% Flipped CNOT
\lstick{$CNOT_{\text{target, control}}$:} & \gate{X} & \qw \\
& \ctrl{-1} & \qw \\[0.5cm]
% SWAP
\lstick{SWAP:} & \swap{1} & \qw \\
& \swap{0} & \qw \\[0.5cm]
\end{quantikz}
\end{align*}
\index{quantum gates!$n$-qubit gates}
\subsection*{$n$-Qubit Gates}
Before we just looked at the 2-qubit version of the Controlled X gate, but
it extends to $n$-qubits.
\index{quantum gates!multi-qubit gates!Toffoli gate}
\subsubsection*{Toffoli Gate}
\dfn{Toffoli Gate}{(CCX) is a three-qubit gate with two control qubits and
one target qubit. Its matrix representation is:
\[
\textsc{Toffoli} = \begin{pmatrix}
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0
\end{pmatrix}
\]
The Toffoli gate is Hermitian and only flips the target qubit if both control
qubits are in state $\ket{1}$.
}
\index{Circuit notation!multi-qubit gates}
\subsubsection*{Circuit Representation}
The standard circuit representation for the Toffoli/ $CCX$ gate is as follows:
\begin{align*}
\begin{quantikz}
% Toffoli
\lstick{CCX:} & \ctrl{1} & \qw \\
& \ctrl{1} & \qw \\
& \gate{X} & \qw
\end{quantikz}
\end{align*}
\paragraph{Effects of Toffoli Gate}\label{par:Effects of Toffoli Gate}
The Toffoli (CCX) gate acts on a 3-qubit system, where the first two qubits
serve as control qubits and the third is the target. Its effect on the
computational basis states is:
\nt{
\[
\begin{aligned}
\text{Toffoli}\,\ket{000} &= \ket{000} \quad & \text{Toffoli}\,\ket{100} &= \ket{100} \\
\text{Toffoli}\,\ket{001} &= \ket{001} \quad & \text{Toffoli}\,\ket{101} &= \ket{101} \\
\text{Toffoli}\,\ket{010} &= \ket{010} \quad & \text{Toffoli}\,\ket{110} &= \ket{111} \\
\text{Toffoli}\,\ket{011} &= \ket{011} \quad & \text{Toffoli}\,\ket{111} &= \ket{110}
\end{aligned}
\]
}
In essence, the target qubit is flipped only when both control qubits are in
the \(\ket{1}\) state; otherwise, the state remains unchanged.
As you would expect, multi-controlled $X$ gates are Hermitian.
\ex{Quantum Circuit Showing Hermitian Property}{
A quantum circuit composed of Hermitian gates (e.g., $X$, $Z$, $H$) will
cancel out when the circuit is reversed, resulting in the identity operation.
\begin{center}
\begin{quantikz}
\lstick{\ket{\psi}} & \gate{H} & \gate{Z} & \gate{X} & \gate{X} &
\gate{Z} & \gate{H} & \qw & \rstick{\ket{\psi}}
\end{quantikz}
\end{center}
In this example, the quantum circuit consists of a sequence of Hermitian
gates: the Hadamard ($H$), Pauli-Z ($Z$), and Pauli-X ($X$) gates. These
gates satisfy the property:
\[
H = H^\dagger, \quad X = X^\dagger, \quad Z = Z^\dagger
\]
Since these gates are their own inverses (\textit{i.e.,} $H H = I$, $X X =
I$, and $Z Z = I$), if we apply the same sequence of gates in reverse
order, they cancel out, leaving the identity operation.
The circuit above first applies $H$, then $Z$, then $X$ twice (which
cancels itself out), then $Z$ again, and finally $H$ again. This results in:
\[
H Z X X Z H = I
\]
Hence, the overall operation on the qubit is the identity transformation,
meaning the final state remains the same as the initial state $\ket{\psi}$.
}
\vspace{0.3cm}
\noindent\rule{\linewidth}{0.2pt}
\vspace{0.3cm}
\index{Reversibility Property of Quantum Computing}
\dfn{Reversibility Property of Quantum Computing}{
Quantum operations are inherently reversible due to the \textbf{unitary}
nature of quantum gates. This means that any quantum circuit can be
reversed by applying the inverse of each gate in the reverse order.
Mathematically, if a quantum circuit is represented by a unitary matrix
$U$, its reverse is represented by $U^{\dagger}$, and since quantum gates
are unitary, they satisfy the property:
\[
U^{\dagger} U = U U^{\dagger} = I
\]
This reversibility is a fundamental difference between quantum and classical
computing and is directly tied to the \textbf{no information loss}
principle in quantum mechanics.
}
\paragraph{Why Reversibility is Important:}
In classical computing, operations such as the AND gate lose information.
For example, given the output of an AND gate, we cannot uniquely determine
the original input:
\[
(0,0) \mapsto 0, \quad (0,1) \mapsto 0, \quad (1,0) \mapsto 0, \quad
(1,1) \mapsto 1
\]
Since multiple inputs can produce the same output, information is lost,
making the operation \textbf{irreversible}.
\paragraph{Classical AND Gate (Irreversible)}
\begin{center}
\begin{tabular}{cc}
% Circuit diagram
\begin{circuitikz} \draw
% Input nodes and AND gate
(0,1) node[left] {$A$} -- ++(1,0)
(0,0) node[left] {$B$} -- ++(1,0)
(2,0.5) node[and port] (and) {}
% Connect everything
(1,1) -- (and.in 1)
(1,0) -- (and.in 2)
(and.out) -- ++(1,0) node[right] {$A \land B$};
\end{circuitikz}
&
% Truth table
\begin{tabular}{|c|c|c|}
\hline
$A$ & $B$ & $A \land B$ \\
\hline
0 & 0 & 0 \\
0 & 1 & 0 \\
1 & 0 & 0 \\
1 & 1 & 1 \\
\hline
\end{tabular}
\end{tabular}
\end{center}
\noindent This classical AND gate demonstrates information loss
(irreversibility) because multiple distinct input states map to the same
output state. As shown in the truth table, three different input
combinations (0,0), (0,1), and (1,0) all produce the same output 0. Given
only the output 0, it is impossible to determine which of these three input
states generated it—this loss of information about the system's initial
state makes the operation irreversible.
\paragraph{Quantum Reversibility:}
In contrast, \textbf{quantum gates are always unitary}, meaning they
preserve the total amount of information. Given the final state of a
quantum system, we can always determine its previous state by applying the
inverse transformation. This is why quantum circuits must be composed of
reversible operations.
\ex{Example of a Reversible Quantum Circuit:}{
\begin{center}
\begin{quantikz}
\lstick{\ket{\psi}} & \gate{H} & \gate{X} & \gate{X} & \gate{H} & \qw &
\rstick{\ket{\psi}}
\end{quantikz}
\end{center}
In this example, the quantum circuit consists of a sequence of unitary
gates: the Hadamard ($H$) and the Pauli-X ($X$) gates. These gates satisfy:
\[
H = H^\dagger, \quad X = X^\dagger
\]
Since these gates are their own inverses (\textit{i.e.,} $H H = I$ and $X X
= I$), if we apply the same sequence of gates in reverse order, they cancel
out, leaving the identity operation:
\[
H X X H = I
\]
}
\paragraph{Key Properties of Reversible Quantum Gates:}
\begin{enumerate}
\item Every quantum gate \( U \) has an inverse \( U^\dagger \), ensuring
that no information is lost.
\item The composition of unitary gates remains unitary, preserving
reversibility.
\item Classical Toffoli and Fredkin\footnote{More on Fredkin gates: \url{https://en.wikipedia.org/wiki/Fredkin_gate}}
are reversible and can be used to construct reversible classical circuits,
which is why they are also fundamental in quantum computing.
\item Measurement is \textbf{not} reversible, as it collapses the quantum
state and introduces information loss.
\end{enumerate}
The reversibility of quantum computing is crucial for error correction,
fault-tolerant quantum computation, and simulating physical systems where
information is conserved.
\ex{Example of Reversing a Quantum Circuit}{
Consider a circuit composed of gates $A$, $B$, and $C$:
\[
|\psi_{\text{final}}\rangle = CBA|\psi_{\text{initial}}\rangle.
\]
The reverse circuit applies $C^{\dagger}$, $B^{\dagger}$, and $A^{\dagger}$
in reverse order:
\[
|\psi_{\text{reversed}}\rangle =
A^{\dagger}B^{\dagger}C^{\dagger}|\psi_{\text{final}}\rangle =
A^{\dagger}B^{\dagger}C^{\dagger}CBA|\psi_{\text{initial}}\rangle =
|\psi_{\text{initial}}\rangle.
\]
}
\index{Quantum No-Cloning Theorem}
\dfn{Quantum No-Cloning Theorem}{
The no-cloning theorem states that it is impossible to create an identical
copy of an arbitrary unknown quantum state. This result follows directly
from the linearity of quantum mechanics.
}
\ex{Simple 2-Qubit Example}{
Consider two qubits in states $\ket{\psi}$ and $\ket{0}$. The no-cloning
theorem implies that there is no unitary operation $U$ such that:
\[
U(\ket{\psi} \otimes \ket{0}) = \ket{\psi} \otimes \ket{\psi}.
\]
}
\index{Quantum No-Cloning Theorem!proof@\textit{proof}}
\begin{proof}
\textbf{Proof of the Quantum No-Cloning Theorem}
Assume a unitary operator $U$ exists that can clone an arbitrary quantum
state $\ket{\psi}$. Then, for two different states $\ket{\psi}$ and
$\ket{\phi}$, we would have:
\[
U(\ket{\psi} \otimes \ket{0}) = \ket{\psi} \otimes \ket{\psi},
\]
\[
U(\ket{\phi} \otimes \ket{0}) = \ket{\phi} \otimes \ket{\phi}.
\]
Now, consider the superposition state $\ket{\xi} = a\ket{\psi} +
b\ket{\phi}$. Applying $U$ to $\ket{\xi} \otimes \ket{0}$ should produce:
\[
U(\ket{\xi} \otimes \ket{0}) = aU(\ket{\psi} \otimes \ket{0}) +
bU(\ket{\phi} \otimes \ket{0}) = a(\ket{\psi} \otimes \ket{\psi}) +
b(\ket{\phi} \otimes \ket{\phi}).
\]
However, if $U$ could clone $\ket{\xi}$, the result should be:
\[
U(\ket{\xi} \otimes \ket{0}) = \ket{\xi} \otimes \ket{\xi} = (a\ket{\psi}
+ b\ket{\phi}) \otimes (a\ket{\psi} + b\ket{\phi}).
\]
Expanding this, we get:
\[
\ket{\xi} \otimes \ket{\xi} = a^2(\ket{\psi} \otimes \ket{\psi}) +
ab(\ket{\psi} \otimes \ket{\phi}) + ab(\ket{\phi} \otimes \ket{\psi}) +
b^2(\ket{\phi} \otimes \ket{\phi}).
\]
Comparing the two expressions, we see that the terms $\ket{\psi} \otimes
\ket{\phi}$ and $\ket{\phi} \otimes \ket{\psi}$ appear in the expanded
$\ket{\xi} \otimes \ket{\xi}$, but they do not appear in $a(\ket{\psi}
\otimes \ket{\psi}) + b(\ket{\phi} \otimes \ket{\phi})$. This inconsistency
demonstrates that a unitary operator $U$ cannot clone an arbitrary quantum
state, proving the no-cloning theorem.
\end{proof}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End of Lecture 7
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%