# Impact of ordering Hamiltonian terms for Trotterization

In Trotterization, the typical Hamiltonian considered is:

$$H = \sum_{p, q} h_{pq} a^{\dagger}_p a_q + \sum_{p, q, r, s} a^{\dagger}_p a^{\dagger}_q a_r a_s$$

Which is then converted into a sequence of gates by the Jordan Wigner transformation.

However, how do we choose the ordering of the $$pq$$ and $$pqrs$$ terms? For example, if our Hamiltonian was:

$$H = (a^{\dagger}_1 a_2 + a^{\dagger}_2 a_1) + (a^{\dagger}_2 a_3 + a^{\dagger}_3 a_2) + (a^{\dagger}_1 a^{\dagger}_2 a_2 a_3 + a^{\dagger}_3 a^{\dagger}_2 a_2 a_1)$$

There are at least $$3! = 6$$ ways to order the Hamiltonian, a number which quickly explodes as the size of the Hamiltonian grows.

Note that the terms don't have clean commutation rules - sometimes the terms will commute or anticommute. Is there an approach to ordering the Hamiltonian that maximizes simulation accuracy?

• @gIS you are correct; unfortunately, Trotterization exponentiates the matrices, which incurs errors because $e^{A + B} \neq e^A e^B$ when $A, B$ don't commute Sep 1 '20 at 23:59
• @Aman somewhat off topic, but I personally like Microsoft's docs Sep 1 '20 at 23:59
• Your Hamiltonian needs to be Hermitian, which your example is currently not. Sep 2 '20 at 6:51
• @DaftWullie good point, let me revise the question to have it. I should note that I'm using molecular Hamiltonians, which are Hermitian in nature Sep 2 '20 at 14:46
• Am I right in thinking that when you use Jordan Wigner, your particular example translates to a triangle with $XX+YY$ couplings between each pair of qubits? In which case, symmetry would suggest that ordering shouldn't make a difference. Sep 2 '20 at 14:58