Week 6 - my notes
Table of Contents
Week 6 (qubit by qubit)
Recap
Review: States and Gates
- X - 180 rotation around the X-axis
- Z - 180 rotation around the Z-axis
- H - creates a superposition
Math for Quantum: Qubits
- With math we can predict the outcomes, without necessarily having to memorize each one of them.
- Superconducting, Trapped Ions, Diamond NV Centers, Photonics are different kind of qubits, and math is the language common to all of them!
- Linear Algebra is used in many algorithms, like grover’s algorithm.
Qubits
- \(|0\rangle\), \(|1\rangle\), \(|+\rangle\), \(|-\rangle\) are ways to represent them.
- But in an unequal superposition, we need a better way to represent contributions.
- That is why we will use two numbers in the form of a vector.
- 0 state is represented as \[\begin{bmatrix}1\\0\end{bmatrix}\]
- 1 state is represented as \[\begin{bmatrix}0\\1\end{bmatrix}\]
- It is worth mentioning that the top number represents the component of \(|0\rangle\) and the bottom, the component of \(|1\rangle\).
Superpostions
- To represent equal superpositions, we just need to add the two vectors: \[\begin{bmatrix}1\\0\end{bmatrix} + \begin{bmatrix}0\\1\end{bmatrix} = \begin{bmatrix}1\\1\end{bmatrix}\]
- To get to an unequal superposition, we need to apply some gates to get there and this is the goal of a field called quantum algorithm design
Normalization
- The vectors representing quantum states must be normalized, which means they have a lenght of 1
- The radius of the Bloch Sphere is 1, so as all quantum states lie on the Bloch sphere, they must all have a length of 1.
[ ]
Step 1: Write the state in the vector form \[\begin{bmatrix}a\\b\end{bmatrix}\][ ]
Step 2: Find the length of the state as \[\sqrt{a^2 + b^2}\][ ]
Step 3: If the length is 1, the state is normalized. If not, divide the state by its length to get the normalized state.- Normalized form of the state = \[\frac{1}{\sqrt{a^2 + b^2}}\begin{bmatrix}a\\b\end{bmatrix}\]
Examples to help with normalization:
- Remember that all of this comes from linear algebra
- The length of the state \[\begin{bmatrix}1\\0\end{bmatrix}\]
- A: 1
- Find the normalized state of \[\begin{bmatrix}1\\1\end{bmatrix}\]
- Finding the length: \[\sqrt{1^2 + 1^2} = \sqrt{2}\]
- As the length is not 1, we need to divide take the state and divide it by its length, then we get the normalized state:
\[\frac{1}{\sqrt{2}}\begin{bmatrix}1\\1\end{bmatrix}\]
Phase
- Subtract the following states: \[\frac{1}{\sqrt{2}}\begin{bmatrix}1\\0\end{bmatrix} - \frac{1}{\sqrt{2}}\begin{bmatrix}0\\1\end{bmatrix} = \frac{1}{\sqrt{2}}\begin{bmatrix}1\\-1\end{bmatrix}\]
- That is the same as \(|-\rangle\)
Normalized form of \(|+\rangle\) and \(|-\rangle\) states
- \(|+\rangle\) = \[\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)\] same as \[\frac{1}{\sqrt{2}}\begin{bmatrix}1\\1\end{bmatrix}\]
- \(|-\rangle\) = \[\\frac{1}{\sqrt{2}}(|0\rangle-|1\rangle)\] same as \[\frac{1}{\sqrt{2}}\begin{bmatrix}1\\-1\end{bmatrix}\]
- These two states above are both equal superpositions but they differ in phase
- Therefore, the sign between \(|0\rangle\) and \(|1\rangle\) is called phase. Is it positive or negative?
- The phase diferences lead to interference (more coming soon)
- There are more relations in phase that won’t be addressed in this course because they require complex numbers
Lab
- Qiskit Aer, Qiskit Nature, Qiskit Pulse are what we have inside the mega qiskit library. We are gonna use Qiskit Aer.
- Qiskit Aer has two simulators: the Statevector simulator and the QASM simulator
- The Statevector simulator gives us the vector form of the final state. It gives us the ideal result
- The QASM simulator gives us the performing measurements on quantum circuits (like a hands-on)
- We can say statevector will give us the theorical result and QASM simulator will give us the experimental result.
Resources
- Essence of Linear Algebra: A Video Playlist by 3Blue1Brown
- Summary: Explains all important concepts in linear algebra visually in a geometric way. Very highly recommended!
- Lockdown Math: A Video Playlist by 3Blue1Brown
- Summary: Important math concepts presented in a visual manner. Multiple episodes on complex numbers which are very highly recommended!
- Here’s just a fraction of what you can do with linear algebra, Jeremy Kun (Article)
- Summary: Why should we be motivated to learn the math needed for this course and computer science as a whole? A quick read on some applications of linear algebra.