Quantum Mechanics with Python
Author: Julie Butler
Date Created: August 22, 2024
Last Modified: Auugst 22, 2024
Perform the following calculations Python or another programming language. You may use a linear algebra library for your work. Compare your results to those calculated on the conceptual component of the homework.
Part A
Consider the following Hamiltonian (where \(\hbar\) and \(\omega\) are positive, real constants):
\[\hat{H} = \hbar\omega\begin{bmatrix} \frac{1}{2} & 0 & 0 \\ 0 & \frac{3}{2} & 0 \\ 0 & 0 & \frac{5}{2}\end{bmatrix},\]
which describes the energy of the following wavefunction:
\[|\psi\rangle = i|1\rangle + 5|2\rangle - 2i|3\rangle,\]
where \(|1\rangle\) corresponds to the eigenvector of \(\hat{H}\) with the lowest eigenvalue, \(|2\rangle\) to the eigenvector with the middle eigenvalue, and \(|3\rangle\) to the eigenvector with the highest eigenvalue.
- Is \(|\psi\rangle\) normalized? If so, prove it. If not, normalize it.
- If you measure the energy of the system, what are the possible results and with what probabilities will they occur?
- Find \(\langle \psi | \hat{H} | \psi \rangle = \langle E \rangle\).
- Show that \(|1\rangle\), \(|2\rangle\), and \(|3\rangle\) have the properties of a computational basis.
- Define an operator which could be applied to \(|\psi\rangle\). It must have the properties of an operator but it does not need to correspond to an actual operator. What are the possible observables with this new operator and with what probabilities will they occur?
Part B
Consider the operators which measure spin in the x-direction, y-direction, and z-direction:
\[S_x = \frac{\hbar}{2}\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} \quad S_y = \frac{\hbar}{2}\begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix} \quad S_z = \frac{\hbar}{2}\begin{bmatrix}1 & 0 \\ 0 & -1 \end{bmatrix}.\]
Now consider the following states, which could describe qubits of a quantum computer:
\[|\psi\rangle = \begin{bmatrix}3i\\5\end{bmatrix} \quad |\phi\rangle = \begin{bmatrix}4i\\0\end{bmatrix}\]
- Are \(|\psi\rangle\) and \(|\phi\rangle\) normalized? If yes, prove it. If not, normalize them.
- Calculate the following expectation values: \(\langle\psi|S_z|\psi\rangle\) and \(\langle\phi|S_x|\phi\rangle\).
- Calculate \(\sigma_{S_z}\) (the uncertainity on the measurement of \(S_z\)) for both \(|\psi\rangle\) and \(|\phi\rangle\). Hint: \(\langle S_z^2\rangle\) means to square \(S_z\) before calculating the expectation value.
- What is the probability of measuring \(S_y\) for \(|\psi\rangle\) and \(|\phi\rangle\) and obtaining a result of \(-\frac{\hbar}{2}\)?
- What is the probability of measuring \(S_z\) for \(|\psi\rangle\) and \(|\phi\rangle\) and obtaining a result of \(0\)?