Skip to content


    H: ArrayLike | TimeArray,
    psi0: ArrayLike,
    tsave: ArrayLike,
    exp_ops: list[ArrayLike] | None = None,
    solver: Solver = Tsit5(),
    gradient: Gradient | None = None,
    options: Options = Options()
) -> SEResult

Solve the Schrödinger equation.

This function computes the evolution of the state vector \(\ket{\psi(t)}\) at time \(t\), starting from an initial state \(\ket{\psi_0}\), according to the Schrödinger equation (\(\hbar=1\)) $$ \frac{\dd\ket{\psi(t)}}{\dt} = -i H(t) \ket{\psi(t)}, $$ where \(H(t)\) is the system's Hamiltonian at time \(t\).

Defining a time-dependent Hamiltonian

If the Hamiltonian depends on time, it can be converted to a time-array using dq.constant(),, dq.modulated(), or dq.timecallable(). See the Time-dependent operators tutorial for more details.

Running multiple simulations concurrently

Both the Hamiltonian H and the initial state psi0 can be batched to solve multiple Schrödinger equations concurrently. All other arguments are common to every batch. See the Batching simulations tutorial for more details.


  • H (array-like or time-array of shape (...H, n, n)) –


  • psi0 (array-like of shape (...psi0, n, 1)) –

    Initial state.

  • tsave (array-like of shape (ntsave,)) –

    Times at which the states and expectation values are saved. The equation is solved from tsave[0] to tsave[-1], or from t0 to tsave[-1] if t0 is specified in options.

  • exp_ops (list of array-like, each of shape (n, n), optional) –

    List of operators for which the expectation value is computed.

  • solver –

    Solver for the integration. Defaults to dq.solver.Tsit5 (supported: Tsit5, Dopri5, Dopri8, Euler, Propagator).

  • gradient –

    Algorithm used to compute the gradient.

  • options –

    Generic options, see dq.Options.


dq.SEResult object holding the result of the Schrödinger equation integration. Use the attributes states and expects to access saved quantities, more details in dq.SEResult.