26#ifndef dftefeKohnShamEigenSolver_h
27#define dftefeKohnShamEigenSolver_h
55 template <
typename ValueTypeOperator,
56 typename ValueTypeOperand,
59 :
public linearAlgebra::HermitianIterativeEigenSolver<ValueTypeOperator,
70 using ValueType =
typename linearAlgebra::HermitianIterativeEigenSolver<
74 using RealType =
typename linearAlgebra::HermitianIterativeEigenSolver<
78 using OpContext =
typename linearAlgebra::HermitianIterativeEigenSolver<
92 const double smearingTemperature,
93 const double fermiEnergyTolerance,
94 const double fracOccupancyTolerance,
95 const double eigenSolveResidualTolerance,
103 bool isResidualChebyshevFilter =
true,
104 const size_type waveFunctionBatchSize = 0,
113 const bool isGHEP =
true,
116 bool storeIntermediateSubspaces =
false,
117 bool useSameScratchInEigenSolver =
true);
141 double wantedSpectrumUpperBound);
146 std::vector<RealType>
149 std::vector<RealType>
163 std::vector<RealType> &kohnShamEnergies,
165 & kohnShamWaveFunctions,
166 bool computeWaveFunctions =
false,
174 memorySpace>())
override;
190 & kohnShamWaveFunctions,
203 std::shared_ptr<const utils::mpi::MPIPatternP2P<memorySpace>>
205 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
235 std::shared_ptr<linearAlgebra::MultiVector<ValueType, memorySpace>>
246 std::shared_ptr<linearAlgebra::MultivectorScratch<ValueType, memorySpace>>
Definition: KohnShamEigenSolver.h:62
RealType getFermiEnergy()
Definition: KohnShamEigenSolver.t.cpp:578
utils::MemoryStorage< ValueType, memorySpace > d_kohnShamEnergiesMemspace
Definition: KohnShamEigenSolver.h:238
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_MXBatchSmall
Definition: KohnShamEigenSolver.h:237
typename linearAlgebra::HermitianIterativeEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace >::OpContext OpContext
Definition: KohnShamEigenSolver.h:81
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_HXBatch
Definition: KohnShamEigenSolver.h:236
bool d_isSolved
Definition: KohnShamEigenSolver.h:212
typename linearAlgebra::HermitianIterativeEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace >::ValueType ValueType
define ValueType as the superior (bigger set) of the ValueTypeOperator and ValueTypeOperand (e....
Definition: KohnShamEigenSolver.h:73
size_type d_maxChebyshevFilterPass
Definition: KohnShamEigenSolver.h:197
const linearAlgebra::ElpaScalapackManager * d_elpaScala
Definition: KohnShamEigenSolver.h:242
std::shared_ptr< linearAlgebra::ChebyshevFilteredEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace > > d_chfsi
Definition: KohnShamEigenSolver.h:225
utils::Profiler< memorySpace > d_pTotal
Definition: KohnShamEigenSolver.h:230
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_HXBatchSmall
Definition: KohnShamEigenSolver.h:236
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:109
double d_eigenSolveResidualTolerance
Definition: KohnShamEigenSolver.h:196
linearAlgebra::OrthogonalizationType d_orthoType
Definition: KohnShamEigenSolver.h:241
const size_type d_numElectrons
Definition: KohnShamEigenSolver.h:213
double d_smearingTemperature
Definition: KohnShamEigenSolver.h:193
bool d_isBoundKnown
Definition: KohnShamEigenSolver.h:217
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:221
void setResidualChebyshevFilterFlag(bool flag)
Definition: KohnShamEigenSolver.t.cpp:211
std::shared_ptr< linearAlgebra::MultivectorScratch< ValueType, memorySpace > > d_scratch
Definition: KohnShamEigenSolver.h:247
const OpContext * d_MInvLanczos
Definition: KohnShamEigenSolver.h:208
void setChebyshevPolynomialDegree(size_type chebyPolyDeg)
Definition: KohnShamEigenSolver.t.cpp:200
utils::ConditionalOStream d_rootCout
Definition: KohnShamEigenSolver.h:214
linearAlgebra::MultiVector< ValueType, memorySpace > & getFilteredSubspace()
Definition: KohnShamEigenSolver.t.cpp:782
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: KohnShamEigenSolver.h:206
std::vector< RealType > getEigenSolveResidualNorm()
Definition: KohnShamEigenSolver.t.cpp:764
const OpContext * d_MLanczos
Definition: KohnShamEigenSolver.h:207
bool d_setChebyPolDegExternally
Definition: KohnShamEigenSolver.h:219
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_MXBatch
Definition: KohnShamEigenSolver.h:236
linearAlgebra::MultiVector< ValueType, memorySpace > & getOrthogonalizedFilteredSubspace()
Definition: KohnShamEigenSolver.t.cpp:800
std::vector< RealType > d_fracOccupancy
Definition: KohnShamEigenSolver.h:209
RealType d_fermiEnergy
Definition: KohnShamEigenSolver.h:211
bool d_useSameScratch
Definition: KohnShamEigenSolver.h:244
std::vector< RealType > d_eigSolveResNorm
Definition: KohnShamEigenSolver.h:210
~KohnShamEigenSolver()=default
Default Destructor.
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_waveFnBatch
Definition: KohnShamEigenSolver.h:236
double d_wantedSpectrumLowerBound
Definition: KohnShamEigenSolver.h:215
void reinitBounds(double wantedSpectrumLowerBound, double wantedSpectrumUpperBound)
Definition: KohnShamEigenSolver.t.cpp:176
void setChebyPolyScalingFactor(double scalingFactor)
Definition: KohnShamEigenSolver.t.cpp:190
double d_chebyPolyScalingFactor
Definition: KohnShamEigenSolver.h:218
size_type d_waveFunctionBatchSize
Definition: KohnShamEigenSolver.h:200
bool d_isResidualChebyFilter
Definition: KohnShamEigenSolver.h:231
linearAlgebra::MultiVector< ValueType, memorySpace > * d_filteredSubspace
Definition: KohnShamEigenSolver.h:229
utils::Profiler< memorySpace > d_p
Definition: KohnShamEigenSolver.h:230
typename linearAlgebra::HermitianIterativeEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace >::RealType RealType
Definition: KohnShamEigenSolver.h:77
std::vector< double > getLinearEigenSolveResidual(const OpContext &kohnShamOperator, const linearAlgebra::MultiVector< ValueType, memorySpace > &kohnShamWaveFunctions, const OpContext &M)
Definition: KohnShamEigenSolver.t.cpp:607
std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > d_mpiPatternP2P
Definition: KohnShamEigenSolver.h:204
const bool d_storeIntermediateSubspaces
Definition: KohnShamEigenSolver.h:232
bool d_isGHEP
Definition: KohnShamEigenSolver.h:243
double d_fracOccupancyTolerance
Definition: KohnShamEigenSolver.h:195
size_type d_chebyshevPolynomialDegree
Definition: KohnShamEigenSolver.h:198
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_waveFnBatchSmall
Definition: KohnShamEigenSolver.h:236
std::vector< RealType > getFractionalOccupancy()
Definition: KohnShamEigenSolver.t.cpp:594
linearAlgebra::MultiVector< ValueTypeOperand, memorySpace > * d_waveFunctionSubspaceGuess
Definition: KohnShamEigenSolver.h:202
double d_fermiEnergyTolerance
Definition: KohnShamEigenSolver.h:194
size_type d_batchSizeSmall
Definition: KohnShamEigenSolver.h:234
linearAlgebra::MultiVector< ValueType, memorySpace > * d_filteredSubspaceOrtho
Definition: KohnShamEigenSolver.h:228
const size_type d_numWantedEigenvalues
Definition: KohnShamEigenSolver.h:199
double d_wantedSpectrumUpperBound
Definition: KohnShamEigenSolver.h:216
utils::MemoryStorage< ValueType, memorySpace > d_nOnes
Definition: KohnShamEigenSolver.h:239
void printTotalInScopeTimings()
Definition: KohnShamEigenSolver.t.cpp:813
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
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:147