1

I define a time-dependent operator in the form of an Qobjevo and pass it to sesolve() to solve for Schrodinger's equation. Below is an MWE.

from qutip import *
import numpy as np

tlist = np.linspace(0, np.pi / 2)
H = [
    sigmaz(),
    [sigmax(), 'cos(t)']
]
psi0 = basis(2, 1)
result = sesolve(H, psi0, tlist)

Now I want to check the time-dependent Hamiltonian at given times in tlist. How do I get a list of Hamiltonians, each at time tlist[i]? Which qutip function can I refer to?

Neo
  • 1,031
  • 2
  • 11
  • 27

1 Answers1

0

You could simply define a function returning the Hamiltonian at each time step:

def h(t):
    return sigmaz() + np.cos(t) * sigmax()
glS
  • 1,209
  • 6
  • 18
  • 45