# Basis/Projection Notation Question Quantum Mechanics

Lets say you have a inner product between two state vectors with an operator in between A|X|B. I can write this as a summation over I and j as A|i i|X|j j|B (sorry for notation). But I don't understand what j is. I get that i is the basis vectors and we are summing over these basis vectors, so does that mean that j is another basis? Going off of this, in Feynman's Quantum Book equation 8.13 he just changes an equation summing over i's to summing over j's, so I don't understand how those would be equivalent if they are different basis. Does this have to do with rows and columns (i.e. i is row number and j is column number)? Also, you can describe j|i as the dirac delta function which is only true for when i=j, but I can't really make sense of that either. Confusing stuff.

Edit: The major reason i'm confused is that I remember calling the basis vectors i,j,k so I don't understand how you can sum over i and j in these equations. I assumed that when you wrote i and summed over it you were summing i,j,k so I don't see how you can sum over i's and j's

Both $$\sum_i |i\rangle \langle i |$$ and $$\sum_j |j\rangle \langle j |$$ are summations over basis vectors. The indices $i,j$ run over the same values – values of indices that identify the basis vectors in the same basis (set of vectors) – but the particular values of the indices $i,j$ are independent.
Can you calculate how much is the expression below? $$\sum_{m=1}^2 \sum_{n=1}^2 mn$$ The result is $1+2+2+4=9=3\times 3$. If you can understand this (high school) expression, you should be able to understand the summation over $i$ and $j$ above, too.
The value of $\langle A|X|B\rangle$ that you rewrote as a sum over $i,j$ can be calculated but one can never impose any $i=j$. The sum goes over all independent values of $(i,j)$ i.e. over the pairs for $i\lt j$, $i=j$, as well as $i\gt j$.
There's no sense in which $i$ labels a row and $j$ labels a column. Instead, both $i$ and $j$ label both rows and columns. The index labels a row if it appears in the ket vector $|i\rangle$ or $|j\rangle$, and a row if it appears in the bra vector $\langle i|$ or $\langle j|$.
Also, the inner product $$\langle i| j \rangle = \delta_{ij}$$ is the Kronecker delta symbol. (Only for a continuous basis, it would be the Dirac delta function). The equation above is valid for any $i$ and any $j$. It is simply not true at all that it is only valid for $i=j$. However, both hands of the equations above are $0$ if $i\neq j$ and they are $1$ if $i=j$.