Skip to content

dq.sesolve

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

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 (with \(\hbar=1\) and where time is implicit(1)) $$ \frac{\dd\ket{\psi}}{\dt} = -i H \ket{\psi}, $$ where \(H\) is the system's Hamiltonian.

  1. With explicit time dependence:
    • \(\ket\psi\to\ket{\psi(t)}\)
    • \(H\to H(t)\)
Defining a time-dependent Hamiltonian

If the Hamiltonian depends on time, it can be converted to a time-array using dq.pwc(), 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.

Parameters

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

    Hamiltonian.

  • 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, Kvaerno3, Kvaerno5, Euler, Expm).

  • gradient –

    Algorithm used to compute the gradient. The default is solver-dependent, refer to the documentation of the chosen solver for more details.

  • options –

    Generic options, see dq.Options.

Returns

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