Quantum Computing, Quantum Physics, Programming, Physics, Science.
else: out = np.kron(out, np.eye(2)) return out # Hamiltonian is calculated from the Pauli decomposition decomp = {"XZY": 2, "ZXX": 5, "YXZ": 2} H = np.zeros((2 ** 3, 2 ** 3)) H = H.astype('complex128') for pauli in decomp: H += decomp[pauli] * get_pauli(pauli) # Hamiltonian is exponentiated and we