Quantum mechanics for non-physicists
PHYS-344
Homework 1 part 1
Description
%% LyX 2.0.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,a4paper]{article}
\usepackage[latin9]{inputenc}
\usepackage{verbatim}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{esint}
\usepackage[numbers,sort&compress]{natbib}
\usepackage[compact]{titlesec}
\setlength{\bibsep}{2pt}
%\onehalfspacing
%%\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%\special{papersize=\the\paperwidth,\the\paperheight}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%\documentclass[aps,pre,twocolumn,floatfix,letterpaper,amssymb,superscriptaddress]{revtex4-1}
%\documentclass[aps,prl,twocolumn,floatfix,letterpaper,amssymb,superscriptaddress]{revtex4-1}
%\documentclass[aps,prl,preprint,floatfix,letterpaper,amsmath,amssymb]{revtex4-1}
%\usepackage{amsmath}
%\usepackage{color}
%\pagenumbering{gobble}\pagenumbering{arabic}
%\usepackage[in,empty]{fullpage}
%\usepackage[in,plain]{fullpage}%
\usepackage[top=2.5cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage{enumitem}
%\usepackage{helvet}
%\renewcommand{\familydefault}{\sfdefault}
\usepackage{color}
%\usepackage{sectsty}
\newcommand{\vladtext}[1]{\textcolor{blue}{#1}}
% Define a new counter for exercises
\newcounter{exercise}
% Reset the exercise counter to start from 1 (optional if you want to be sure)
\setcounter{exercise}{1}
\begin{document}
\section*{Homework 1, part 1/2}
\noindent \textcolor{red}{Version as of Oct 6, 2024, a few typos and errors fixed}\\
\noindent Due date for entire HW1 is Oct 20. Either paper or electronic submission is fine.\\
\noindent Each exercise is worth 1 point. \textcolor{magenta}{Extra point for each reported error!} -- please use forum.\\
\noindent Total score for this part is \#points/\#total, so the maximum is 1 (more with extra credit)\\
\noindent We encourage you to use QuTiP in Python to do some of these exercises, at least to verify your answers or just to explore the problem without having to do the math by hands. \\
\noindent \textbf{Suggested Literature:}\\
\noindent L. Susskind Theoretical Minimum book, Ch. 2; Ch. 3\\
\noindent Kay, Laflamme, Mosca Quantum Computing book, Ch 2.1-2.5; Ch 3.1, 3.4; Ch 4.1-4.2\\
\subsection*{A. Qubit states and their representation in the Bloch sphere.}
The state of a qubit is usually parametrized using two angles, $\theta$ and $\phi$:
\begin{equation}
|\Psi\rangle = \cos\frac{\theta}{2}|0\rangle + \exp(i\phi)\sin\frac{\theta}{2}|1\rangle,
\label{Bloch}
\end{equation}
and can be represented as a point on a sphere with a unit radius. The "longitude" angle $\theta$ varies from 0 to $\pi$ and the latitude angle $\phi$ varies from 0 to $2\pi$ or from $-\pi$ to $\pi$. The angle $\theta$ is measured with respect to the direction of the $Z$-axis which goes from the "South pole" to the "North pole". The angle $\phi$ is defined in the "Equatorial plane" and measured with respect to the $X$-axis (the direction of which can be chosen arbitrary). For points $\theta =0$ we get $|\Psi\rangle =|0\rangle$ (north pole) and for $\theta =\pi$ we get $|\Psi\rangle = |1\rangle$ (south pole) irrespective of the value of $\phi$.\\
\noindent \textit{Matrix form representation.} In order to express states in the "matrix form", we define two-component column vectors\\
\noindent $|0\rangle =
\begin{pmatrix}
1\\
0\\
\end{pmatrix}
$\\
\noindent $|1\rangle =
\begin{pmatrix}
0\\
1\\
\end{pmatrix}
$
\\
\noindent The corresponding dual vectors are obtained by taking the transpose\\
\noindent $\langle 0| = (1~0)$\\
\noindent $\langle 1| = (0~1)$\\
\noindent The qubit states $|0\rangle$ and $|1\rangle$ are orthogonal, because the corresponding vectors satisfy the orthogonality condition
$\langle 0|1\rangle =
(1~0)\cdot
\begin{pmatrix}
0\\
1
\end{pmatrix}
=1\times0 + 0\times1 =0
$
and hence they form a basis in the space of 2-component complex vectors. These two states are also normalized to a unit length, that is $\langle 0|0\rangle = \langle 1|1\rangle = 1$. The basis formed by $|0\rangle$ and $|1\rangle$ is often called ``computational basis". Curiously, even though the states $|0\rangle$ and $|1\rangle$ are orthogonal, their corresponding Bloch vectors are obviously parallel to each other (pointing in opposite directions). There is a difference between the Bloch sphere space, which kind of reflects our 3D world and the 2D complex vector space of qubit states, which is an abstraction required to formulate the rules of quantum mechanics.\\
\noindent{\textit{Irrelevance of the global phase-factor.}} We can multiply $|\Psi\rangle$ by $\exp(i\alpha)$, $\alpha$ is any real number, and this operation would not change the state. For example, $-|0\rangle$ is physically no different from $|0\rangle$ (multiplying by $\exp(i\pi)$). Or $(1/\sqrt{2})|0\rangle - (1/\sqrt{2})|1\rangle$ is the same state as $(1/\sqrt{2})|1\rangle - (1/\sqrt{2})|0\rangle$. Or $|0\rangle + i|1\rangle$ is the same state vector as $i|0\rangle - |1\rangle$. To summarize, in order to find the Bloch sphere vector from a given quantum state, we should first eliminate the global phase factor by making the probability in front of $|0\rangle$ a real number and adjust the accordingly the phase of the amplitude in from of $|1\rangle$.\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Construct $2\times 2$ matrix $\hat Z$, the eigenvectors of which are $|0\rangle$ and $|1\rangle$ and the corresponding eigenvalues are +1 and -1. That is $\hat Z |0\rangle = +1|0\rangle$ and $\hat Z |1\rangle = -1|1\rangle$.\\
\noindent Hint: calculate the "matrix elements" $\langle 0|\hat Z|0\rangle$, $\langle 0|\hat Z|1\rangle$, ... \\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Find the matrix for a linear operator $\hat X$ which turns $|0\rangle$ into $|1\rangle$ and $|1\rangle$ into $|0\rangle$. It's also a quantum NOT-gate.\\
\\
\\
\\
\noindent Since states $|0\rangle$ and $|1\rangle$ form a basis, any other qubit state can be represented as their superposition, as defined in Eq.~(\ref{Bloch}). For example two other common states are:
\noindent $|+\rangle = \frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle$\\
\noindent $|-\rangle = \frac{1}{\sqrt{2}}|0\rangle - \frac{1}{\sqrt{2}}|1\rangle$\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Mark the states $|+\rangle$ and $|-\rangle$ together with states $|0\rangle$ and $|1\rangle$ on the Bloch sphere. Note, the superposition of "up" (the ket $|0\rangle$) and "down" (the ket $|1\rangle$) points sideways!\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Show that states $|+\rangle$ and $|-\rangle$ also form a basis. Basis means any other state can be expressed as a linear superposition of the basis states. What would be states $|0\rangle$ and $|1\rangle$ in this new basis? \\
\\
\\
\\
%\noindent Let us remind that multiplying a vector $|\Psi\rangle$ by a complex number $\exp(i\delta)$ (where $\delta$ is some "phase") does not change the state in any way. If $|\Psi\rangle$ is an eigenvector of some matrix with eigenvalue $\lambda$, the same is true for $\exp(i\delta)\times |\Psi\rangle$. Likewise, if $|\Psi\rangle$ is orthogonal to some vector, same is true for $\exp(i\delta)\times |\Psi\rangle$. The meaning of such insignificance of the overall phase factor on the qubit state (also known as ``gauge invariance") will become more clear when we consider the measurement rules. But for now keep in mind that, for example, $|+\rangle$ and $|-\rangle$ are different (orthogonal!) vectors, $|-\rangle$ and $-|-\rangle$ are the same thing. It's best to see this using their Bloch sphere representation, which has no way of showing that overall phase factor.\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Find the matrix for a linear operator $\hat X$ (in the computational basis), the eigenvectors of which are $|+\rangle$ and $|-\rangle$ and eigenvalues are $+1$ and $-1$, respectively.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Find out states $\hat{X}|0\rangle$, $\hat{X}|1\rangle$, $\hat Z |+\rangle$, and $\hat Z |-\rangle$. \\
\\
\\
\\
We can convert from the computational basis $|0\rangle$, $|1\rangle$ to the basis $|+\rangle$, $|-\rangle$ AND back using the Hadamard operator, defined by the matrix $\hat H =\frac{1}{\sqrt{2}}
\begin{pmatrix}
1 & 1\\
1 & -1\\
\end{pmatrix}
$ (in the computational basis). One can equivalently write $\hat H = \hat Z/\sqrt{2} + \hat X/\sqrt{2}$. \\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Apply $\hat{H}$ to states $|0\rangle$, $|1\rangle$, $|+\rangle$, $|-\rangle$. Check that $\hat H^2 = \hat I$\\
\\
\\
\\
\\
There is yet another commonly used basis, this time (finally!) involving complex numbers:\\
\noindent $|+i\rangle = \frac{1}{\sqrt{2}}|0\rangle + \frac{i}{\sqrt{2}}|1\rangle$\\
\noindent $|-i\rangle = \frac{1}{\sqrt{2}}|0\rangle - \frac{i}{\sqrt{2}}|1\rangle$\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Mark the states $|+i\rangle$, $|-i\rangle$ on the Bloch sphere with respect to the states $|0\rangle$, $|1\rangle$, $|+\rangle$, $|-\rangle$.\\
\\
\\
\\
\noindent We remind that a dual vector $\langle \Psi| = |\Psi\rangle^{\dagger}$ is created by transposing a column into a row AND complex-conjugating every entry. That is $
\begin{pmatrix}
1\\
i\\
\end{pmatrix}^{\dagger} =
\begin{pmatrix}
1 & -i
\end{pmatrix}
$.
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Write down the following vectors (as columns and rows), $|+i\rangle$, $\langle + i|$, $|-i\rangle$, $\langle -i|$.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Find the matrix for a linear operator $\hat Y$, the eigenvalues of which are $+1$ and $-1$, and the corresponding eigenvectors are $|+i\rangle$ and $|-i\rangle$. \\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Show that the pair of states $|+i\rangle$ and $|-i\rangle$ form a basis in the vector space of states of our qubit.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Find the matrix (in the computational basis) for an analog of the Hadamard operator, which would convert basis states $|+i\rangle$ and $|-i\rangle$ into $|0\rangle$ and $|1\rangle$ and back. Hint: as always, apply the operator to two basis states and use the result to compute the four matrix elements. \\
\textcolor{magenta}{N.B. the operator to go one way must be the conjugate of the operator to go the other way, but the two are not always equal.}
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Same question as above but this time let's convert between the basis $|+\rangle$, $|-\rangle$ into $|+i\rangle$, $|-i\rangle$\\
\\
\\
\\
\noindent You now know the three pairs of most common qubit basis states, which are the eigenstates (eigenvectors) of the three matrices (operators) $\hat X, \hat Y, \hat Z$. They are called Pauli matrices (operators). We will use the terms operators and matrices interchangeably, although it's important to keep in mind that the matrix is just a representation of the operator in a given basis. Unless specified, our default basis is the computational one.
\subsection*{B. Quantum measurement rules}
As you have surely noticed, there is an infinite number of possible qubit states, given by the continuous choice of the two angles $\theta$ and $\phi$ in Eq.~(\ref{Bloch}). So where's discretness (quantumnes!) coming from? It comes from the act of measurement. \\
\noindent To formulate the rules for the measurement outcome we first must choose \text{what} is being measured. In quantum mechanics, this means choosing an operator $\hat L$ representing some observable related to the qubit (no reason for choosing L over other letters). The only theoretical constraint on $\hat L$ is that it must be a hermitian operator, $\hat L^{\dagger} = \hat L$. We'll get to see why it is so a bit later.\\
\noindent\textbf{Exercise \theexercise:} \stepcounter{exercise} Consider Pauli operators $\hat X =
\begin{pmatrix}
0&1\\
1&0\\
\end{pmatrix}, \hat Y =
\begin{pmatrix}
0& -i\\
i&0\\
\end{pmatrix},
\hat Z =
\begin{pmatrix}
1&0\\
0&-1\\
\end{pmatrix}
$ (with their matrices written in the computational basis). Consider also new operators, obtained from the Pauli operators: $\hat X \pm \hat Z$, $\hat X \pm \hat Y$, $\hat X \pm i\hat Y$. Which one(s) cannot represent an observable?\\
\\
\\
\\
\noindent \textbf{Rules of quantum measurement.} Let's imagine a qubit in an arbitrary state $|\Psi\rangle$ and a measurement apparatus (a device) which somehow reads the value of a qubit observable defined by a hermitian operator $\hat L$. Building such a device is a problem for quantum engineers, and we will touch on this topic later in the course. For now let's just assume that we have an instrument that can measure any hermitian operator $\hat L$. Let's also denote eigenstates and eigenvalues of $\hat L$ as $|\psi_j\rangle$ and $\lambda_j$ ($j =0,1$). The reading on the instrument will be either $\lambda_1$ or $\lambda_2$, at random, and nothing else! The probability of getting $\lambda_j$ is given by $|\langle \psi_j|\Psi\rangle|^2$. Furthermore, immediately after the measurement, the qubit state instantly changes (collapses) from $|\Psi\rangle$ to $|\psi_j\rangle$. How weird are these rules? At least they are concise.\\
\noindent Consider a specific example of the measurement operator $\hat Z$, the eigenstates of which are $|0\rangle$ and $|1\rangle$ (our computational basis) and the eigenvalues are $+1$ and $-1$, respectively. The qubit is prepared in state $|\Psi\rangle$ given by Eq.~\ref{Bloch}. There are two options for the measurement outcome: i) with a probability $\cos^2(\theta/2)$ the reading shows $+1$ and the qubit is prepared (initialized) in state $|0\rangle$ and ii) with a probability $\sin^2(\theta/2)$ the reading is $-1$ and the qubit is prepared in state $|1\rangle$.\\
\noindent Repeating the measurement second time on the same just measured qubit would give the same result as the first one. The randomness is gone! That's because if the first measurement collapses the qubit state into $|0\rangle$, the second measurement must yield $+1$ reading with probability 1 and the qubit state $|0\rangle$ remains unchanged. Likewise, if the first measurement already collapsed the qubit to state $|1\rangle$, the second one will output $-1$ with probability 1. Randomness happens only during the very first measurement. The observer might even miss this randomness in the first measurement outcome unless someone provides a second qubit prepared in exactly the same initial state $|\Psi\rangle$. In this case the observer can notice that the outcome of the first measurement of the first qubit does not necessarily match with that of the first measurement of the second qubit. By getting $N\gg1$ copies of the qubit in state $|\Psi\rangle$, one can measure the frequency of measurement outcomes $+1$ and $-1$ and evaluate the probabilities $\cos^2(\theta/2)$ and $\sin^2 (\theta/2)$.\\
\noindent What's the meaning of measuring $\hat Z$ operator for a qubit? Imagine a qubit as some kind of an arrow with a unit length in the real space. We call such a quantum arrow a "spin-1/2 system" or just "spin". Measuring the $\hat Z$-operator is asking for the value of the projection of the arrow onto $Z$-axis. Measuring a classical arrow would give a continuum of projection values, from $+1$ to $-1$. But in the quantum case the Z-projection can only take discrete values $+1$ or $-1$. It cannot be zero! Before we make the measurement, not only we don't know what's the $Z$-projection of the arrow, the arrow itself does not know it. Each time the measurement of the $Z$-projection of our qubit (or spin) gives us the value of $+1$ we know the qubit is now prepared in state $|0\rangle$ (spin is pointing along the Z axis) and each time the measurement value is $-1$ we know the qubit is now prepared in state $|1\rangle$ (the spin is pointing against the Z-axis). We often say \textbf{"measure the qubit along the Z-axis"} or \textbf{"measure the Z-projection"} or \textbf{"measure the qubit in the computational basis"}, which are all equivalent to \textbf{choosing the measurement operator to be $\hat Z$} and applying the \textbf{rules of quantum measurement} formulated above. \\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Consider many copies of a qubit prepared in state $|+\rangle$. We measure $\hat Z$ for each qubit. What would be the mean value of the outcome? Same question for state $|-\rangle$.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Consider the same experiment as in the exercise above but the qubit state is now a general qubit state $|\Psi\rangle$ given by Eq.~(\ref{Bloch}). Plot the mean value of the measurement outcome as a function of $\theta$. Is the answer somewhat consistent with the interpretation of our qubit as a classical arrow oriented at an angle $\theta$ with respect to $Z$-axis?\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Show that the average measurement value for the Z-projection in the previous exercise can be compactly written as $\langle \Psi|\hat Z|\Psi\rangle$. Hint: just multiply the three matrices and check the answer.\\
\\
\\
\\
\noindent Now let's consider measurements of other observables of our qubit. We can perform a measurement of $\hat Z$ and check that the reading is $+1$, in which case the qubit is guaranteed to be in state $|1\rangle$. What would we get if, following the initialization by measurement to state $|1\rangle$, we now measure operator $\hat X$? In the spin analogy, this is measuring the spin's $X$-projection. Following the quantum measurement rules, we recall that the eigenstates of $\hat X$ are $|+\rangle$ and $|-\rangle$ and the eigenvalues are $+1$ and $-1$, respectively. Therefore, the reading on the measurement device would be $+1$ with probability $|\langle +|1\rangle|^2 = 1/2$ and $-1$ with probability $|\langle -|1\rangle|^2 = 1/2$. The mean value of the reading would be $|\langle +|1\rangle|^2 \times (+1) + |\langle +|1\rangle|^2\times (-1) = \langle 1|\hat X|1\rangle =0$. \\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Plot $\langle \Psi|X|\Psi\rangle$ as a function of the angles $\theta$ and $\phi$. Compare it to the previously calculated $\langle \Psi|Z|\Psi\rangle$. Do both quantities behave as $X$- and $Z$-projection of a classical arrow with a unit length?\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Consider a qubit in state $|0\rangle$ and a measurement of $\hat Z$ and $\hat X$. We know that if we repeat each measurement many times (each time with a fresh qubit initialized to state $|0\rangle$), the mean value for $\hat Z$ would be +1 and the mean value for $\hat X$ would be 0, that is $\langle 0|\hat Z|\rangle = +1$, and $\langle 0|\hat X|0\rangle$ =0. Let's calculate the variance of the measurement outcome, that is $\langle 0|\hat Z^2|0\rangle -(\langle 0|\hat Z|0\rangle)^2$ and $\langle 0|\hat X^2|0\rangle$. Variance is a measure of the degree of randomness. Deterministic variables have zero variance.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Suppose we have a qubit in state $|+\rangle$ and measure operator $\hat Y$ (measure the spin's Y-projection). What reading would we get after one measurement, and what would be the mean value of the readings after many measurements (each time starting with a fresh qubit in state $|+\rangle$)?\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Is it too much to ask to measure $\hat X$ and $\hat Z$ at the same time, that is to learn both the Z-projection and the X-projection of our quantum arrow? Let's find out. Suppose you have a qubit prepared in state $|0\rangle$. Do a sequence of measurements $\hat Z$, $\hat Z$, $\hat Z$, ... You would get 1,1,1, etc. Now let's take a fresh qubit in state $|0\rangle$ and do a different measurement sequence $\hat X$, $\hat X$, $\hat X$. You will get either $1, 1, 1, ...$ or $-1, -1, -1, ...$ each sequence having a probability 50\%. What do we get if instead we alternate the measurements $\hat Z$, $\hat X$, $\hat Z$, $\hat X$, etc? Hint: a true random bit string generator!\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Now let's ask the same question about the mean values of the projections $\hat X$ and $\hat Z$. Let's take a qubit in the state $|\Psi\rangle$ given by Eq.~\ref{Bloch}. This time we change the measurement protocol. We take a fresh qubit in state $|\Psi\rangle$ each time we measure something. We first measure $\hat Z$, next time we measure $\hat X$, next time $\hat Z$, then $\hat X$, etc.. The average value of all $\hat X$ readings would be $\langle \Psi|\hat X|\Psi\rangle$ and the average value of all $\hat Z$ would be $\langle \Psi|\hat Z|\Psi\rangle$. Compare to averaging the outcome in the experimental protocol of the previous exercise.\\
\subsection*{C. Unitary and Hermitian operators}
\noindent In quantum mechanics we usually deal with two types of operators: Hermitian and Unitary. A Hermitian operator $\hat H$ satisfies $\hat H = \hat H^{\dagger}$. A unitary operator $U$ satisfies $\hat U^{\dagger}\hat U = \hat I$ (which is equivalent to $U^{-1} = U^{\dagger}$).\\
\noindent Eigenvalues of a hermitian operator are real numbers and eigenvectors are orthogonal and form a basis in the vector space in which the operator acts. This is just a linear algebra fact that can be proved with a few lines of math. This is why physical observables (the stuff that can be measured) must be represented by hermitian operators. The act of measurement instantaneously collapses the state of a quantum system into one of the eigenstates of the operator being measured. Any qubit state can be represented by a superposition of all possible measurement outcome states, which makes sense. The story with unitaty operators is that they preserve the vector's length, and more generally, they preserve the inner product of any two vectors. Unitary operators describe the evolution of the state of a quantum system while it is not being measured.\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Check that any unitary operator $\hat U$ applied to a state $|\Psi\rangle$ in Eq.~\ref{Bloch} creates a state $|\Psi'\rangle = \alpha_0|0\rangle + \alpha_1|1\rangle$ where $\alpha_0\alpha_0^* + \alpha_1\alpha_1^* = 1$ (and hence the new state can also be represented as a vector in a Bloch sphere).\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Check that the Pauli operators $\hat X$, $\hat Y$, $\hat Z$ are both hermitian and unitary. Hence they can serve to represent physical observables (the projections of the spin onto the three orthogonal axis). And they can also serve as evolution operators. This is an interesting coincidence. Illustrate both properties of $\hat X$, $\hat Y$, and $\hat Z$ using vectors $|0\rangle$, $|1\rangle$, $|+\rangle$, $|-\rangle$, $|+i\rangle$, $|-i\rangle$.\\
\\
\\
\\
\noindent Let's capitalize a bit on the Dirac notations. Because eigenvectors of any Hermitian operator $\hat H$ form a basis, we can write down this operator using its eigenvalues $h_i$ and the "outer product" of the eigenvectors $|h_i\rangle$. Here $i = 0, 1$ for a qubit.\\
\noindent $\hat H |h_i\rangle = h_i |h_i\rangle$,\\
\noindent $\hat H = \sum_{\text{all eigenstates}} h_i|h_i\rangle\langle h_i|$\\
\\
It's also useful to note a special case of this relation when $\hat H = \hat I$ (identity), in which case the eigenvector decomposition is called ``completeness relation:\\
\\
\noindent $\hat I = \sum_{\text{all eigenstates}} |h_i\rangle\langle h_i|$\\
\noindent We can use the above relations to find the matrices for the Pauli operators in the computational basis $|0\rangle =
\begin{pmatrix}
1\\
0\\
\end{pmatrix}$ and
$|1\rangle =
\begin{pmatrix}
0\\
1\\
\end{pmatrix}$.
Indeed, $\hat Z = (+1)|0\rangle\langle 0| + (-1)|1\rangle\langle 1|) =
\begin{pmatrix}
1&0\\
0&0\\
\end{pmatrix}
-
\begin{pmatrix}
0&0\\
0&1\\
\end{pmatrix}
=
\begin{pmatrix}
1&0\\
0&-1\\
\end{pmatrix}$. If eigenstates of the operator are not $|0\rangle$ and $|1\rangle$ we would have two more matrix elements to work out. \\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Repeat the steps above for finding the matrix for $\hat X$-operator using its eigenvectors $|\pm\rangle$ and eigenvalues $\pm 1$.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Do the same as above but for $\hat Y$, using its eigenvectors $|\pm i\rangle$ and eigenvalues $\pm 1$.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Use the representation of a Hermitian operator above to prove that
$\hat H^n = \sum_{\text{all eigenstates}} h_i^n|h_i\rangle\langle h_i|$. \\
\\
\\
\\
\noindent Thus, to take a function $f$ of a Hermitian matrix $\hat H$, assuming the function has a convergent power series, we simply need to find it's eigenvalues $h_i$ and eigenvectors $|h_i\rangle$. So, we get a very-very useful relation which makes the matrix exponentiation a piece of cake:
\begin{equation}
f(\hat H) = \sum_i f(h_i)|h_i\rangle\langle h_i|.
\label{Operator-function}
\end{equation}
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Show that any unitary operator $\hat U$ (represented by an $N\times N$ matrix) can be written as $\hat U = \exp (i\alpha \hat H)$, where $\alpha$ is a real number and $\hat H$ is some hermitian operator (also represented by an $N\times N$) matrix.\\
\noindent Hint 1: Use Eq.~\ref{Operator-function} to find the matrix for $\hat U$ in the basis of eigenvectors of $\hat H$ (and using eigenvalues of $\hat H$).\\
Hint 2: Check that all eigenvalues $\lambda$ of any unitary operator must be such that $\lambda\lambda^* = 1$, that is $\lambda = \exp(i\alpha)$, where $\alpha$ is some real number.\\
\subsection*{D. Rotating the qubit state on the Bloch sphere}
\noindent We have seen that operator $\hat Z$ is hermitian (and unitary), so operator $\exp (-i\alpha\hat Z/2)$ must also be a unitary (the factor $1/2$ is there for some convenience later). What does this unitary do to the qubit state?\\
\noindent Using matrix exponentiation, we can show that $\exp (-i\alpha\hat Z/2) = \hat I \cos\alpha/2-i\hat Z\sin\alpha/2 =
\begin{pmatrix}
\exp(-i\alpha/2)&0\\
0&\exp(i\alpha/2)\\
\end{pmatrix}
=\exp(-i\alpha/2)
\begin{pmatrix}
1&0\\
0&\exp(i\alpha)\\
\end{pmatrix}
$.
Applying this matrix to the state $|\Psi\rangle$ in Eq.~\ref{Bloch} we get $\exp(-i\alpha\hat Z/2)|\Psi\rangle = \exp(-i\alpha/2)\big(\cos\theta/2|0\rangle + \sin\theta/2 \exp (i\phi +i \alpha)|1\rangle\big)$. So, operator $\exp (-i\alpha/2\hat Z)$ rotates the qubit state in the $XY$-plane by an angle $\alpha$. \\
\noindent A much better trick to find out what a given operator does is to apply this operator to a pair of basis states. In case of $\hat Z$-related operator, the easiest basis pair is $|0\rangle$ and $|1\rangle$:\\
\\
\noindent $\exp (-i\alpha/2\hat Z)|0\rangle = \exp(-i\alpha/2)|0\rangle$\\
$\exp (-i\alpha/2\hat Z)|1\rangle = \exp(+i\alpha/2)|1\rangle$ \\
\\
Since only the phase difference between $|0\rangle$ and $|1\rangle$ matters, the effect of the operator is equivalent to doing nothing to $|0\rangle$ and multiplying $|1\rangle$ by $\exp(i\alpha)$.\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Show that $\exp(-i\alpha\hat X/2)$ is a rotation of the Bloch vector by an angle $\alpha$ around X-axis.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Show that $\exp(-i\alpha\hat Y/2)$ is a rotation of the Bloch vector by an angle $\alpha$ around Y-axis.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Show that a general qubit state $|\Psi\rangle$ given by Eq.~\ref{Bloch} can be obtain by first rotating $|0\rangle$ by angle $\theta$ around Y axis and then rotating by angle $\phi$ around Z-axis: $|\Psi\rangle = \exp(-i\phi \hat Z/2) \exp(-i\theta \hat Y/2)|0\rangle$.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Is the order of rotations important in the previous exercise? \\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Now let's try a slightly more complicated rotation. Clearly, $\hat M = (\hat X + \hat Z)/\sqrt{2}$ is a hermitian operator, so we can define a rotation $\exp (-i\alpha \hat M/2)$. Figure out what it does.\\
\noindent Hint: one way to approach this exercise is to figure out eigenvectors of $\hat M$ and find the matrix exponent this way.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Based on the previous two exercises, is it true that $\exp(-i\alpha(\hat X + \hat Z)) = \exp(-i\alpha \hat X)\times \exp(-i\alpha \hat Z)$?\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Consider another unitary operator $\exp(-i\alpha \hat M/2)$, where $\hat M = (\hat X + \hat Y)/\sqrt{2}$? What kind of rotation on the Bloch sphere is it?\\
\\
\\
\\
\subsection*{E. Qubit state tomography}
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Suppose we have a qubit in a general state $|\Psi\rangle$ given by Eq.~(\ref{Bloch}) and we want to measure the parameters $\theta$ and $\phi$. How might we do this? Clearly, if we only have one copy of such a qubit we would only get 1's or -1's no matter which projection we measure. However, if we have many copies, we can measure mean values of $\langle \Psi|\hat X|\Psi\rangle$ and $\langle \Psi|\hat Z|\Psi\rangle$. Write down the values of $\theta$ and $\phi$ in terms of those mean values.\\
\\
\\
\\
\noindent \textbf{Exercise \theexercise:} \stepcounter{exercise} Suppose now that we only have an instrument to measure $\hat Z$ and not $\hat X$. Can we still reconstruct the qubit state? All we need to do is to find a rotation which would turn $|+\rangle$ into $|0\rangle$ and $|-\rangle$ into $|1\rangle$. If we do this rotation right before the act of measurement of $\hat Z$, the getting $|0\rangle$ means \textit{before} the rotation we were $|+\rangle$ and getting $|1\rangle$ means before the rotation we were $|-\rangle$. So, a proper rotation followed by $\hat Z$ measurement is equivalent to $\hat X$ measurement. Come up with a specific protocol for measuring $\langle \Psi|\hat X|\Psi \rangle$ using an instrument that can only measures $\hat Z$.
\end{document}