26#ifndef dftefeKohnShamEigenSolver_h
27#define dftefeKohnShamEigenSolver_h
56 template <
typename ValueTypeOperator,
57 typename ValueTypeOperand,
60 :
public linearAlgebra::HermitianIterativeEigenSolver<ValueTypeOperator,
71 using ValueType =
typename linearAlgebra::HermitianIterativeEigenSolver<
75 using RealType =
typename linearAlgebra::HermitianIterativeEigenSolver<
79 using OpContext =
typename linearAlgebra::HermitianIterativeEigenSolver<
93 const double smearingTemperature,
94 const double fermiEnergyTolerance,
95 const double fracOccupancyTolerance,
96 const double eigenSolveResidualTolerance,
104 bool isResidualChebyshevFilter =
true,
105 const size_type waveFunctionBatchSize = 0,
114 const bool isGHEP =
true,
117 bool storeIntermediateSubspaces =
false,
118 bool useSameScratchInEigenSolver =
true,
144 double wantedSpectrumUpperBound);
149 std::vector<RealType>
152 std::vector<RealType>
166 std::vector<RealType> &kohnShamEnergies,
168 & kohnShamWaveFunctions,
169 bool computeWaveFunctions =
false,
177 memorySpace>())
override;
193 & kohnShamWaveFunctions,
208 std::shared_ptr<const utils::mpi::MPIPatternP2P<memorySpace>>
210 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
242 std::shared_ptr<linearAlgebra::MultiVector<ValueType, memorySpace>>
253 std::shared_ptr<linearAlgebra::MultivectorScratch<ValueType, memorySpace>>
Definition: KohnShamEigenSolver.h:63
RealType getFermiEnergy()
Definition: KohnShamEigenSolver.t.cpp:803
utils::MemoryStorage< ValueType, memorySpace > d_kohnShamEnergiesMemspace
Definition: KohnShamEigenSolver.h:245
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_MXBatchSmall
Definition: KohnShamEigenSolver.h:244
typename linearAlgebra::HermitianIterativeEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace >::OpContext OpContext
Definition: KohnShamEigenSolver.h:82
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_HXBatch
Definition: KohnShamEigenSolver.h:243
bool d_isSolved
Definition: KohnShamEigenSolver.h:217
const size_type d_S
Definition: KohnShamEigenSolver.h:197
typename linearAlgebra::HermitianIterativeEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace >::ValueType ValueType
define ValueType as the superior (bigger set) of the ValueTypeOperator and ValueTypeOperand (e....
Definition: KohnShamEigenSolver.h:74
size_type d_maxChebyshevFilterPass
Definition: KohnShamEigenSolver.h:202
const linearAlgebra::ElpaScalapackManager * d_elpaScala
Definition: KohnShamEigenSolver.h:249
std::shared_ptr< linearAlgebra::ChebyshevFilteredEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace > > d_chfsi
Definition: KohnShamEigenSolver.h:232
utils::Profiler< memorySpace > d_pTotal
Definition: KohnShamEigenSolver.h:237
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_HXBatchSmall
Definition: KohnShamEigenSolver.h:243
void reinitBasis(std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > mpiPatternP2P, std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > linAlgOpContext, const OpContext &MLanczos=linearAlgebra::IdentityOperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace >(), const OpContext &MInvLanczos=linearAlgebra::IdentityOperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace >())
Definition: KohnShamEigenSolver.t.cpp:182
double d_eigenSolveResidualTolerance
Definition: KohnShamEigenSolver.h:201
linearAlgebra::OrthogonalizationType d_orthoType
Definition: KohnShamEigenSolver.h:248
const size_type d_numElectrons
Definition: KohnShamEigenSolver.h:218
bool d_isChebyPolDegComputed
Definition: KohnShamEigenSolver.h:225
double d_smearingTemperature
Definition: KohnShamEigenSolver.h:198
bool d_isBoundKnown
Definition: KohnShamEigenSolver.h:222
linearAlgebra::EigenSolverError solve(const OpContext &kohnShamOperator, std::vector< RealType > &kohnShamEnergies, linearAlgebra::MultiVector< ValueType, memorySpace > &kohnShamWaveFunctions, bool computeWaveFunctions=false, const OpContext &M=linearAlgebra::IdentityOperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace >(), const OpContext &MInv=linearAlgebra::IdentityOperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace >()) override
Definition: KohnShamEigenSolver.t.cpp:297
void setResidualChebyshevFilterFlag(bool flag)
Definition: KohnShamEigenSolver.t.cpp:287
std::shared_ptr< linearAlgebra::MultivectorScratch< ValueType, memorySpace > > d_scratch
Definition: KohnShamEigenSolver.h:254
const OpContext * d_MInvLanczos
Definition: KohnShamEigenSolver.h:213
void setChebyshevPolynomialDegree(size_type chebyPolyDeg)
Definition: KohnShamEigenSolver.t.cpp:276
utils::ConditionalOStream d_rootCout
Definition: KohnShamEigenSolver.h:219
linearAlgebra::MultiVector< ValueType, memorySpace > & getFilteredSubspace()
Definition: KohnShamEigenSolver.t.cpp:1005
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: KohnShamEigenSolver.h:211
std::vector< RealType > getEigenSolveResidualNorm()
Definition: KohnShamEigenSolver.t.cpp:987
SpinMode d_spinMode
Definition: KohnShamEigenSolver.h:196
const OpContext * d_MLanczos
Definition: KohnShamEigenSolver.h:212
bool d_setChebyPolDegExternally
Definition: KohnShamEigenSolver.h:224
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_MXBatch
Definition: KohnShamEigenSolver.h:243
linearAlgebra::MultiVector< ValueType, memorySpace > & getOrthogonalizedFilteredSubspace()
Definition: KohnShamEigenSolver.t.cpp:1023
std::vector< RealType > d_fracOccupancy
Definition: KohnShamEigenSolver.h:214
RealType d_fermiEnergy
Definition: KohnShamEigenSolver.h:216
bool d_useSameScratch
Definition: KohnShamEigenSolver.h:251
std::vector< RealType > d_eigSolveResNorm
Definition: KohnShamEigenSolver.h:215
~KohnShamEigenSolver()=default
Default Destructor.
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_waveFnBatch
Definition: KohnShamEigenSolver.h:243
double d_wantedSpectrumLowerBound
Definition: KohnShamEigenSolver.h:220
void reinitBounds(double wantedSpectrumLowerBound, double wantedSpectrumUpperBound)
Definition: KohnShamEigenSolver.t.cpp:252
void setChebyPolyScalingFactor(double scalingFactor)
Definition: KohnShamEigenSolver.t.cpp:266
double d_chebyPolyScalingFactor
Definition: KohnShamEigenSolver.h:223
size_type d_waveFunctionBatchSize
Definition: KohnShamEigenSolver.h:205
bool d_isResidualChebyFilter
Definition: KohnShamEigenSolver.h:238
linearAlgebra::MultiVector< ValueType, memorySpace > * d_filteredSubspace
Definition: KohnShamEigenSolver.h:236
CalculationType d_calculationType
Definition: KohnShamEigenSolver.h:226
utils::Profiler< memorySpace > d_p
Definition: KohnShamEigenSolver.h:237
typename linearAlgebra::HermitianIterativeEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace >::RealType RealType
Definition: KohnShamEigenSolver.h:78
std::vector< double > getLinearEigenSolveResidual(const OpContext &kohnShamOperator, const linearAlgebra::MultiVector< ValueType, memorySpace > &kohnShamWaveFunctions, const OpContext &M)
Definition: KohnShamEigenSolver.t.cpp:832
std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > d_mpiPatternP2P
Definition: KohnShamEigenSolver.h:209
const bool d_storeIntermediateSubspaces
Definition: KohnShamEigenSolver.h:239
bool d_isGHEP
Definition: KohnShamEigenSolver.h:250
double d_fracOccupancyTolerance
Definition: KohnShamEigenSolver.h:200
size_type d_chebyshevPolynomialDegree
Definition: KohnShamEigenSolver.h:203
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_waveFnBatchSmall
Definition: KohnShamEigenSolver.h:243
std::vector< RealType > getFractionalOccupancy()
Definition: KohnShamEigenSolver.t.cpp:819
linearAlgebra::MultiVector< ValueTypeOperand, memorySpace > * d_waveFunctionSubspaceGuess
Definition: KohnShamEigenSolver.h:207
double d_fermiEnergyTolerance
Definition: KohnShamEigenSolver.h:199
size_type d_batchSizeSmall
Definition: KohnShamEigenSolver.h:241
linearAlgebra::MultiVector< ValueType, memorySpace > * d_filteredSubspaceOrtho
Definition: KohnShamEigenSolver.h:235
const size_type d_numWantedEigenvalues
Definition: KohnShamEigenSolver.h:204
double d_wantedSpectrumUpperBound
Definition: KohnShamEigenSolver.h:221
utils::MemoryStorage< ValueType, memorySpace > d_nOnes
Definition: KohnShamEigenSolver.h:246
void printTotalInScopeTimings()
Definition: KohnShamEigenSolver.t.cpp:1036
A derived class of OperatorContext to encapsulate the action of a discrete operator on vectors,...
Definition: ChebyshevFilteredEigenSolver.h:71
Manager class for ELPA and ScaLAPACK.
Definition: ElpaScalapackManager.h:43
Abstract class to encapsulate the action of a discrete operator on vectors, matrices,...
Definition: IdentityOperatorContext.h:53
Definition: LinAlgOpContext.h:52
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
Provides an interface to print based on whether a certain condition is met or not....
Definition: ConditionalOStream.h:47
Definition: MemoryStorage.h:38
Definition: Profiler.h:50
A class template to store the communication pattern (i.e., which entries/nodes to receive from which ...
Definition: MPIPatternP2P.h:197
SpinMode
Definition: KSAttributes.h:55
CalculationType
Definition: KSAttributes.h:66
OrthogonalizationType
Definition: ChebyshevFilteredEigenSolver.h:47
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
std::uint64_t size_type
Definition: TypeConfig.h:9
Definition: LinearAlgebraTypes.h:154