QUDA  v1.1.0
A library for QCD on GPUs
Public Member Functions | Public Attributes | List of all members
quda::IRAM Class Reference

Implicitly Restarted Arnoldi Method. More...

#include <eigensolve_quda.h>

+ Inheritance diagram for quda::IRAM:

Public Member Functions

 IRAM (const DiracMatrix &mat, QudaEigParam *eig_param, TimeProfile &profile)
 Constructor for Thick Restarted Eigensolver class. More...
 
virtual bool hermitian ()
 
virtual ~IRAM ()
 Destructor for Thick Restarted Eigensolver class. More...
 
void operator() (std::vector< ColorSpinorField * > &kSpace, std::vector< Complex > &evals)
 Compute eigenpairs. More...
 
void arnoldiStep (std::vector< ColorSpinorField * > &v, std::vector< ColorSpinorField * > &r, double &beta, int j)
 Arnoldi step: extends the Krylov space by one vector. More...
 
void eigensolveFromUpperHess (std::vector< Complex > &evals, const double beta)
 Get the eigendecomposition from the upper Hessenberg matrix via QR. More...
 
void rotateBasis (std::vector< ColorSpinorField * > &v, int keep)
 Rotate the Krylov space. More...
 
void qrShifts (const std::vector< Complex > evals, const int num_shifts)
 Apply shifts to the upper Hessenberg matrix via QR decomposition. More...
 
void qrIteration (Complex **Q, Complex **R)
 Apply One step of the the QR algorithm. More...
 
void reorder (std::vector< ColorSpinorField * > &kSpace, std::vector< Complex > &evals, const QudaEigSpectrumType spec_type)
 Reorder the Krylov space and eigenvalues. More...
 
- Public Member Functions inherited from quda::EigenSolver
 EigenSolver (const DiracMatrix &mat, QudaEigParam *eig_param, TimeProfile &profile)
 Constructor for base Eigensolver class. More...
 
virtual ~EigenSolver ()
 
void prepareInitialGuess (std::vector< ColorSpinorField * > &kSpace)
 Check for an initial guess. If none present, populate with rands, then orthonormalise. More...
 
void checkChebyOpMax (const DiracMatrix &mat, std::vector< ColorSpinorField * > &kSpace)
 Check for a maximum of the Chebyshev operator. More...
 
void prepareKrylovSpace (std::vector< ColorSpinorField * > &kSpace, std::vector< Complex > &evals)
 Extend the Krylov space. More...
 
double setEpsilon (const QudaPrecision prec)
 Set the epsilon parameter. More...
 
void queryPrec (const QudaPrecision prec)
 Query the eigensolver precision to stdout. More...
 
void printEigensolverSetup ()
 Dump the eigensolver parameters to stdout. More...
 
void cleanUpEigensolver (std::vector< ColorSpinorField * > &kSpace, std::vector< Complex > &evals)
 Release memory, save eigenvectors, resize the Krylov space to its original dimension. More...
 
void matVec (const DiracMatrix &mat, ColorSpinorField &out, const ColorSpinorField &in)
 Applies the specified matVec operation: M, Mdag, MMdag, MdagM. More...
 
void chebyOp (const DiracMatrix &mat, ColorSpinorField &out, const ColorSpinorField &in)
 Promoted the specified matVec operation: M, Mdag, MMdag, MdagM to a Chebyshev polynomial. More...
 
double estimateChebyOpMax (const DiracMatrix &mat, ColorSpinorField &out, ColorSpinorField &in)
 Estimate the spectral radius of the operator for the max value of the Chebyshev polynomial. More...
 
void blockOrthogonalize (std::vector< ColorSpinorField * > v, std::vector< ColorSpinorField * > &r, int j)
 Orthogonalise input vectors r against vector space v using block-BLAS. More...
 
void orthonormalizeMGS (std::vector< ColorSpinorField * > &v, int j)
 Orthonormalise input vector space v using Modified Gram-Schmidt. More...
 
bool orthoCheck (std::vector< ColorSpinorField * > v, int j)
 Check orthonormality of input vector space v. More...
 
void rotateVecs (std::vector< ColorSpinorField * > &kSpace, const double *rot_array, const int offset, const int dim, const int keep, const int locked, TimeProfile &profile)
 Rotate the Krylov space. More...
 
void rotateVecsComplex (std::vector< ColorSpinorField * > &kSpace, const Complex *rot_array, const int offset, const int dim, const int keep, const int locked, TimeProfile &profile)
 Rotate the Krylov space. More...
 
void permuteVecs (std::vector< ColorSpinorField * > &kSpace, int *mat, int size)
 Permute the vector space using the permutation matrix. More...
 
void blockRotate (std::vector< ColorSpinorField * > &kSpace, double *array, int rank, const range &i, const range &j, blockType b_type)
 Rotate part of kSpace. More...
 
void blockRotateComplex (std::vector< ColorSpinorField * > &kSpace, Complex *array, int rank, const range &i, const range &j, blockType b_type, int offset)
 Rotate part of kSpace. More...
 
void blockReset (std::vector< ColorSpinorField * > &kSpace, int js, int je, int offset)
 Copy temp part of kSpace, zero out for next use. More...
 
void deflate (std::vector< ColorSpinorField * > &sol, const std::vector< ColorSpinorField * > &src, const std::vector< ColorSpinorField * > &evecs, const std::vector< Complex > &evals, bool accumulate=false) const
 Deflate a set of source vectors with a given eigenspace. More...
 
void deflate (ColorSpinorField &sol, const ColorSpinorField &src, const std::vector< ColorSpinorField * > &evecs, const std::vector< Complex > &evals, bool accumulate=false)
 Deflate a given source vector with a given eigenspace. This is a wrapper variant for a single source vector. More...
 
void deflateSVD (std::vector< ColorSpinorField * > &sol, const std::vector< ColorSpinorField * > &vec, const std::vector< ColorSpinorField * > &evecs, const std::vector< Complex > &evals, bool accumulate=false) const
 Deflate a set of source vectors with a set of left and right singular vectors. More...
 
void deflateSVD (ColorSpinorField &sol, const ColorSpinorField &src, const std::vector< ColorSpinorField * > &evecs, const std::vector< Complex > &evals, bool accumulate=false)
 Deflate a a given source vector with a given with a set of left and right singular vectors This is a wrapper variant for a single source vector. More...
 
void computeSVD (const DiracMatrix &mat, std::vector< ColorSpinorField * > &evecs, std::vector< Complex > &evals)
 Computes Left/Right SVD from pre computed Right/Left. More...
 
void computeEvals (const DiracMatrix &mat, std::vector< ColorSpinorField * > &evecs, std::vector< Complex > &evals, int size)
 Compute eigenvalues and their residiua. More...
 
void computeEvals (const DiracMatrix &mat, std::vector< ColorSpinorField * > &evecs, std::vector< Complex > &evals)
 Compute eigenvalues and their residiua. This variant compute the number of converged eigenvalues. More...
 
void loadFromFile (const DiracMatrix &mat, std::vector< ColorSpinorField * > &eig_vecs, std::vector< Complex > &evals)
 Load and check eigenpairs from file. More...
 
void sortArrays (QudaEigSpectrumType spec_type, int n, std::vector< Complex > &x, std::vector< Complex > &y)
 Sort array the first n elements of x according to spec_type, y comes along for the ride. More...
 
void sortArrays (QudaEigSpectrumType spec_type, int n, std::vector< double > &x, std::vector< Complex > &y)
 Sort array the first n elements of x according to spec_type, y comes along for the ride Overloaded version with real x. More...
 
void sortArrays (QudaEigSpectrumType spec_type, int n, std::vector< Complex > &x, std::vector< double > &y)
 Sort array the first n elements of x according to spec_type, y comes along for the ride Overloaded version with real y. More...
 
void sortArrays (QudaEigSpectrumType spec_type, int n, std::vector< double > &x, std::vector< double > &y)
 Sort array the first n elements of x according to spec_type, y comes along for the ride Overloaded version with real x and real y. More...
 

Public Attributes

Complex ** upperHess
 
Complex ** Qmat
 
Complex ** Rmat
 

Additional Inherited Members

- Static Public Member Functions inherited from quda::EigenSolver
static EigenSolvercreate (QudaEigParam *eig_param, const DiracMatrix &mat, TimeProfile &profile)
 Creates the eigensolver using the parameters given and the matrix. More...
 
- Protected Attributes inherited from quda::EigenSolver
const DiracMatrixmat
 
QudaEigParameig_param
 
TimeProfileprofile
 
int n_ev
 
int n_kr
 
int n_conv
 
int n_ev_deflate
 
double tol
 
bool reverse
 
char spectrum [3]
 
bool converged
 
int restart_iter
 
int max_restarts
 
int check_interval
 
int batched_rotate
 
int block_size
 
int iter
 
int iter_converged
 
int iter_locked
 
int iter_keep
 
int num_converged
 
int num_locked
 
int num_keep
 
std::vector< double > residua
 
std::vector< ColorSpinorField * > r
 
std::vector< ColorSpinorField * > d_vecs_tmp
 
ColorSpinorFieldtmp1
 
ColorSpinorFieldtmp2
 
QudaPrecision save_prec
 

Detailed Description

Implicitly Restarted Arnoldi Method.

Definition at line 554 of file eigensolve_quda.h.

Constructor & Destructor Documentation

◆ IRAM()

quda::IRAM::IRAM ( const DiracMatrix mat,
QudaEigParam eig_param,
TimeProfile profile 
)

Constructor for Thick Restarted Eigensolver class.

Parameters
eig_paramThe eigensolver parameters
matThe operator to solve
profileTime Profile

Definition at line 19 of file eig_iram.cpp.

◆ ~IRAM()

quda::IRAM::~IRAM ( )
virtual

Destructor for Thick Restarted Eigensolver class.

IRAM is for any linear system

Definition at line 587 of file eig_iram.cpp.

Member Function Documentation

◆ arnoldiStep()

void quda::IRAM::arnoldiStep ( std::vector< ColorSpinorField * > &  v,
std::vector< ColorSpinorField * > &  r,
double &  beta,
int  j 
)

Arnoldi step: extends the Krylov space by one vector.

Parameters
[in]vVector space
[in]rResidual vector
[in]betaNorm of residual vector
[in]jIndex of vector being computed

Definition at line 47 of file eig_iram.cpp.

◆ eigensolveFromUpperHess()

void quda::IRAM::eigensolveFromUpperHess ( std::vector< Complex > &  evals,
const double  beta 
)

Get the eigendecomposition from the upper Hessenberg matrix via QR.

Parameters
[in]evalsComplex eigenvalues
[in]betaNorm of residual (used to compute errors on eigenvalues)

Definition at line 312 of file eig_iram.cpp.

◆ hermitian()

virtual bool quda::IRAM::hermitian ( )
inlinevirtual
Returns
Whether the solver is only for Hermitian systems

Implements quda::EigenSolver.

Definition at line 573 of file eigensolve_quda.h.

◆ operator()()

void quda::IRAM::operator() ( std::vector< ColorSpinorField * > &  kSpace,
std::vector< Complex > &  evals 
)
virtual

Compute eigenpairs.

Parameters
[in]kSpaceKrylov vector space
[in]evalsComputed eigenvalues

Implements quda::EigenSolver.

Definition at line 432 of file eig_iram.cpp.

◆ qrIteration()

void quda::IRAM::qrIteration ( Complex **  Q,
Complex **  R 
)

Apply One step of the the QR algorithm.

Parameters
[in]QThe Q matrix
[in]RThe R matrix

Definition at line 227 of file eig_iram.cpp.

◆ qrShifts()

void quda::IRAM::qrShifts ( const std::vector< Complex evals,
const int  num_shifts 
)

Apply shifts to the upper Hessenberg matrix via QR decomposition.

Parameters
[in]evalsThe shifts to apply
[in]num_shiftsThe number of shifts to apply

Definition at line 197 of file eig_iram.cpp.

◆ reorder()

void quda::IRAM::reorder ( std::vector< ColorSpinorField * > &  kSpace,
std::vector< Complex > &  evals,
const QudaEigSpectrumType  spec_type 
)

Reorder the Krylov space and eigenvalues.

Parameters
[in]kSpaceThe Krylov space
[in]evalsthe eigenvalues
[in]spec_typeThe spectrum type (Largest/Smallest)(Modulus/Imaginary/Real) that determines the sorting condition

Definition at line 135 of file eig_iram.cpp.

◆ rotateBasis()

void quda::IRAM::rotateBasis ( std::vector< ColorSpinorField * > &  v,
int  keep 
)

Rotate the Krylov space.

Parameters
[in]vVector space
[in]keepThe number of vectors to keep after rotation

Definition at line 125 of file eig_iram.cpp.

Member Data Documentation

◆ Qmat

Complex** quda::IRAM::Qmat

Definition at line 559 of file eigensolve_quda.h.

◆ Rmat

Complex** quda::IRAM::Rmat

Definition at line 560 of file eigensolve_quda.h.

◆ upperHess

Complex** quda::IRAM::upperHess

Definition at line 558 of file eigensolve_quda.h.


The documentation for this class was generated from the following files: