Lecture 1.1 - Vector Spaces, Tensor Products, and Qubits
- Source:: 2021 Qiskit Global Summer School
- URL:: https://learn.qiskit.org/summer-school/2021/lec1-1-vector-spaces-tensor-products-qubits
- Instructor:: Elisa Bäumer
# Notes
# From bits to qubits
- Classical states for computation are either $0$ or $1$ .
- In quantum mechanics, a state can be in Superposition, i.e., simultaneously be in $0$ and $1$ .
- Superpositions allow us to perform calculations much faster, because they allow us to perform calculations on many states at the same time.
- We can construct some quantum algorithms that can potentially give us some exponential speed-up.
- But once we measure the superposition state, it collapses into one of its states.
- It is actually not that THAT easy to design useful quantum algorithms.
- But we can use interreference effects to our benefit.
- It is actually not that THAT easy to design useful quantum algorithms.
- Superpositions allow us to perform calculations much faster, because they allow us to perform calculations on many states at the same time.
# Dirac Notation and Density matrices
- Dirac Notation is used to describe quantum states.
- ket: $\ket{a} = \begin{pmatrix} a_0 \\ a_1 \end{pmatrix}$
- bra: $\bra{b} = \ket{b}^\dagger = \begin{pmatrix}b_0 \\ b_1 \end{pmatrix}^\dagger = \begin{pmatrix}b_0^* & b_1^* \end{pmatrix}$ i.e. bra is the Complex Conjugate transpose of a ket.
- bra-ket: $\braket{b|a} = a_0b_0^* + a_1b_1^* \in \mathbb{C}$ .
- ket-bra: $\ket{a}\bra{b} = \begin{pmatrix}a_0b_0^* & a_0b_1^* \\ a_1b_0^* & a_1b_1^*\end{pmatrix}$ .
- In Quantum Computing, we define the pure state $\ket{0} = \begin{pmatrix}1 \\ 0 \end{pmatrix}$ and $\ket{1} = \begin{pmatrix}0 \\ 1 \end{pmatrix}$ , which are orthogonal: $$\braket{0 | 1} = 1 \times 0 + 0 \times 1 = 0.$$
- Tensor product is defined as: $$\ket{0}\bra{0} = \begin{pmatrix}1 & 0 \end{pmatrix}\begin{pmatrix}1 \\ 0 \end{pmatrix} = \begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}, \qquad \ket{1}\bra{1} = \begin{pmatrix}0 & 1 \end{pmatrix}\begin{pmatrix}0 \\ 1 \end{pmatrix} = \begin{pmatrix}0 & 0 \\ 0 & 1 \end{pmatrix}.$$
- Any Matrix can be described using the Dirac Notation $$\rho = \begin{pmatrix} \rho_{00} & \rho_{01} \\ \rho_{10} & \rho_{11} \end{pmatrix} = \rho_{00}\ket{0}\bra{0} + \rho_{01}\ket{0}\bra{1} + \rho_{10}\ket{1}\bra{0} + \rho_{11}\ket{1}\bra{1}.$$
- All quantum states in any superposition can be described by Density matrices, i.e. normalized ( $tr(\rho) = 1$ ), positive ( $\rho \geq 0$ ) Hermitian operators ( $\rho = \rho^\dagger$ ) $\rho$ .
- Normalized: $tr(\rho) = \rho_{00} + \rho_{11} = 1$
- Semi-positive definite: $\braket{\psi | \rho | \psi} \geq 0 \forall \psi$
- This is equivalent to all eigenvalues of $\rho$ to be $\geq 0$ .
- Hermitian operator: $$\rho^\dagger = \begin{pmatrix}\rho_{00}^* & \rho_{10}^* \\ \rho_{01}^* & \rho_{11}^* \end{pmatrix} = \rho.$$
- All quantum states are normalized, i.e. $\braket{\psi | \psi} = 1$ .
- Spectral Decomposition
- For every Density matrix $\rho \exists$ an orthonormal basis ${\ket{i}}$ , s.t. $\rho = \sum_{i} \lambda_i \ket{i}\bra{i}$ , where $\ket{i}$ are eigenstates and $\lambda_i$ are eigenvalues, and $\sum_i \lambda_i = 1$ .
- A Density matrix is pure if $\rho = \ket{\psi}\bra{\psi}$ . If it is not pure, then it is called mixed.
- If $\rho$ is pure, then only one Eigenvalue is $1$ and all others are $0$ , i.e. $tr(\rho^2) = \sum_{i} \lambda_i^2 = 1$
- Otherwise, for a mixed state: $tr(\rho^2) \lt 1$ .
- Examples:
- $\rho = \begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix} = \ket{0}\bra{0} \rightarrow$ pure.
- $\rho = \begin{pmatrix}0 & 0 \\ 0 & 1 \end{pmatrix} = \ket{1}\bra{1} \rightarrow$ pure.
- $\rho = \frac{1}{2}\begin{pmatrix}0 & 0 \\ 0 & 1 \end{pmatrix} = \frac{1}{2}\ket{0}\bra{0} + \ket{1}\bra{1}\rightarrow$ mixed.
- $\rho = \frac{1}{2}\begin{pmatrix}1 & -1 \\ -1 & 1 \end{pmatrix} = \frac{1}{2}(\ket{0}\bra{0} - \ket{0}\bra{1} - \ket{1}\bra{0} + \ket{1}\bra{1}) = \underbrace{\frac{1}{\sqrt 2}(\ket{0} - \ket{1})}{\ket{\psi}} \underbrace{(\bra{0} - \bra{1})\frac{1}{\sqrt 2}}{\ket{\psi}} \rightarrow$ pure.
- A pure state is a state where we have all the information i.e. we know exactly which state it is in.
- $\ket{0}, \ket{1}$ .
- For Superposition, we still know which state it is in, like $\ket{0} - \ket{1}$ , and we can apply some operators to bring it back to state $\ket{0}$ or $\ket{1}$ .
- A mixed state is a state where we do not know which state we are in.
- It is different from Superposition.
- For Quantum Computing, in an ideal case, we will only work with pure state.
# Measurement
- We choose orthogonal basis to describe and measure quantum states. The measurements are called projective measurements.
- During a measurement onto the basis ${\ket{0}, \ket{1}}$ , the state will collapse into either state $\ket{0}$ or $\ket{1}$ , as these are the two eigenstates of $\sigma_z = \begin{pmatrix}1 & 0 \\ 0 & 1 \end{pmatrix}$ .
- We call this a $Z$ -measurement.
- There are infinitely many different basis, but not all of them are commonly used.
- Some common basis used are:
- ${\ket{+} = \frac{1}{\sqrt 2}(\ket{0} + \ket{1}), \ket{-} = \frac{1}{\sqrt 2}(\ket{0} - \ket{1}) }$
- ${\ket{+i} = \frac{1}{\sqrt 2}(\ket{0} + i\ket{1}), \ket{-i} = \frac{1}{\sqrt 2}(\ket{0} - i\ket{1}) }$
- These correspond to the eigenstates of $\sigma_x$ and $\sigma_y$ , respectively.
- Some common basis used are:
- Born Rule
- The probability that a state $\ket{\psi}$ collapses, during a projective measurement onto the basis ${\ket{x}, \ket{x^\perp}}$ , to the state $\ket{x}$ is given by $$P(x) = |\braket{x|\psi} |^2, \qquad \sum_i P(x_i) = 1.$$
- Examples
- $\ket{\psi} = \frac{1}{\sqrt 3}(\ket{0} + \sqrt 2 \ket{1})$ is measured in the $Z$ -basis ${\ket{0}, \ket{1}}$ , then$$\begin{aligned}P(0) &= |\braket{0 | \frac{1}{\sqrt 3}(\ket{0} + \sqrt{2} \ket{1})} |^2 \newline&= |\frac{1}{\sqrt 3}\underbrace{\braket{0 | 0}}{1} + \sqrt{\frac{2}{3}} \underbrace{\braket{0 | 1}}{0}|^2 \newline &= \frac{1}{3}\end{aligned}$$
- $\ket{\psi} = \frac{1}{\sqrt 2}(\ket{0} - \ket{1})$ is measured in the $X$ -basis ${\ket{+}, \ket{-}}$ , then $$\begin{aligned}P(+) &= |\braket{+ | \psi}|^2 \newline &= | \frac{1}{\sqrt 2}(\ket{0} + \ket{1}) . \frac{1}{\sqrt 2}(\ket{0} - \ket{1})|^2 \newline &= \frac{1}{4} |\underbrace{\braket{0 | 0}}{1} - \underbrace{\braket{0 | 1}}{0} + \underbrace{\braket{1 | 0}}{0} - \underbrace{\braket{1 | 1}}{1} \newline &= 0.\end{aligned}$$
# Bloch Sphere
- We can write any normalized pure state as $\ket{\psi} = \cos \frac{\theta}{2}\ket{0} + e^{i\phi}\sin{\frac{\theta}{2} \ket{1}}$ where $\phi \in [0, 2\pi]$ describes the relative phase and $\theta \in [0, \pi]$ determines the probability to measure $\ket{0}$ and $\ket{1}$ . $$P(0) = \cos^2 \frac{\theta}{2}, \qquad P(1) = \sin^2 \frac{\theta}{2}.$$
- All normalized pure states can be described by two variables $\phi$ and $\theta$ . This means that we can illustrate them on the surface of a sphere with radius $1$ . This sphere is called the Bloch sphere.
- The coordinates of such a state are given by the Bloch vector: $$\vec{r} = \begin{pmatrix} \sin\theta\cos\phi \\ \sin\theta\sin\phi \\ \cos\theta \end{pmatrix}.$$
- Examples
- Be careful: On the Bloch sphere, all angles are twice as large as they are in the Hilbert Space, e.g. $\ket{0}$ and $\ket{1}$ are orthogonal in Hilbert Space, but on the Bloch sphere they aren’t as their angle is $180^\circ$ .
- For a general state $\ket{\psi} = \cos \frac{\theta}{2}\ket{0} + e^{i\phi}\sin{\frac{\theta}{2} \ket{1}}$ , $\theta$ is the angle on the Bloch sphere, while $\frac{\theta}{2}$ is the actual angle in Hilbert Space.
- $Z$ -measurement correspond to a projection onto the $Z$ -axis and analogously for $X$ and $Y$ !
