# Writing a given unitary in the same basis as the Hamiltonian (Operator Representation and Confusion)

I have a simple question concerning how to write the representation of operators, such as unitaries, using a specific order for the basis elements. Let me give you an example.

Consider a tripartite system (composed of qubits) with the Hamiltonian $$H = |1\rangle \!\langle 1 |$$. The total Hamiltonian, which is additive, is represented as $$H_{\textrm{tot}} = H\otimes I\otimes I + I\otimes H \otimes I + I\otimes I \otimes H.$$ Without loss of generality, we can assume that the energies are arranged in ascending order, leading to:

$$H_{\textrm{tot}}= \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 2 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 2 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 2 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 3 \\ \end{bmatrix}.$$

This matrix is represented using the convention that the sum of each element of the basis $$|ijk \rangle := |i\rangle \otimes |j\rangle \otimes |k\rangle$$ determines the energy in the block. For instance, block 1, $$|000\rangle$$, has an energy of $$0+0+0 = 0$$. Block 2 has an energy of 1, so the basis for this block comprises permutations of $$|100\rangle$$, and so on.

My question is: Assume that I want to construct a unitary operator that commutes with $$H_{\textrm{tot}}$$ whose action is given by:

\begin{align} U|001\rangle = |010\rangle, \\ U|010\rangle = |001\rangle, \\ U|101\rangle = |110\rangle, \\ U|110\rangle = |011\rangle, \\ U|011\rangle = |101\rangle. \end{align}

As before, I would construct such a unitary (which is block-diagonal) using the same basis elements that I used for the Hamiltonian. However, here's where I'm puzzled: both blocks with energies 1 and 2 have at least three different possible orderings. Which should I choose? For instance, using the convention: $$(|000\rangle, |001\rangle, |010\rangle, |100\rangle, |011\rangle, |101\rangle, |110\rangle, |111\rangle)$$ I don't obtain the expected representation, which confuses me. I believe I have freedom to choose, but something is going wrong.

For example, I'm getting the following representation for $$U$$ (which is not correct according to what I should obtain):

$$U = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{bmatrix}$$

• What are you expecting to obtain? What exactly is wrong? Are you sure the "correct" answer is using exactly the same convention as you? Oct 10, 2023 at 9:38
• Hi @BySymmetry, what would be the convention to write such a matrix? This is my question. I know it's not correct because I know the reduced states after the action of this unitary and the one I wrote doesn't take me to what I expect. Oct 10, 2023 at 13:41
• You can use any order that you want for the basis, as long as you're consistently using the same ordering when constructing the matrices. There might be a standard in your particular (sub-)field, and there might be convenient choices sometimes that make computations easier (the quantum Fourier transform in Dirac notation somewhat comes to mind), but in the end, it doesn't matter. You'll get the same physical results in the end. Oct 10, 2023 at 15:37
• "I don't obtain the expected representation": that means that wherever you get the "expected representation" from, they ordered the basis differently. Oct 10, 2023 at 15:38

Short answer: You can choose any representation you want, and the one you chose is correct, as is the way you represented such a unitary matrix. Quantum mechanics doesn't prescribe a "correct" representation for states or operators, just as long as the representation is consistent.

Not so short answer: Typically, when using the Kronecker product (in languages such as Mathematica), it is standard to order the basis elements $$|i,j,k\rangle$$ in lexicographic order. For example, for three qubits, we would order the basis elements as:

$$|0,0,0\rangle, |0,0,1\rangle,|0,1,0\rangle, |0,1,1\rangle, |1,0,0\rangle, |1,0,1\rangle, |1,1,0\rangle, |1,1,1\rangle .$$

As a result, when representing the unitary transformation you provided as an example, we obtain the following matrix:

$$U=\begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{pmatrix}.$$

This is equivalent to yours, as they are connected via a permutation matrix.

• Ok, I understood! This was precisely what I was missing. When representing this matrix on Mathematica, I was getting a different representation. Oct 13, 2023 at 9:13