qm_sim.temporal_solver.scipy_solvers.RungeKutta45
- class qm_sim.temporal_solver.scipy_solvers.RungeKutta45(H: Callable[[float], ndarray], output_shape: tuple[int] = None)[source]
Bases:
ScipySolver
- __init__(H: Callable[[float], ndarray], output_shape: tuple[int] = None)
Initialize a temporal solver
- Parameters:
H (Callable[[float], np.ndarray]) – Function of time, representing the temporal derivative at that time
output_shape (tuple[int], optional) – Expected shape of the solution, defaults to None
Methods
__init__
(H[, output_shape])Initialize a temporal solver
iterate
(v_0, t0, t_final, dt[, dt_storage, ...])Iterate the time propagation scheme.
tqdm
(t_start, t_end, enable)Attributes
Is the method explicit or implicit?
Name of the
solve_ivp
methodName of the solver
Integration order
Is the method stable? If only conditionally stable, this will be true and
dt
will be forced into its stable range- explicit: bool = True
Is the method explicit or implicit?
- iterate(v_0: ndarray, t0: float, t_final: float, dt: float, dt_storage: float = None, verbose: bool = True) tuple[ndarray, ndarray]
Iterate the time propagation scheme. Store the current state every
dt_storage
- Args:
- t_final (float):
End time for calculations
- dt_storage (float, optional):
Data storage period. If None, store each calculation
dt
Defaults to None.
- Returns:
- np.ndarray:
Time values, shape (
n
,) forn
storage times- np.ndarray:
State at times stored in the other output. shape (
n
,H
.shape)
- method: str = 'RK45'
Name of the
solve_ivp
method
- name: str = 'scipy-Runge-Kutta 5(4)'
Name of the solver
- order: int = 5
Integration order
- stable: bool = True
Is the method stable? If only conditionally stable, this will be true and
dt
will be forced into its stable range