-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlecture4.tex
340 lines (265 loc) · 8.53 KB
/
lecture4.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
\section{Lecture 4: Quantum Gates and Transformations}\label{sec:lecture4}
Quantum gates manipulate qubits through unitary transformations, preserving
quantum information and enabling quantum computation. This section explores
key quantum operations, their mathematical properties, and circuit
representations.
\dfn{Qubit Superposition and Hilbert Space}{A \textbf{qubit} exists in a
complex vector space called a \textbf{Hilbert space}. The state of a qubit
is given by:
\index{qubit!superposition}
\[
|\psi\rangle = \alpha |0\rangle + \beta |1\rangle, \quad \text{where }
\alpha, \beta \in \mathbb{C} \text{ and } |\alpha|^2 + |\beta|^2 = 1.
\]
}
\subsection*{Measurement and Superposition Collapse}
When a qubit is measured in the computational basis $\{|0\rangle,
|1\rangle\}$, it collapses to one of the basis states with probability:
\[
\boxed{
P(0) = \norm{\alpha_1}^2, \quad P(1) = \norm{\alpha_2}^2.
}
\]
The post-measurement state is:
\[
\boxed{
|\psi_{\text{measurement}}\rangle = \frac{|b\rangle \langle b | \psi
\rangle}{\sqrt{P(b)}}
}
\]
\noindent
where $b \in \{0,1\}$. This formula captures the quantum measurement
postulate and ensures proper normalization of the post-measurement state.
\vspace{0.3cm}
In the computational basis, the probability of measuring $|b\rangle$ is:
\index{universal bases!computational!measurement}
\[
\boxed{
P(b) = \norm{\langle b | \psi \rangle}^2
}
\]
\index{quantum measurement!properties@\textit{properties}}
\nt{Probability Properties of Measurement:
\[
\begin{aligned}
P(0) &= 1 - P(1) \\
P(+) &= 1 - P(-) \\
P(+i) &= 1 - P(-i)
\end{aligned}
\]
}
\subsection*{Quantum Gates and Operations} \index{quantum gates}
\textbf{Quantum gates} are unitary matrices that transform qubits. A general
qubit transformation is given by:
\[
|\psi_{\text{final}}\rangle = U |\psi_{\text{initial}}\rangle
\]
\noindent
where $U$ is a unitary matrix satisfying $U^\dagger U = I$. Key properties of
quantum gates include:
\index{quantum gates!properties@\textit{properties}}
\begin{itemize}
\item \textbf{Reversibility:} All quantum operations are reversible due
to unitarity
\item \textbf{Preservation of Norm:} The normalization condition
$|\alpha|^2 + |\beta|^2 = 1$ is preserved
\item \textbf{Linearity:} Gates act linearly on superposition states
\end{itemize}
\index{quantum gates!rotation gates}
\dfn{Rotation Gates}{Rotation gates rotate a qubit state around the Bloch
sphere:
\begin{itemize}
\index{quantum gates!rotation gates!X-axis}
\item \textbf{Rotation about X-axis:}
\[
\boxed{
R_X(\omega) =
\begin{bmatrix}
\cos\frac{\omega}{2} & -i\sin\frac{\omega}{2} \\
-i\sin\frac{\omega}{2} & \cos\frac{\omega}{2}
\end{bmatrix}
}
\]
Effect: Rotates state by angle $\omega$ around X-axis
\index{quantum gates!rotation gates!Y-axis}
\item \textbf{Rotation about Y-axis:}
\[
\boxed{
R_Y(\omega) =
\begin{bmatrix}
\cos\frac{\omega}{2} & -\sin\frac{\omega}{2} \\
\sin\frac{\omega}{2} & \cos\frac{\omega}{2}
\end{bmatrix}
}
\]
Effect: Rotates state by angle $\omega$ around Y-axis
\index{quantum gates!rotation gates!Z-axis}
\item \textbf{Rotation about Z-axis:}
\[
\boxed{
R_Z(\omega) =
\begin{bmatrix}
e^{-i\omega/2} & 0 \\
0 & e^{i\omega/2}
\end{bmatrix}
}
\]
Effect: Adds a relative phase between $|0\rangle$ and $|1\rangle$
components
\end{itemize}
}
\index{matrix!Pauli matrices}
\dfn{Pauli Matrices and Gates}{The \textbf{Pauli matrices} define fundamental
quantum operations:
\index{quantum gates!NOT gate}
\begin{itemize}
\item \textbf{Pauli-X (NOT Gate, Bit-Flip):}
\[
\boxed{
X = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}
}
\]
Effect: $X|0\rangle = |1\rangle$, $X|1\rangle = |0\rangle$
\index{quantum gates!Pauli-Y gate}
\item \textbf{Pauli-Y (Combination of X and Z with phase):}
\[
\boxed{
Y = \begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix}
}
\]
Effect: $Y|0\rangle = i|1\rangle$, $Y|1\rangle = -i|0\rangle$
\index{quantum gates!Phase-Flip gate}
\item \textbf{Pauli-Z (Phase-Flip Gate):}
\[
\boxed{
Z = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}
}
\]
Effect: $Z|0\rangle = |0\rangle$, $Z|1\rangle = -|1\rangle$
\end{itemize}
\aside{Each of these matrices is both \textbf{Hermitian} ($A = A^\dagger$) and
\textbf{unitary} ($A^\dagger A = I$).}
Important relationships:
\begin{itemize}
\item $X^2 = Y^2 = Z^2 = I$
\item $XY = iZ$, $YZ = iX$, $ZX = iY$
\item $YX = -iZ$, $ZY = -iX$, $XZ = -iY$
\end{itemize}}
\subsection*{Circuit Notation} \index{Circuit notation}
Quantum circuits visually represent quantum operations. Each qubit is
represented as a horizontal line, and gates are applied sequentially from
left to right. Important circuit elements include:\footnote{For rendering
quantum circuits, consider using the \texttt{quantikz} package in \LaTeX:
\url{https://ctan.org/pkg/quantikz}}
\begin{itemize}
\item \textbf{Single-qubit gates:} Represented as boxes with gate symbols
\item \textbf{Measurements:} Depicted with a meter symbol
\item \textbf{Time flow:} Left to right in circuits (\textit{\textbf{opposite
of matrix multiplication order}})\footnote {
For example, the circuit $U_1U_2$ corresponds to the
matrix product $U_2U_1$.
}
\end{itemize}
\ex{Example: Complex Circuit Analysis}{Consider the circuit applying the
sequence $HZH$ to $|0\rangle$:
\[
\begin{aligned}
|\psi_1\rangle &= H|0\rangle = \frac{1}{\sqrt{2}}(|0\rangle +
|1\rangle) \\
%
|\psi_2\rangle &= Z|\psi_1\rangle = \frac{1}{\sqrt{2}}(|0\rangle -
|1\rangle) \\
%
|\psi_3\rangle &= H|\psi_2\rangle = |1\rangle
\end{aligned}
\]
This sequence performs a NOT operation on $|0\rangle$ using only Hadamard and
Phase-flip gates.
\[
\begin{quantikz}
\lstick{$|0\rangle$} & \gate{H} & \gate{Z} & \gate{H} & \one \\
\end{quantikz}
\]
}
\ex{Another Circuit Example}{
\[
\begin{aligned}
XY \zero & = X \begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix}\\
%
& = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} \begin{bmatrix} 0 \\ i \end{bmatrix} \\
%
& = \begin{bmatrix} i \\ 0 \end{bmatrix} = i \one
\end{aligned}
\]
\[
\begin{quantikz}
\lstick{$\zero$} & \gate{Y} & \gate{X} & i \zero \\
\end{quantikz}
\]
}
%%%%%%%%%%%%%%%%%%%%%%%
\qs{Exercise 1}{Apply the sequence $SXH$ to $|0\rangle$ and calculate:
\begin{itemize}
\item The final state vector
\item The probabilities of measuring $|0\rangle$ and $|1\rangle$
\item The possible post-measurement states
\end{itemize}}
\sol{
\begin{align*}
H|0\rangle &= \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle) \\
%
XH|0\rangle &= \frac{1}{\sqrt{2}}(|1\rangle + |0\rangle) =
\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle) \\
%
SXH|0\rangle &= \frac{1}{\sqrt{2}}(|0\rangle + i|1\rangle)
\end{align*}
Therefore:
\begin{itemize}
\item Final state: $|\psi\rangle = \frac{1}{\sqrt{2}}(|0\rangle +
i|1\rangle)$
\item Measurement probabilities: $P(0) = P(1) = \frac{1}{2}$
\item Post-measurement states: Either $|0\rangle$ or $|1\rangle$ with
equal probability
\end{itemize}}
\vspace{0.3cm}
\qs{Exercise 2}{Show that the Hadamard gate is its own inverse by calculating
$H^2$.}
\sol{
\[
H^2 = \begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}
\begin{bmatrix}
\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}
\end{bmatrix}
%
= \begin{bmatrix}
1 & 0 \\
0 & 1
\end{bmatrix} = I
\]
}
\qs{Exercise 3}{Calculate the effect of applying $R_Z(\pi/2)$ to the state
$|+\rangle$.}
\sol{
\[
R_Z(\pi/2)|+\rangle = \begin{bmatrix}
e^{-i\pi/4} & 0 \\
0 & e^{i\pi/4}
\end{bmatrix}
\begin{bmatrix}
\frac{1}{\sqrt{2}} \\
\frac{1}{\sqrt{2}}
\end{bmatrix}
= \begin{bmatrix}
\frac{1}{\sqrt{2}} \\
\frac{i}{\sqrt{2}}
\end{bmatrix}
= |+i\rangle
\]
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End of Lecture 4
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%