Consider the single-qubit Hamiltonian
The commutator
Let's write a function to compute the error
Complete the code for trotter_XandZ
below to Trotterize evolution with the Hamiltonian exact_result_XandZ
is provided for you. Submitting will generate a plot of the error trotter_error_XandZ
against the number of steps on a log-log scale for two different choices of
Note that the error
or, in the logarithmic scale,
To interact with codercises, please switch to a larger screen size.
Learning Objectives: