Lecture 1.2 - Introduction to Quantum Circuits
- Source:: 2021 Qiskit Global Summer School
- URL:: https://learn.qiskit.org/summer-school/2021/lec1-2-introduction-quantum-circuits
- Instructor:: Elisa BΓ€umer
# Notes
π 00:20 Circuit model is a sequence of blocks that carry out elementary computations, called gates.
π 01:22 One-Qubit Quantum Gates
- [i] π 02:04 As quantum theory is unitary, so all Quantum Gates must be represented by unitary matrices: $$U^\dagger U = I.$$
π 02:56 Pauli X-gate
- It is defined as: $\sigma_x = \begin{pmatrix}0 & 1 \\ 1 & 0 \end{pmatrix} = \ket{0}\bra{1} + \ket{1}\bra{0}$ .
- This gate, when applied to $\ket{0}$ and $\ket{1}$ , results in $$\begin{aligned}\sigma_x \ket{0} &= \begin{pmatrix}0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix}0 \\ 1 \end{pmatrix} = \ket{1}, \newline \sigma_x\ket{1} &= (\ket{0}\bra{1} + \ket{1}\bra{0}) \cdot \ket{1} = \ket{0} \underbrace{\braket{1 | 1}}{1} + \ket{1}\underbrace{\braket{0 | 1}}{0} = \ket{0}. \end{aligned}$$
- π 04:42 It has the same effect as a NOT Gate, i.e. it performs bit flip, meaning that if the state is $\ket{0}$ it’ll return $\ket{1}$ and if the state is $\ket{1}$ , it will return $\ket{0}$ .
- π 05:19 On the Bloch sphere, this gate corresponds to the rotation around $x$ -axis by $\pi$ .
π 06:49 Pauli Z-Gate
- It is defined as: $\sigma_z = \begin{pmatrix}1 & 0 \\ 0 & -1 \end{pmatrix} = \ket{0}\bra{0} - \ket{1}\bra{1}$ .
- This gate, when applied to $\ket{+}$ and $\ket{-}$ , results in $$\begin{aligned}\sigma_z \ket{+} &= \begin{pmatrix}1 & 0 \\ 0 & -1 \end{pmatrix} \cdot \frac{1}{\sqrt 2}\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \frac{1}{\sqrt 2} \begin{pmatrix}1 \\ -1 \end{pmatrix} = \ket{-}, \newline \sigma_z\ket{-} &= (\ket{0}\bra{0} - \ket{1}\bra{1}) \cdot \frac{1}{\sqrt 2} (\ket{0} - \ket{1}) = \frac{1}{\sqrt{2}} (\ket{0} + \ket{1}) = \ket{+}. \end{aligned}$$
- π 07:49 This is the phase flip as it swaps $\ket{+}$ and $\ket{-}$ states.
- On the Bloch sphere, this gate corresponds to the rotation around the $z$ -axis by $\pi$ .
π 08:31 Pauli Y-Gate
- It is defined as: $\sigma_y = \begin{pmatrix}0 & -i \\ i & 0 \end{pmatrix} = i \cdot \sigma_x \cdot \sigma_z$ .
- So this corresponds to both a bit flip and phase flip.
- On the Bloch sphere, this gate corresponds to the rotation around the $y$ -axis by $\pi$ .
- This is where I can take notes while watching the video.
- π 09:28 $\sigma_x, \sigma_y$ and $\sigma_z$ are the so-called Pauli matrices and $\sigma_i^2 = \mathbb{I} = \begin{pmatrix}1 & 0 \\ 0 & 1\end{pmatrix}$ . So applying any Pauli matrix twice, does nothing.
- π 10:18 The three Pauli matrices together with identity $\mathbb{I}$ form a basis of $2 \times 2$ matrices.
- This means that any 1-qubit rotation can be written as a linear combination of these 4 matrices.
π 11:09 Hadamard Gate
- It is one of the most important gates for quantum circuits.
- It is defined as $H = \frac{1}{\sqrt 2}\begin{pmatrix}1 & 1 \\ 1 & -1 \end{pmatrix} = \frac{1}{\sqrt 2}(\ket{0}\bra{0} + \ket{0}\bra{1} + \ket{1}\bra{0} - \ket{1}\bra{1}).$
- This gate, when applied to $\ket{0}$ and $\ket{1}$ , results in $$\begin{aligned} H\ket{0} &= \frac{1}{\sqrt 2}\begin{pmatrix}1 & 1 \\ 1 & -1 \end{pmatrix} \cdot \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \frac{1}{\sqrt 2}\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \ket{+}, \newline H\ket{1} &= \frac{1}{\sqrt 2}(\ket{0}\bra{0} + \ket{0}\bra{1} + \ket{1}\bra{0} - \ket{1}\bra{1}) \cdot \ket{1} = \frac{1}{\sqrt 2}(\ket{0} - \ket{1}) = \ket{-}. \end{aligned}$$
- π 13:35 This gate creates Superposition.
- π 13:46 Also $H\ket{+} = \ket{0}, \qquad H\ket{-} = \ket{1}$ .
- Because of this property, it is used to change between $X$ and $Z$ basis.
π 14:44 S-gate
It is defined as: $S = \begin{pmatrix}1 & 0 \\ 0 & i \end{pmatrix}$ . It adds $90^\circ$ to the phase $\phi$ . $$S\ket{+} = \ket{+i}, \qquad S\ket{-} = \ket{-i}.$$
π 15:26 $SH$ is applied to change from $Z$ to $Y$ basis.
π 16:34 Multipartite Quantum States
- We use tensor products to describe multiple states: $$\ket{a} \otimes \ket{b} = \begin{pmatrix}a_1 \\ a_2 \end{pmatrix} \otimes \begin{pmatrix} b_1 \\ b_2 \end{pmatrix} = \begin{pmatrix} a_1b_1 \\ a_1b_2 \\ a_2b_1 \\ a_2b_2 \end{pmatrix}.$$
- π 17:51 Example
- A system $A$ is in state $\ket{1}_A$ and a system $B$ is in state $\ket{0}B$ , then the total (bipartite) state is $$\ket{10}{AB} = \ket{1}_A \otimes \ket{0}_B = \begin{pmatrix}0\\ 1\end{pmatrix} \otimes \begin{pmatrix} 1 \\ 0\end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 1 \\ 0 \end{pmatrix}.$$
- π 19:13 States of this form are called uncorrelated states
- There are also bipartite states that cannot be written as $\ket{\psi} \otimes \ket{\psi}$ . These states are called correlated states, and sometimes even Entangled states i.e., if they have very strong correlation.
- For example, $\ket{\psi}{AB}^{(00)} = \frac{1}{\sqrt 2} (\ket{00}{AB} + \ket{11}_{AB}) = \frac{1}{\sqrt 2}\begin{pmatrix}1 \\ 0 \\ 0 \\ 1 \end{pmatrix}$ .
π 21:46 Two-Qubit Quantum Gates
- Classical example of two bit gate is XOR Gate. This is an irreversible gate, i.e., given the output, we cannot recover the input.
- π 22:49 As quantum theory is always unitary, we can only consider unitary matrices, and unitary gates, by definition, are always reversible.
- π 23:37 Quantum example of a two qubit gate is CNOT Gate. It is defined as:
$$CNOT = \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix} = \ket{00}\bra{00} + \ket{01}\bra{01} + \ket{10}\bra{10} + \ket{11}\bra{11}.$$- π 24:36 Application
$$\begin{aligned} CNOT \cdot \ket{00} &= CNOT \cdot \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \end{pmatrix} = \ket{00}, \newline CNOT \cdot \ket{10} &= \ket{11}. \end{aligned}$$
- π 24:36 Application
- This corresponds to the reversible XOR Gate.
- π 28:08 We can show that every function $f$ can be described by a reversible circuit.
- π 28:45 Quantum circuits can perform all functions that can be calculated classically.
π 29:34 Entanglement
- π 30:33 If a pure state $\ket{\psi}_{AB}$ on systems $A, B$ cannot be written as $\ket{\psi}_A \otimes \ket{\phi}_B$ , it is entangled.
π 31:45 Bell states
These are four so called Bell states that are Maximally entangled and build an orthonormal basis:
$$\begin{aligned} \ket{\psi^{00}} &= \frac{1}{\sqrt 2}(\ket{00} + \ket{11}), \qquad \ket{\psi^{01}} = \frac{1}{\sqrt 2}(\ket{01} + \ket{10}), \newline \ket{\psi^{10}} &= \frac{1}{\sqrt 2}(\ket{00} - \ket{11}), \qquad \ket{\psi^{11}} = \frac{1}{\sqrt 2}(\ket{01} - \ket{10}). \end{aligned}$$
In general, we can write $\ket{\psi^{ij}} = (\mathbb{I} \otimes \sigma_x^j \cdot \sigma_z^i) \ket{\psi^{00}}$ .
π 35:42 Creation of Bell states
- π 39:47 By applying the gates in the opposite direction and measuring them, we can perform Bell measurement. We basically project onto the bell basis.
- Classical outcomes $i, j$ correspond to a measurement of the state $\ket{\psi^{ij}}$ .
π 42:04 Quantum Teleportation
π 42:16 Goal
- Alice wants to send her (unknown) state $\ket{\phi}_S = \alpha\ket{0}_S + \beta\ket{1}_S$ to Bob.
- She can only send two classical bits though.
- They both share the Maximally entangled state $\ket{\psi^{00}}AB = \frac{1}{\sqrt 2}(\ket{00}{AB} + \ket{11}_{AB})$ .
π 44:41 Initial state of the total system
$$\begin{aligned}
\ket{\psi}S \otimes \ket{\phi^{00}}{AB} &= \frac{1}{\sqrt 2}(\alpha \ket{000}{SAB} + \alpha\ket{011}{SAB} + \beta\ket{100}{SAB} + \beta\ket{111}{SAB}) \newline
&= \frac{1}{2 \sqrt 2}[(\ket{00}{SA} + \ket{11}{SA}) \otimes (\alpha\ket{0}B + \beta \ket{1}B) \newline
&\qquad + (\ket{01}{SA} + \ket{10}{SA}) \otimes (\alpha\ket{1}B + \beta \ket{0}B) \newline
&\qquad + (\ket{00}{SA} - \ket{11}{SA}) \otimes (\alpha\ket{0}B - \beta \ket{1}B) \newline
&\qquad + (\ket{01}{SA} + \ket{10}{SA}) \otimes (\alpha\ket{1}_B - \beta \ket{0}B)] \newline
&= \frac{1}{2}[\ket{\psi^{00}}{SA} \otimes \ket{\phi}B + \ket{\psi^{01}}{SA} \otimes (\sigma_x \ket{\phi}B) \newline
&\qquad + \ket{\psi^{10}}{SA} \otimes (\sigma_z \ket{\phi}B) + \ket{\psi^{11}}{SA} \otimes (\sigma_x \sigma_z \ket{\phi}_B)].
\end{aligned}$$
- We separated $SA$ because Alice only has access to those qubits. This way we can better understand and visualize how Alice transforms/operates on those qubits.
π 51:33 Protocol
π 57:19 Note, that Alice’s state collapsed during the measurement, so she does not have the initial state $\ket{\phi}$ anymore. This is expected due to the no-cloning theorem, as she cannot copy her state, but can just send her state to Bob while destroying her own.
π 59:03 An unexpected reference to one of my favorite movies, The Prestige π