GQCP
Loading...
Searching...
No Matches
DavidsonSolver.hpp
Go to the documentation of this file.
1// This file is part of GQCG-GQCP.
2//
3// Copyright (C) 2017-2020 the GQCG developers
4//
5// GQCG-GQCP is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// GQCG-GQCP is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with GQCG-GQCP. If not, see <http://www.gnu.org/licenses/>.
17
18#pragma once
19
20
32
33
34namespace GQCP {
35namespace EigenproblemSolver {
36
37
48IterativeAlgorithm<EigenproblemEnvironment<double>> Davidson(const size_t number_of_requested_eigenpairs = 1, const size_t maximum_subspace_dimension = 15, const double convergence_threshold = 1.0e-08, double correction_threshold = 1.0e-12, const size_t maximum_number_of_iterations = 128, const double inclusion_threshold = 1.0e-03) {
49
50 // Create the iteration cycle that effectively 'defines' our Davidson solver
52
53 davidson_cycle
56 .add(SubspaceMatrixDiagonalization(number_of_requested_eigenpairs))
57 .add(GuessVectorUpdate())
58 .add(ResidualVectorCalculation(number_of_requested_eigenpairs))
59 .add(CorrectionVectorCalculation(number_of_requested_eigenpairs, correction_threshold)) // this solves the residual equations
60 .add(SubspaceUpdate(maximum_subspace_dimension, inclusion_threshold));
61
62 // Create a convergence criterion on the norm of the residual vectors
63 const ResidualVectorConvergence<EigenproblemEnvironment<double>> convergence_criterion {convergence_threshold};
64
65 return IterativeAlgorithm<EigenproblemEnvironment<double>>(davidson_cycle, convergence_criterion, maximum_number_of_iterations);
66}
67
68
69} // namespace EigenproblemSolver
70} // namespace GQCP
Definition: CorrectionVectorCalculation.hpp:32
Definition: GuessVectorUpdate.hpp:32
Definition: IterativeAlgorithm.hpp:38
Definition: MatrixVectorProductCalculation.hpp:34
Definition: ResidualVectorCalculation.hpp:32
Definition: ResidualVectorConvergence.hpp:34
Definition: StepCollection.hpp:41
enable_if_t< std::is_same< Environment, typename Z::Environment >::value, StepCollection< Environment > & > add(const Z &step)
Definition: StepCollection.hpp:92
Definition: SubspaceMatrixCalculation.hpp:34
Definition: SubspaceMatrixDiagonalization.hpp:35
Definition: SubspaceUpdate.hpp:32
IterativeAlgorithm< EigenproblemEnvironment< double > > Davidson(const size_t number_of_requested_eigenpairs=1, const size_t maximum_subspace_dimension=15, const double convergence_threshold=1.0e-08, double correction_threshold=1.0e-12, const size_t maximum_number_of_iterations=128, const double inclusion_threshold=1.0e-03)
Definition: DavidsonSolver.hpp:48
Definition: BaseOneElectronIntegralBuffer.hpp:25