Working in natural units (so that spins have energies +/-1), if I start with a qubit in the state |0> and apply a sigmax pulse of length pi/2, the qubit should be flipped to the |1> state. If I then apply a sigmay pulse of length pi/2, the qubit should be flipped back to the |0> state.
As a simple demonstration, I have coded this in QuTiP as follows between the hashes. My intent is to apply a sigmax pulse from t=1 to t=1+pi/2 and then to apply a sigmay pulse from t=3 to 3=3+pi/2.
##################################
In the code above, the line "# SOME PULSES HERE" is replaced with one of the following:
processor.pulses[0].coeff = [1]
processor.pulses[0].tlist = [1, 1+pi/2]
processor.pulses[1].coeff = [1]
processor.pulses[1].tlist = [3, 3+pi/2]
or
processor.pulses[0].coeff = [0, 1, 0, 0, 0]
processor.pulses[0].tlist = [0, 1, 1+pi/2, 3, 3+pi/2, 5]
processor.pulses[1].coeff = [0, 0, 0, 1, 0]
processor.pulses[1].tlist = [0, 1, 1+pi/2, 3, 3+pi/2, 5]
or
processor.pulses[0].coeff = [0, 0, 1, 1, 0, 0, 0, 0]
processor.pulses[0].tlist = [0, 0.5, 1, 1.5, 1+pi/2, 3, 3+pi/2, 3.5, 5]
processor.pulses[1].coeff = [0, 0, 0, 0, 0, 1, 1, 0]
processor.pulses[1].tlist = [0, 0.5, 1, 1.5, 1+pi/2, 3, 3.5, 3+pi/2, 5]
As I understand it, each of these should produce a unit-strength pulse of sigmax from time 1 to time 1+pi/2, and a unit-strength pulse of sigmay from time 3 to time 3+pi/2. My call of
processor.plot_pulses()
confirms that these are indeed the pulses generated in each case. However, the qubit does not behave as expected.
In the first case, the sigmax pulse flips the qubit successfully, but the sigmay pulse doesn't do anything to the qubit.
In the second case, neither pulse affects the qubit.
In the third case, the sigmax pulse affects the qubit but the sigmay pulse does not.
What is the issue here? Is there something I have misunderstood in the code?