# Trace of a commutator is zero - but what about the commutator of $x$ and $p$?

Operators can be cyclically interchanged inside a trace:
$${\rm Tr} (AB)~=~{\rm Tr} (BA).$$

This means the trace of a commutator of any two operators is zero:
$${\rm Tr} ([A,B])~=~0.$$

But what about the commutator of the position and momentum operators for a quantum particle?

On the one hand: $${\rm Tr}([x,p])~=~0,$$
while on the other hand: $$[x,p]~=~i\hbar.$$

How does this work out?

• The trace of operators $A$ and $B$ has to be defined to perform this operation. You just proven that any finite dimensional Hilbertspace does not have $x$ and $p$ with $[x,p]=i\hbar$. May 22, 2011 at 12:34
• Fabian, +1, but it's the traces of $AB$ and of $BA$ that have to be defined. $x$ and $p$ both have trace zero. May 22, 2011 at 12:46
• I can't believe I've never noticed this. 8| May 22, 2011 at 13:13
• @dbrane I can't believe how many times I say I can't believe I've never noticed this! Actually, at the time, the observation was nontrivial enough for history to record that it was Hermann Weyl who first pointed this out, see [the lectures "Quantum Mechanics for Mathematicians: The Heisenberg group and the Schrodinger Representation" by Peter Woit] (math.columbia.edu/~woit/QM/heisenberg.pdf). I don't know the primary source, but Peter Woit seems to know what he's doing. Aug 29, 2013 at 7:59
• If you are interested in this stuff, I highly recommend reading this: http://arxiv.org/abs/quant-ph/9907069. I found it quite easy to read and very instructive. Feb 10, 2016 at 14:48

$x$ and $p$ do not have finite-dimensional representations. In particular, $xp$ and $px$ are not "trace-class". Loosely, this means that the traces of $xp$ and $px$ are both infinite, although it's best to take them both to be undefined. Again loosely, if you subtract $\infty-\infty$, you can certainly get $i\hbar$. But you shouldn't. Everything works out if you think of $p$ as a complex multiple of the derivative operator, for which $\frac{\partial}{\partial x}$ and $x$ act on the infinite dimensional space of polynomials in $x$.

• But in quantum mechanics we take the traces of operators on infinite-dimensional Hilbert spaces all the time (for example when computing thermal averages). How can we tell when the trace is defined and when it's not?
– Joe
May 22, 2011 at 13:22
• That is a tough question. Knowing that it's there to ask, and to look for the consequences as you look at QM, in some ways takes you to a higher level. The idea of boundedness is often used instead of "has a trace", because it is closed under multiplication. Loosely, this is the generalization to infinite dimensional spaces of the idea of "all eigenvalues are finite". In this sense, the space of bounded operators on a Hilbert space is "better behaved" than the space of trace-class operators. Try en.wikipedia.org/wiki/Hilbert_space#Operators_on_Hilbert_spaces May 22, 2011 at 13:54
• @Joe In more sophisticated treatments of thermal states the trace is not mentioned, instead an algebraic property is introduced that distinguishes thermal states from the vacuum, known as the KMS-condition. The ramifications are endless. Note that all eigenvalues are finite is a weaker requirement for an operator than that the trace, loosely the sum of all the eigenvalues, is finite. May 22, 2011 at 14:02
• @Joe: I actually wonder about the same thing. Something you see something like 'we add a factor $e^{-\beta H}$ for convergence and take the limit $\beta \rightarrow 0$', but I've never thought about what this truly means. May 22, 2011 at 23:53
• @PeterMorgan Why should you get $i\hbar$? You should get $i\hbar\,\mathrm{tr}(Id)=i\hbar\infty$. Dec 21, 2017 at 8:40

After reading @Peter Morgan's answer, and giving it some more thought, I think this is actually simpler than it seems at first.

For finite-dimensional spaces the trace of a commutator is indeed always zero. For infinite-dimensional spaces the trace is not always defined, since it takes the form of an infinite sum (for countable dimension) or an integral (for continuous dimension) which do not always converge.
When the trace is defined, it obeys the same rules as in finite dimension, specifically the trace of a commutator is zero. For operators such as $x$, $p$ and their products, the trace is simply not defined, so there is no sense in asking questions about it.
When computing thermal averages, the factor $e^{-\beta H}$ makes sure the trace converges, since the energy is always bound from below (otherwise the system is unphysical).

I'm sure the concepts mentioned by @Peter Morgan are important in this context (boundedness, KMS-condition), but I don't know anything about them, and I think the answer I just provided suffices for practical purposes.

• Well, most of QM deals with $x$ and $p$ and their functions and the products of those, and the trace is quite well defined for the crushing majority of those, filling up QM books and works. Telling somebody some traces are undefined but some are not hardly resolves the paradox. I believe Peter Morgan's answer is spot on, and not this one. Feb 6, 2016 at 23:28
• $\exp(-\beta H)$ is not automatically trace class if $H$ is bounded from below, something as simple as $H=id$ shows this. Feb 8, 2016 at 12:22
• @Joe: Could you provide some references which categorically state that the trace is ill-defined for infinite-dimensional spaces? Nov 10, 2018 at 5:34

Fleshing out @Peter Morgan's answer a bit, to the effect that $x$ and $p$ are not bounded operators, so their commutator need not be bounded. First note that $$[x^n,p] = i\hbar nx^{n-1} ~,$$ hence the operator norms of both sides satisfy $$2\| p\| ~ \|x\|^n \geq \|x^np \| + \|px^n \| \geq n \hbar \|x\|^{n-1}$$ so that, for any $n$, $$2\|x\|~\|p\|\geq n \hbar~.$$ Since $n$ can be arbitrarily large, at least one l.h.s. operator cannot be bounded, and the dimension of the underlying Hilbert space cannot be finite. Utilizing the (bounded) Weyl relations, it can actually be shown that both operators are unbounded.

Now for the magic of the paradox resolving itself:

In finite (N-dimensional) Hilbert space representations of $x$ and $p$ (Weyl's QM around a circle), the commutator does indeed vanish, as it should, but the right hand side is not quite the identity, but a finite matrix with 0s in the diagonal, so, then traceless, all right. Santhanam, T. S.; Tekumalla, A. R. (1976). "Quantum mechanics in finite dimensions". Foundations of Physics 6 (5) p. 583. doi:10.1007/BF00715110.

In this remarkably insightful paper, it is shown that, in the continuum limit, N⟶ ∞, this very matrix goes to the Dirac-δ, the infinite-dimensional identity under discussion here! Cf. Q10,11 of an Exam I've given in the past.

• How did you go from your first equation to the second? It looks like some version of the "triangle inequality" was used, but I'm only familiar with the form $||A||+||B||\ge||A+B||$ May 7, 2017 at 2:10
• There is also submultiplicativity for each term (bilinear) A and B , in your expression, now. May 7, 2017 at 10:22
• sure, but the commutator has a minus sign in it, so how does one go from $||x^n p - p x^n||=n||x||^{n-1}$ to $||x^n p|| +|| p x^n||\ge n||x||^{n-1}$? apologies for a tedious question. May 7, 2017 at 16:26
• Take your subadditivity condition and set A=CD , B=-DC, so, then, $\| CD -DC\|\leq \|CD \| +\| -DC\| \leq 2 \| C\| ~ \|D\|$. May 7, 2017 at 16:38

2.1c) Suppose that $$A,B,I$$ are $$n \times n$$ matrices, where $$n$$ is a finite positive integer. Then if: $$AB − BA = iqI$$ we have: $$\mathrm{Tr}(AB − BA) = 0$$ but: $$\mathrm{Tr}(iqI) = iqn$$ which is a contradiction.

I think that the problem stems from the action of the operator $\hat p$. Please correct me if I am mistaken.
The action of the operator $\hat p$ in the quantum space is defined as
$<x|\hat p|a>=-i \hbar \partial_x <x|a>$
if the state $|a>$ does not depend on x. In fact, if the state $|a>$ depended on $x$, like for instance $|a>=f(x)|b>$ for any scalar function $f(x)$, then clearly the equation
$<x|\hat p|a>=<x|\hat p f(x)|b>=-i \hbar \partial_x <x|f(x)|b>= -i \hbar \partial_x (f(x) <x|b>)$
would be badly defined, as it could be evaluated in another different way: $<x|\hat p|a>=<x|\hat p f(x)|b>=f(x) <x|\hat p |b>=f(x)(-i \hbar) \partial_x <x|b>$
The second evaluation comes from the fact that, in Standard Quantum Mechanics, it is postulated that any operator acts on ket vectors and not on scalars (with the exception the Time reversal operator, which is not of any use here).

The commutator relation $\left[\hat x, \hat p\right]=i\hbar$ is obtained from the action of the operator $\hat p$ as defined above. Thus, it comes straightforwardly that such a commutation relation cannot be generally used in a scalar product ($<x|...|ket>$) if the ket state on the right depends on $x$.

Having said that, when you perform the trace of the commutator $\left[\hat x, \hat p\right]$, you are doing
$Tr\Big[\left[\hat x, \hat p\right]\Big]=\int dx <x|(\hat x\hat p-\hat p\hat x)|x>=\int dx <x|(x\hat p-\hat p x)|x>$,
where in the last step above I have just extracted the eigenvalues from the eigenstates $|x>$. In the above equation you have a scalar product where the ket on the right depends on $x$. Thus, you'll have to be careful in the evaluation and you cannot use the $xp$-commutation relations straight away. With a little care, everyone can see from the above equation that, indeed, the trace gives zero
$\int dx <x|(x\hat p-\hat p x)|x>=\int dx \,x<x|(\hat p-\hat p )|x>=0$,
as it should.
Whereas, if you had used the $xp$-commutation relations from the outset, you would have wrongly found
$Tr\Big[\left[\hat x, \hat p\right]\Big]=Tr\Big[i\hbar\Big]=i\hbar$.

Edited after Joe's Comment
In the last equation I forgot the dimensionality of the space. It must be modified as $Tr\Big[\left[\hat x, \hat p\right]\Big]=Tr\Big[i\hbar\Big]=i\hbar\,D$
where $D$ are the dimensions of the quantum space you are taking the trace in. Thanks Joe.

• In the last line: when you evaluate ${\rm Tr}(i\hbar)$ you get an integral that doesn't converge, therefore the trace is not defined, or you can say the trace is infinite if you'd like, anyway it does not equal $i\hbar$. Secondly, you supposedly show that ${\rm Tr}([\hat{x},\hat{p}])=0$, but if you repeat the calculation without integrating, you get that $\langle x|[\hat{x},\hat{p}]|x\rangle =0$, which is obviously wrong. Your mistake here is that you forgot to take the derivative of $x$ in the expression $\hat{p}x$ (this is how you prove $[\hat{x},\hat{p}]=i\hbar$ in the first place).
– Joe
Jan 23, 2013 at 10:48
• I edited the misprint in the last line, thanks for pointing it out. As for your second comment, I keep my position. Thanks for sharing your thoughts. Jan 25, 2013 at 13:41