hqs_distiller.projector

Module providing projector generators for FEAST algorithm.

This module defines the functions generating projection functions for the FEAST algorithm. Currently there are three numerical alternatives implemented:

  • projection based on a direct solver for sparse matrices
  • projection based on a iterative solver for sparse matrices using an incomplete LU factorization as preconditioner
  • projection based on a Chebyshev expansion of the projector

@private

Copyright © 2022-2025 HQS Quantum Simulations GmbH. All Rights Reserved.

def init_direct_projector( matrix: scipy.sparse._matrix.spmatrix, window: Tuple[float, float], n_filter: int = 4, precompute_factors: bool = True) -> Callable:

Returns projector for FEAST algorithm using direct solver.

Arguments:
  • matrix (SPM.spmatrix): Sparse matrix.
  • window (Tuple[float, float]): Spectral window for projection.
  • n_filter (int): Number of rational filters per complex half plane. Defaults to 4.
  • precompute_factors (bool): Flag indicating whether factorization is stored in memonry. Defaults to True.
Returns:

Callable[[np.ndarray, float], np.ndarray]: Function implementing spectral projection.

def init_iterative_projector( matrix: scipy.sparse._matrix.spmatrix, window: Tuple[float, float], n_filter: int = 4, precompute_factors: bool = True, fill_factor: float = 100.0) -> Callable:

Returns projector for FEAST algorithm using iterative solver.

Arguments:
  • matrix (SPM.spmatrix): Sparse matrix.
  • window (Tuple[float, float]): Spectral window for projection.
  • n_filter (int): Number of rational filters per complex half plane. Defaults to 4.
  • precompute_factors (bool): Flag indicating whether factorization is stored in memonry. Defaults to True.
  • fill_factor (float): Allowed fill-in for iLU factors. Defaults to 100.
Returns:

Callable: Function implementing spectral projection.

def init_chebyshev_projector( cmg: hqs_distiller.chebyshev.ChebyshevIterator, chebyshev_window: Tuple[float, float], n_chebyshev_moments: int) -> Callable[[numpy.ndarray, float], numpy.ndarray]:

Returns projector for FEAST algorithm using Chebyshev expansion.

Arguments:
  • cmg (ChebyshevIterator): Chebyshev iterator to be used to construct the projector.
  • chebyshev_window (Tuple[float, float]): Spectral window for projection.
  • n_chebyshev_moments (int): Number of Chebyshev moments used to approximate rational filter (projector).
Returns:

Callable: Function implementing spectral projection.

def init_chebyshev_projector_with_moments( cmg: hqs_distiller.chebyshev.ChebyshevIteratorOperator, chebyshev_window: Tuple[float, float], n_chebyshev_moments: int) -> Callable[[numpy.ndarray], tuple[numpy.ndarray, numpy.ndarray]]:

Returns projector for FEAST algorithm using Chebyshev expansion.

Arguments:
  • cmg (ChebyshevIterator): Chebyshev iterator to be used to construct the projector.
  • chebyshev_window (Tuple[float, float]): Spectral window for projection.
  • n_chebyshev_moments (int): Number of Chebyshev moments used to approximate rational filter (projector).
Returns:

Callable: Function implementing spectral projection.

def init_chebyshev_projector_operator( cmg: hqs_distiller.chebyshev.ChebyshevIteratorOperator, chebyshev_window: Tuple[float, float], n_chebyshev_moments: int, dtype: numpy.dtype) -> Callable[[numpy.ndarray, float], numpy.ndarray]:

Returns projector for FEAST algorithm using Chebyshev expansion.

Arguments:
  • cmg (ChebyshevIteratorOperator): Chebyshev iterator to be used to construct the projector.
  • chebyshev_window (Tuple[float, float]): Spectral window for projection.
  • n_chebyshev_moments (int): Number of Chebyshev moments used to approximate rational filter (projector).
  • dtype (xp.dtype): Data type for computations.
Returns:

Callable: Function implementing spectral projection.