Clarifying Bra-Ket Notation: Orthonormal Bases

I was asked to find the trace of $$(A \in M_{n \times n})$$, the matrix that can be written in the form:$$A=\frac{1}{n} \sum_{r, \, q \, = \, 1}^n (-1)^{r+q}|r \rangle \langle q| \quad ,$$ where {$$|r \rangle$$} is an orthonormal basis. I know that $$(\langle r |q \rangle =\delta_{r, \, q})$$ but I don't know what truly means $$(|r \rangle \langle q|)$$! In particular, I know the completeness relation: $$I=\sum_{j=1}^{n} |e_j \rangle \langle e_j| \quad ,$$ where is again an orthonormal basis; but, I know also that not every basis has that property.. Instead, it seems the case; in fact the solution gives me: $$\text{tr}(A)=\frac{1}{n} \sum_{r \, = \, 1}^n (-1)^{r+r}|r \rangle \langle r| = 1$$ Aside the abuse of notation, I think that the right solution should be: $$\require{cancel}\text{tr}(A)=\text{tr\left(\frac{1}{n} \sum_{r \, = \, 1}^n (-1)^{r+r}|r \rangle \langle r|\right)}=\frac{1}{n} \, \text{tr\left(\sum_{r \, = \, 1}^n \cancel{(-1)^{2r}}|r \rangle \langle r|\right)} = \frac{1}{n} \, \text{tr\left(I\right)}=\frac{1}{\cancel{n}}\cdot \cancel{n}=1$$ at this point what is really unclear to me is the step: $$\left[A=\frac{1}{n} \sum_{r, \, q \, = \, 1}^n (-1)^{r+q}|r \rangle \langle q|\right] \longmapsto \left[ \text{tr}(A)= \text{tr\left(\frac{1}{n}\sum_{r \, = \, 1}^n |r \rangle \langle r|\right)} \right]$$ where the second sum has gone? (how can this step be legitimate?)

Note: I already have been able to show that such a matrix is idempotent $$(A^2 = A)$$.

• Have you checked the definition of the trace (in terms of an orthonormal basis)? You need to convince yourself (exercise) that this definition is independent of the orthonormal basis; then study your example... In any case, something like $|\psi\rangle\langle \phi|$ can be seen as an operator which maps $|\varphi\rangle \mapsto |\psi\rangle \langle \phi|\varphi\rangle$. That being said, it is unclear why you start a discussion about the resolution of the identity, at least to me... Commented Mar 20, 2023 at 17:38
• I'm sorry if i bothered you with unclear informations.. the "identity-thing" was given only because i was searching all possibly useful infos.. anyway, looking at the definition of trace you suggest (see also... physics.stackexchange.com/revisions/746318/5) i was able to solve the problem.. but not in terms of the solution the book gives me (which still seems an abuse of notation to me.. may you explain?). Moreover, i beg you to check my attempt that i will post as an answer (if you post your comment as an answer, i will accept that). Commented Mar 20, 2023 at 18:12

$$\underline{\text{Hint:}}$$ you can use the formula $$\text{tr}A=\sum_{p=1}^n\langle p|A|p\rangle$$ which essentially picks up all the diagonal elements of the operator's $$A$$ matrix form. Substituting $$A$$ (and taking into consideration that you are working with an orthonormal basis, $$\langle r|s\rangle=\delta_{rs}$$) will yield the result you have derived, which I believe is true...

• To add: You need to use an orthonormal basis. Commented Mar 20, 2023 at 18:07

The trace is a number, and the sum of the diagonal elements so take the diagonal elements $$\langle e_j\vert A\vert e_j\rangle$$ and sum over them: \begin{align} \hbox{Tr}(A)&=\sum_{j}\langle e_j\vert A\vert e_j\rangle\\ &=\sum_{j}\sum_{r,q}A_{rq}\langle e_j\vert r\rangle\langle q\vert e_j\rangle\\ &= \sum_{j}\sum_{r,q}A_{rq}\delta_{jr}\delta_{qj} \end{align} where $$\langle e_j\vert r\rangle=\delta_{jr}$$ has been used.

• I really like your solution.. which is really similiar to mine; but it seems that i can only accept one answer.. the other was an earlier one.. do you know any methods to reward also you? Commented Mar 20, 2023 at 18:18
• I suppose you could unaccept the other answer and accept mine instead if you think mine is so much better but honestly @schris38 needs the rep more than I so don't worry about it. Commented Mar 20, 2023 at 18:20
• @giuliolib The lesson here is you can afford to take a bit of time before accepting an answer. There are many really good contributors to this site but they're not always onsite so it's not uncommon to get really elegant solutions posted several hours after you have posted your questions. Commented Mar 20, 2023 at 18:32
• really thanks for your consideration.. i will make treasure of your experience and i will be more patient in future.. i'm really sorry if i bothered you in any way.. you are really a kind person. Commented Mar 20, 2023 at 18:51
• @giuliolib nah it's all good. Commented Mar 20, 2023 at 18:52

$$\require{cancel}\text{tr}(A) = \sum_{k=1}^n \langle k|A| k \rangle = \sum_{k=1}^n \frac{1}{n} \langle k \left| \sum_{r,q} (-1)^{r+q} |r \rangle \langle q | \right| |k \rangle = \frac{1}{n} \sum_{k,r,q} (-1)^{r+q} \langle k | r \rangle \langle q | k \rangle = \frac{1}{n} \sum_{k=1}^n \cancelto{1}{(-1)^{2k}}=\frac{1}{\cancel{n}} \cdot \cancel{n} = 1$$