1.1.1. chase::ChaseBase
-
template<class T>
class ChaseBase Base class for all ChASE algorithmic operations.
This abstract class defines the common interface for all algorithmic operations in ChASE. Derived classes are expected to implement these methods, which include matrix factorization, eigenvalue problem solving, and other numerical operations.
- Template Parameters:
T – The type of data used in matrix and vector operations (e.g.,
float,double).
Subclassed by chase::Impl::ChASEGPU< double >, chase::Impl::ChASEGPU< float >, chase::Impl::ChASEGPU< std::complex< double > >, chase::Impl::ChASEGPU< std::complex< float > >, chase::Impl::ChASECPU< T, MatrixType >, chase::Impl::ChASEGPU< T, MatrixType >, chase::PerformanceDecoratorChase< T >
Public Functions
-
virtual void Shift(T c, bool isunshift = false) = 0
Shifts the diagonal of matrix
Awith a specified valuec.This method applies a shift to the diagonal of the matrix
Aby the specified amountc. Optionally, the shift can be undone if theisunshiftflag is set to true.- Parameters:
c – The shift value applied to the diagonal of matrix
A.isunshift – If true, undoes the shift applied to the diagonal.
-
virtual void HEMM(std::size_t nev, T alpha, T beta, std::size_t offset) = 0
Performs a matrix operation of the form (V1 = \alpha \cdot H \cdot V2 + \beta \cdot V1).
This method computes the matrix operation for the input vectors (V1) and (V2) using scalars (\alpha) and (\beta), where (H) is a matrix and (V1) and (V2) are input vectors.
- Parameters:
nev – Number of eigenpairs involved in the operation.
alpha – Scalar that scales the result of (H \cdot V2).
beta – Scalar that scales the result of (V1).
offset – Column offset for the operation.
-
virtual void QR(std::size_t fixednev, Base<T> cond) = 0
Performs QR factorization with optional Householder transformation.
This method performs a QR factorization on the matrix, optionally using Householder transformations for the computation.
- Parameters:
fixednev – Total number of converged eigenpairs before the QR factorization.
cond – Condition number for controlling the factorization process.
-
virtual void RR(Base<T> *ritzv, std::size_t block) = 0
Performs Rayleigh-Ritz projection for eigenproblem reduction.
This method projects the eigenproblem into a smaller subspace, solves the smaller problem, and reconstructs the eigenvectors.
- Parameters:
ritzv – Array to store the computed eigenvalues.
block – The number of non-converged eigenpairs used for the small eigenproblem.
-
virtual void Sort(Base<T> *ritzv, Base<T> *residLast, Base<T> *resid) = 0
Sort the ritz values, the residuals, and the eigenvectors in ascending order.
This method sorts the ritz values, the residuals, and the ritz vectors in ascending order of the ritz values.
- Parameters:
ritzv – Array to store the computed eigenvalues.
residLast – Array to store the residuals of the previous iteration.
resid – Array to store the residuals of the current iteration.
-
virtual void Resd(Base<T> *ritzv, Base<T> *resd, std::size_t fixednev) = 0
Computes residuals for unconverged eigenpairs.
This method computes the residuals of the eigenpairs that have not yet converged.
- Parameters:
ritzv – Array containing the eigenvalues.
resd – Array to store the computed residuals for each eigenpair.
fixednev – Number of converged eigenpairs, which helps determine the number of non-converged eigenpairs.
-
virtual void Lanczos(std::size_t m, Base<T> *upperb) = 0
Estimates the upper bound of the user-interested spectrum using Lanczos eigensolver.
This method estimates the upper bound of the spectrum of interest using the Lanczos eigensolver.
- Parameters:
m – Number of iterative steps for the Lanczos method.
upperb – Pointer to store the estimated upper bound of the spectrum.
-
virtual void Lanczos(std::size_t M, std::size_t numvec, Base<T> *upperb, Base<T> *ritzv, Base<T> *Tau, Base<T> *ritzV) = 0
Performs Lanczos eigensolver with additional parameters for eigenvector and Tau storage.
This method performs the Lanczos eigensolver with more advanced parameters, storing eigenvectors and Tau values for further computation.
- Parameters:
M – Number of iterations for the Lanczos algorithm.
numvec – Number of vectors to be used in the Lanczos procedure.
upperb – Pointer to store the upper bound of the spectrum.
ritzv – Pointer to store the Ritz values.
Tau – Pointer to store the Tau values.
ritzV – Pointer to store the Ritz vectors.
-
virtual void LanczosDos(std::size_t idx, std::size_t m, T *ritzVc) = 0
Lanczos method for Density of States (DOS) computation.
This method performs a Lanczos procedure for computing the density of states.
- Parameters:
idx – Index for the specific Lanczos vector.
m – Number of iterations for the Lanczos method.
ritzVc – Pointer to store the Ritz vectors.
-
virtual void Swap(std::size_t i, std::size_t j) = 0
Swaps two columns in a matrix for Chebyshev filtering.
This method swaps the specified columns of a matrix to facilitate Chebyshev filtering.
- Parameters:
i – One of the column indices to be swapped.
j – Another column index to be swapped.
-
virtual void Lock(std::size_t new_converged) = 0
Locks the newly converged eigenvectors.
This method locks the newly converged eigenvectors and increments the locked count.
- Parameters:
new_converged – The number of newly converged eigenvectors.
-
virtual bool checkSymmetryEasy() = 0
Checks for easy symmetry in the matrix.
This method performs a simple check for matrix symmetry.
- Returns:
trueif the matrix is symmetric, otherwisefalse.
-
virtual bool isSym() = 0
Returns if the matrix is Hermitian or not.
This method simply returns if the matrix is Hermitian or not
- Returns:
trueif the matrix is Hermitian, otherwisefalse.
-
virtual bool checkPseudoHermicityEasy() = 0
Checks for easy pseudo-hermicity in the matrix.
This method performs a simple check for matrix pseudo-hermicity
- Returns:
trueif the matrix is pseudo-hermicity, otherwisefalse.
-
virtual bool isPseudoHerm() = 0
Returns if the matrix is Pseudo-Hermitian or not.
This method simply returns if the matrix is Pseudo-Hermitian or not
- Returns:
trueif the matrix is Pseudo-Hermitian, otherwisefalse.
-
virtual void symOrHermMatrix(char uplo) = 0
Sets matrix type for symmetric or Hermitian matrix.
This method defines whether the matrix is symmetric or Hermitian based on the specified input.
- Parameters:
uplo – Specifies whether the upper or lower triangular part of the matrix is stored.
-
virtual void Start() = 0
Indicates the start of an eigenproblem solution.
This method marks the beginning of the eigenproblem-solving process.
-
virtual void End() = 0
Indicates the end of an eigenproblem solution.
This method marks the conclusion of the eigenproblem-solving process.
-
virtual void initVecs(bool random) = 0
Initializes vectors randomly, if necessary.
This method initializes the vectors either randomly or from previously computed Ritz values, depending on the input flag.
- Parameters:
random – Flag to determine whether to initialize vectors randomly.
-
virtual std::size_t GetN() const = 0
Returns the size of the matrix.
This method returns the size of the matrix (number of rows or columns).
- Returns:
The size of the matrix.
-
virtual std::size_t GetNev() = 0
Returns the number of eigenpairs to be computed.
This method returns the number of eigenpairs that need to be computed.
- Returns:
The number of eigenpairs.
-
virtual std::size_t GetNex() = 0
Returns the value of
nex, which is used for specifying the number of eigenpairs.This method returns the size or number of eigenpairs required by the algorithm for the computation.
- Returns:
The number of eigenpairs as a
std::size_tvalue.
-
virtual Base<T> *GetRitzv() = 0
Returns the computed Ritz values.
This method provides access to the Ritz values computed during the algorithm’s execution. These values are typically used for eigenvalue approximations and further analysis.
- Returns:
A pointer to an array of Ritz values of type
Base<T>.
-
virtual Base<T> *GetResid() = 0
Returns the residuals of computed Ritz pairs.
This method returns the residuals associated with the Ritz values. Residuals are often used to measure the accuracy or convergence of the eigenvalue problem solution.
- Returns:
A pointer to an array of residuals corresponding to the Ritz values of type
Base<T>.
-
virtual ChaseConfig<T> &GetConfig() = 0
Returns the configuration parameters used in the algorithm.
This method provides access to the configuration object that contains various algorithm settings, parameters, and options.
- Returns:
A reference to a
ChaseConfig<T>class containing the configuration parameters.
-
virtual int get_nprocs() = 0
Returns the number of MPI processes used.
This method returns the number of MPI processes involved in the computation. If sequential ChASE is used, it returns
1, indicating a single process is running.- Returns:
The number of MPI processes used, represented as an integer.
-
virtual void Output(std::string str) = 0
Prints intermediate information during the solving procedure.
This method is used to output intermediate information or debug data during the execution of the algorithm. It is typically enabled when debugging or logging is required.
- Parameters:
str – A string containing the information to be printed.