Operators and commutators

Roberto Di Remigio, Luca Frediani

We will be exercising our knowledge of operators and commutator algebra. These are extremely useful exercises, as you will see these type of manipulations recurring throughout the rest of the course. A note on notation:

  • an operator will be designed by putting an hat on top of any letter: \begin{equation} \hat{A},\,\hat{O},\,\hat{b},\,\hat{\gamma} \end{equation}
  • the commutator of two operators is defined as: \begin{equation} [\hat{A}, \hat{B}] = \hat{A}\hat{B} - \hat{B}\hat{A} \end{equation}
  • the position and momentum operator are defined as: \begin{equation} \hat{x}_i = x_i\cdot \quad\quad \hat{p}_i = -\mathrm{i}\hbar\frac{\partial}{\partial x_i} \end{equation} where $i$ refers to any of the three Cartesian components, i.e. $i = x, y, z$
  • the Canonical Commutation Relations (CCR) are: \begin{alignat}{3} [x_i, x_j] = 0; \quad& [p_i, p_j] = 0; \quad& [x_i, p_j] = \mathrm{i}\hbar \delta_{ij} \end{alignat} where the Kronecker $\delta$ symbol is defined as: \begin{equation} \delta_{ij} = \begin{cases} 1 & \text{if } i = j \\ 0 & \text{if } i \neq j \end{cases} \end{equation}
  • Dirac braket notation. We will interpret the following symbols as: \begin{equation} \langle \psi | \phi \rangle = \int \mathrm{d} \mathbf{r} \psi^*(\mathbf{r})\phi(\mathbf{r}) \end{equation} \begin{equation} \langle \psi | \hat{A} | \phi \rangle = \int\mathrm{d} \mathbf{r} \psi^*(\mathbf{r})\hat{A}\phi(\mathbf{r}) \end{equation}

Using SymPy

SymPy is a Python library for symbolic mathematics. It can be used to evaluate derivatives, definite and indefinite integrals, differential equations and much more. As an example, the following code will evaluate the derivative of $\exp(x^2)$ and print it to screen:

from sympy import *
x, y, z = symbols('x y z')
init_printing(use_unicode=True)
diff(exp(x**2), x)

In [16]:
from sympy import *
# Define symbols
x, y, z = symbols('x y z')
# We want results to be printed to screen
init_printing(use_unicode=True)
# Calculate the derivative with respect to x
diff(exp(x**2), x)


Out[16]:
$$2 x e^{x^{2}}$$

There is an extensive tutorial that you can refer to. Another useful example is the calculation of definite and indefinite integrals using SymPy. Consider the following code snippet:

# An indefinite integral
integrate(cos(x), x)

This will calculate the primitive function of $\cos(x)$: \begin{equation} \int \cos(x)\mathrm{d}x = \sin(x) + C \end{equation}


In [15]:
integrate(cos(x), x)


Out[15]:
$$\sin{\left (x \right )}$$

This code snippet will instead calculate the definite integral of the same function in a given interval: \begin{equation} \int_{-\pi/2}^{\pi/2} \cos(x)\mathrm{d}x =[\sin(x)]_{-\pi/2}^{\pi/2} = 2 \end{equation}

# A definite integral
integrate(cos(x), (x, -\pi/2., pi/2))

In [14]:
integrate(cos(x), (x, -pi/2., pi/2.))


Out[14]:
$$2$$

SymPy is quite powerful. It can handle expression with multiple variables and be used to simplify complicated expressions. You are encouraged to experiment with SymPy whenever needed in the following exercises.

Exercise 1: The importance of commuting

Let us have two operators $\hat{A}$ and $\hat{B}$. Further assume that their commutator is known to be: $[\hat{A}, \hat{B}] = c$, where $c$ is a scalar (a complex number in the general case). Is the following true? \begin{equation} \langle \psi| \hat{A}\hat{B} |\phi \rangle = \langle \psi| \hat{B}\hat{A} | \phi \rangle \end{equation} To convince yourself, try to calculate: \begin{equation} \langle \sin(x) |\hat{x}\hat{p}_x | \cos(x) \rangle; \quad\quad \langle \sin(x) |\hat{p}_x\hat{x} | \cos(x) \rangle \end{equation}

Exercise 2: Commutator identities

Prove the following commutator identities: \begin{align} &[\hat{A}, \hat{A}] = 0 \\ &[\hat{A}, \hat{B}] = - [\hat{B}, \hat{A}] \\ &[\hat{A}+\hat{B}, \hat{C}] = [\hat{A}, \hat{C}] + [\hat{B}, \hat{C}] \\ &[\hat{A}, \hat{B}\hat{C}] = [\hat{A}, \hat{B}]\hat{C} + \hat{B}[\hat{A},\hat{C}] \\ &[\hat{A}, [\hat{B}, \hat{C}]] + [\hat{B}, [\hat{C}, \hat{A}]] + [\hat{C}, [\hat{A}, \hat{B}]] = 0 \end{align} The last one is known as Jacobi identity.

Exercise 3: Some more commutators

Having proved the commutator identities, calculate the following commutators: \begin{align} &[\hat{p}_x, \hat{x}^2] \\ &[\hat{y}\hat{p}_z - \hat{z}\hat{p}_y, \hat{z}\hat{p}_x - \hat{x}\hat{p}_z] \\ &[\hat{a}, \hat{a}^\dagger] \end{align} where: \begin{alignat}{2} \hat{a} = \frac{\hat{x} + \mathrm{i}\hat{p}_x}{\sqrt{2}}; \quad & \quad \hat{a}^\dagger = \frac{\hat{x} - \mathrm{i}\hat{p}_x}{\sqrt{2}} \end{alignat}

Exercise 4: Normalization

In quantum mechanics, physical states are represented by mathematical objects called wavefunctions. Wavefunctions are functions of the coordinates: $\psi(\mathbf{r})$. Not all functions can aspire to become wavefunctions. As wavefunctions represent probability densities, a very important requirement they must satisfy is to be normalizable: \begin{equation} \langle \psi|\psi\rangle = \int \mathrm{d} \mathbf{r} \psi^*(\mathbf{r}) \psi(\mathbf{r}) < \infty \end{equation} i.e. the integral above must be finite. Notice that the property of normalizability depends on the domain of the function and the limits of the integration above. Are the following functions normalizable? \begin{align} \psi(x) &= e^{-\frac{x^2}{2}} \quad x\in[-\infty, +\infty] \\ \psi(x) &= e^{-x} \quad x\in[0, +\infty] \\ \psi(x) &= e^{-x} \quad x\in[-\infty, +\infty] \\ \psi(x) &= e^{\mathrm{i}x} \quad x\in[-\infty, +\infty] \\ \psi(x) &= e^{\mathrm{i}x} \quad x\in[-\pi, +\pi] \end{align}

Exercise 5: Self-adjointedness 1

For any operator on our vector space of functions, we can define its adjoint operator (also called Hermitian conjugate). Given the operator $\hat{A}$, the operator $\hat{A}^\dagger$ is its adjoint if and only if, for any pair of vectors $\psi, \phi$ the following holds true: \begin{equation} \langle \psi | \hat{A} | \phi \rangle^* = \langle \phi | \hat{A}^\dagger | \psi \rangle \end{equation} Of all the operators that can exist, a class is particularly interesting in quantum mechanics: the self-adjoint operators. An operator $\hat{A}$ is said to be self-adjoint if and only if, for any pair of vectors $\psi, \phi$ we have: \begin{equation} \langle \psi | \hat{A} | \phi \rangle^* = \langle \phi | \hat{A} | \psi \rangle \end{equation} that is to say: $\hat{A} = \hat{A}^\dagger$. Why are self-adjoint operators so important? Because they have a series of important properties that make them useful in representing physical observables, such as position, momentum, energy etc.

In this exercise, we will prove that the momentum operator is self-adjoint. To simplify the matter, we will just prove it for $\hat{p}_x$. First let's write down explicitly $\langle \psi | \hat{p}_x | \phi \rangle$: \begin{equation} \int \mathrm{d} x \psi^*(x)\left[-\mathrm{i}\hbar \frac{\partial}{\partial x} \phi(x)\right] \end{equation} We then take the complex conjugate: \begin{equation} \int \mathrm{d} x \psi(x)\left[\mathrm{i}\hbar \frac{\partial}{\partial x} \phi^*(x)\right] \end{equation} and this need to be equal to: \begin{equation} \int \mathrm{d} x \phi^*(x)\left[-\mathrm{i}\hbar \frac{\partial}{\partial x} \psi(x)\right] \end{equation} Is the operator $-\hbar\frac{\partial}{\partial x}$ self-adjoint?

Warning You can't just move $\phi^*(x)$ to the left!! The momentum operator is a derivative with respect to $x$!

Hint 1 Use integration by parts on the last expression. Remember that we are integrating on the whole set of real numbers i.e. $\int$ means $\int_{-\infty}^{+\infty}$.

Hint 2 The functions in our vector space go to zero at infinity, so that $[\psi(x)\phi^*(x)]_{-\infty}^{+\infty}= 0$

Exercise 6: Self-adjointedness 2

Now that you know the tricks of the trade, which of the following operators are self-adjoint? \begin{align} & \hat{p}_x^2 = -\hbar^2 \frac{\partial^2}{\partial x^2} \\ & \hat{l}_x = \hat{y}\hat{p}_z - \hat{z}\hat{p}_y \\ & \hat{a} = \frac{\hat{x} + \mathrm{i}\hat{p}_x}{\sqrt{2}} \\ & \hat{a}^\dagger = \frac{\hat{x} - \mathrm{i}\hat{p}_x}{\sqrt{2}} \end{align}


In [ ]: