hqs_quantum_solver.evolution#
Implementations of time-evolution functionality quantum systems.
Functions
|
Discrete time-evolution using a Krylov-based method. |
|
Discrete time-evolution using the explicit Runge-Kutta 5(4) method. |
- evolve_using_krylov(hamiltonian: SimpleOperatorProtocol, wavefunction: np.ndarray, time_step: float, tolerance: float = 1e-8, verbose: int = 0) NDArray #
Discrete time-evolution using a Krylov-based method.
Given an initial wavefunction, this function computes an approximation to the wavefunction after the system has evolved for a time \(\Delta t\), i.e., it computes an approximation to the solution of the Schrödinger at time \(t + \Delta t\), given the wavefunction at time \(t\).
This function uses a Krylov-based method, which means that it computes
\[\newcommand{\iu}{\mathrm{i}} \psi \mapsto e^{- (\iu / \hbar)\, \Delta t\, H} \psi\]in units where \(\hbar = 1\). In this equation, the exponential-times-vector expression is approximated using a Krylov method.
- Parameters:
hamiltonian (SimpleOperatorProtocol) – A Hamiltonian to evolve with.
wavefunction (np.ndarray) – The wavefunction \(\psi\) describing the initial state.
time_step (float) – The discrete time step \(\Delta t\).
tolerance (float) – the tolerance of the wavefunction.
verbose (int) – The verbosity level as given by
lattice_functions
,0 <= verbose <= 6
.
- Returns:
The evolved wavefunction
- Return type:
ndarray
- evolve_using_rk45(hamiltonian: SimpleOperatorProtocol, wavefunction: np.ndarray, time_step: float, rtol: float = 1e-3, atol: float = 1e-6) NDArray #
Discrete time-evolution using the explicit Runge-Kutta 5(4) method.
Computes an approximation to the solution of the Schrödinger equation,
\[\mathrm{i} \hbar \frac{d}{d t} \ket{\psi(t)} = H \ket{\psi(t)} \,,\]at time $t_1$, where we choose the units such that \(\hbar = 1\).
The solver keeps the local error estimate below \(\mathtt{atol}_i + \mathtt{rtol}_i \cdot | \braket{\mathbf{e}_i, \psi} |\).
- Parameters:
hamiltonian (SimpleOperatorProtocol) – The Hamiltonian \(H\).
wavefunction (ndarray) – The wavefunction \(\ket{\psi}\) at time \(t = 0\).
time_step (float) – The time \(t_1\) at which to compute the approximation.
rtol (float and array_like) – The relative error tolerance.
atol (float and array_like) – The absolute error tolerance.
- Returns:
An approximation to the solution at \(t_1\).
- Return type:
ndarray