We present an exact simulation of a one-dimensional transverse Ising spin chain with a quantum computer. We construct an efficient quantum circuit that diagonalizes the Ising Hamiltonian and allows to obtain all eigenstates of the model by just preparing the computational basis states. With an explicit example of that circuit for $n=4$ spins, we compute the expected value of the ground state transverse magnetization, the time evolution simulation and provide a method to also simulate thermal evolution. All circuits are run in IBM and Rigetti quantum devices to test and compare them qualitatively.
The code used to obtain the results in IBM quantum devices was awarded with the “Teach Me QISKit” award.