# 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$. – Fabian May 22 '11 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. – Peter Morgan May 22 '11 at 12:46
• I can't believe I've never noticed this. 8| – dbrane May 22 '11 at 13:13
• @dbrane -- Just what I was thinking! – Ted Bunn May 22 '11 at 14:02
• @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. – WetSavannaAnimal Aug 29 '13 at 7:59

$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 '11 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 – Peter Morgan May 22 '11 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. – Peter Morgan May 22 '11 at 14:02
• @Joe: Great question. Please ask it on this site as a question. – wnoise May 22 '11 at 19: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. – Gerben May 22 '11 at 23:53

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. – Cosmas Zachos Feb 6 '16 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. – s.harp Feb 8 '16 at 12:22
• @Joe: Could you provide some references which categorically state that the trace is ill-defined for infinite-dimensional spaces? – Girish Nov 10 '18 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||$ – user143410 May 7 '17 at 2:10
• There is also submultiplicativity for each term (bilinear) A and B , in your expression, now. – Cosmas Zachos May 7 '17 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. – user143410 May 7 '17 at 16:26
• Take your subadditivity condition and set A=CD , B=-DC, so, then, $\| CD -DC\|\leq \|CD \| +\| -DC\| \leq 2 \| C\| ~ \|D\|$. – Cosmas Zachos May 7 '17 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.

New contributor
MaxD is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

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 '13 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. – Wizzerad Jan 25 '13 at 13:41

Whenever something goes tricky, do not always rely on "infinite, undefined, etc" to get over contradictions easily. Whatever you have been told may not be correct forever. So go brave, you may discover something new or find a better explanation. I don't have a good answer here. But what I think is this way.

If the $\infty_1-\infty_2$ is giving you an $i\hbar$, then the Tr{$\infty_1$}-Tr{$\infty_2$} should also give you something consistent. But unfortunately it doesn't in this case. Then I start to wonder whether all linear operators have well-defined matrix form. Which may not be neccesarily true. Suppose they have at least Hilbert space matrix form, infinite dimensional matrices may have some differences in algebraic operations from finite dimensional matrices. But the trace operator is only well-defined on finite dimensional matrices. Does it or should it behave the same way over infinite dimensional matrices?

If the original definition of some concept is missing in the bigger space, you may consider extend its definition to try to fit everything nicely!-:)

• I don't understand what you're trying to say. The original definition of the trace is not missing in infinite dimensional spaces. It is defined as an infinite sum or integral, but only when the sum or integral converges. – Joe Jul 5 '11 at 6:07