qm_sim.temporal_solver.scipy_solvers.ScipySolver

class qm_sim.temporal_solver.scipy_solvers.ScipySolver(H: Callable[[float], ndarray], output_shape: tuple[int] = None)[source]

Bases: TemporalSolver

Base class for scipy’s solve_ivp-based solvers

__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

method

Name of the solve_ivp method

name

Name of the solver

order

Integration order

explicit

Is the method explicit or implicit?

stable

Is the method stable? If only conditionally stable, this will be true and dt will be forced into its stable range

explicit: bool

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][source]

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,) for n storage times

np.ndarray:

State at times stored in the other output. shape (n, H.shape)

method: str

Name of the solve_ivp method

name: str

Name of the solver

order: int

Integration order

stable: bool

Is the method stable? If only conditionally stable, this will be true and dt will be forced into its stable range