Search

# An Introduction to Linear Algebra for Quantum Computing - Qiskit

Last updated Jun 23, 2022

# # Notes

• Linear Algebra is the language of Quantum Computing.
• A Vector $\ket{v}$ is formally defined as elements of a set known as a Vector Space. ^30a2ef
• Intuitively, we can think of a Vector as a mathematical quantity with both direction and magnitude. ^719b7b
• Matrices are mathematical objects that transform vectors into other vectors.
• We can apply a matrix to a vector by performing matrix multiplication.
• What is a state vector in quantum computing?
• These are simply vectors that point to a specific point in space that corresponds to a particular Quantum State.
• What are quantum gates?
• A quantum gate can be expressed as a Matrix that can be applied to state vectors, thus changing the Quantum State.
• For example, Pauli X-gate
• It is represented by the following matrix:
\begin{align*}\sigma_x \\ = \\ \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\end{align*}
• This acts similar to the classical NOT logic gate.
• When we apply this gate to each of the states, we get
• Hermitian Matrix
• A matrix that is equal to its Conjugate Transpose.
• This means that flipping the sign of a Hermitian matrix’s imaginary components, then reflecting its entries along its main diagonal (from the top left to bottom right corners), produces an equal matrix.
• The Pauli Y-Gate, commonly used in quantum computation, is Hermitian.
• It flips the state, i.e. maps the computational basis state $\ket{0}$ to $\ket{1}$ and $\ket{1}$ to $\ket{0}$ .\begin{align*}\sigma_x |0\rangle \\ = \\ \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \\ = \\ \begin{pmatrix} (0)(1) \\ + \\ (1)(0) \\ (1)(1) \\ + \\ (0)(0) \end{pmatrix} \\ = \\ \begin{pmatrix} 0 \\ 1 \end{pmatrix} \\ = \\ |1\rangle\end{align*} \begin{align*}\sigma_x |1\rangle \\ = \\ \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \\ = \\ \begin{pmatrix} (0)(0) \\ + \\ (1)(1) \\ (1)(0) \\ + \\ (0)(1) \end{pmatrix} \\ = \\ \begin{pmatrix} 1 \\ 0 \end{pmatrix} \\ = \\ |0\rangle\end{align*}
• What are the two important types of matrices that we encounter in Quantum Computing?
\begin{align*}\sigma_y \\ = \\ \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix} \\ \Rightarrow \\ \sigma_y^{\dagger} \\ = \\ \begin{pmatrix} 0 & -(i) \\ -(-i) & 0 \end{pmatrix} \\ = \\ \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix} \\ = \\ \sigma_y\end{align*} - More important in quantum mechanics as compared to Quantum Computation.
• Matrix/Unitary
• A matrix whose inverse matrix equals its conjugate transpose.
• Calculating inverse matrices is rarely important in quantum computing.
• Since most of the matrices we encounter are unitary, we can assume that the inverse is simply given by taking the conjugate transpose.
• The Pauli Y-Gate, in addition to being Hermitian Matrix}Hermitian , is also unitary.
• It is equal to its conjugate transpose, which is also equal to its inverse; therefore, the Pauli-Y matrix is its own inverse!

\begin{align*}\sigma_y \\ = \\ \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix} \\ \\ \\ \\ \\ \sigma_y^{\dagger} \\ = \\ \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}\end{align*} \begin{align*}\sigma_y^{\dagger} \sigma_y \\ = \\ \begin{pmatrix} (0)(0) + (-i)(i) & (0)(-i) \\ + \\ (-i)(0) \\ (i)(0) \\ + \\ (0)(i) & (i)(-i) \\ + \\ (0)(0) \end{pmatrix} \\ = \\ \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \\ = \\ \mathbb{I}\end{align*} - Unitary matrices leave the length of a complex vector/ Quantum State unchanged.