Unitaries evolving a quantum system arise from a special operator called the Hamiltonian, which measures the system's energy. According to Schrödinger's equation, for a system with Hamiltonian , the corresponding unitary evolving it for a time is

For example, if the physical system in question is a tiny magnet in a big external magnetic field pointing in the direction, the Hamiltonian is

where is the Pauli , C is the charge of the electron, and kg its mass. We've lumped some of the constants into for convenience. The operator has eigenvalue when the magnet is aligned, and when anti-aligned, so the energy is indeed lower in the first case:

To get the unitary according to , we must exponentiate , which is simply a rotation:

Use this result to build the evolve_rotation circuit that applies the evolution operator to a qubit. This operator will depend on the magnetic field B and the time during which the evolution occurs.

or to submit your code

To interact with codercises, please switch to a larger screen size.

Learning Objectives:

  • Define a Hamiltonian and explain what it means with respect to a quantum system.
  • Compute unitary evolution for a simple, single-qubit physical system.