schr.core.base module¶
Abstract base classes for quantum simulations.
- class schr.core.base.Field(dtype: ~numpy.dtype = <class 'jax.numpy.complex64'>)[source]¶
Bases:
ABCAbstract base class for field representations.
- dtype¶
JAX dtype for field values.
- class schr.core.base.Hamiltonian(dtype: ~numpy.dtype = <class 'jax.numpy.complex64'>)[source]¶
Bases:
ABCAbstract base class for quantum Hamiltonians.
Represents the quantum operator \(\hat{H}\) acting on wavefunctions \(|\psi\rangle\).
- dtype¶
JAX dtype (complex64 or complex128).
- class schr.core.base.Solver(hamiltonian: ~schr.core.base.Hamiltonian, dtype: ~numpy.dtype = <class 'jax.numpy.complex64'>)[source]¶
Bases:
ABCAbstract base class for time evolution solvers.
Implements numerical integration of the Schrödinger equation:
\[i\hbar\frac{\partial|\psi\rangle}{\partial t} = \hat{H}|\psi\rangle\]- hamiltonian¶
Hamiltonian operator.
- dtype¶
JAX dtype for computations.
- evolve(psi0: Array, t_span: tuple[float, float], dt: float, callback: Callable[[Array, float], Any] | None = None) Array[source]¶
Evolve wavefunction over time interval.
- Parameters:
psi0 – Initial wavefunction.
t_span – Time interval (t_start, t_end) in a.u.
dt – Time step (a.u.).
callback – Optional function called at each step with (psi, t).
- Returns:
Final wavefunction at t_end.
- Raises:
ValueError – If t_end <= t_start or dt <= 0.