Skip to content

qttools.wave_function_solver.solver#

[docs] module qttools.wave_function_solver.solver

# Copyright (c) 2024-2026 ETH Zurich and the authors of the qttools package.

from abc import ABC, abstractmethod

from qttools import NDArray, sparse


class WFSolver(ABC):
    """Abstract base class for wave function solvers."""

    @abstractmethod
    def solve(
        self,
        a: sparse.spmatrix,
        b: NDArray,
    ) -> NDArray:
        """Solves the sparse linear system a @ x = b.

        Parameters
        ----------
        a : sparse.spmatrix
            The sparse system matrix.
        b : NDArray
            The right-hand side vector.

        Returns
        -------
        x : NDArray
            The solution vector.

        """