GQCP
Loading...
Searching...
No Matches
PSEnvironment.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
24
25
26namespace GQCP {
27namespace PSEnvironment {
28
29
38template <typename Scalar>
40
41 const auto N_P = G_initial.numberOfElectronPairs();
42
43 const auto initial_guess = G_initial.asVector(); // column major
44 const auto f_callable = QCModel::AP1roG::callablePSECoordinateFunctions(sq_hamiltonian, N_P);
45 const auto J_callable = QCModel::AP1roG::callablePSEJacobian(sq_hamiltonian, N_P);
46
47 return GQCP::NonLinearEquationEnvironment<Scalar>(initial_guess, f_callable, J_callable);
48}
49
50
59template <typename Scalar>
60NonLinearEquationEnvironment<Scalar> AP1roG(const RSQHamiltonian<Scalar>& sq_hamiltonian, const size_t N_P) {
61
62 const auto K = sq_hamiltonian.numberOfOrbitals(); // number of spatial orbitals
63 const AP1roGGeminalCoefficients G_initial {N_P, K}; // geminal coefficients set to zero
64
65 return GQCP::PSEnvironment::AP1roG<Scalar>(sq_hamiltonian, G_initial);
66}
67
68
69} // namespace PSEnvironment
70} // namespace GQCP
Definition: AP1roGGeminalCoefficients.hpp:34
size_t numberOfElectronPairs() const
Definition: AP1roGGeminalCoefficients.hpp:140
VectorX< double > asVector() const
Definition: AP1roGGeminalCoefficients.hpp:130
Definition: NonLinearEquationEnvironment.hpp:35
static MatrixFunction< double > callablePSEJacobian(const RSQHamiltonian< double > &sq_hamiltonian, const size_t N_P)
Definition: AP1roG.cpp:269
static VectorFunction< double > callablePSECoordinateFunctions(const RSQHamiltonian< double > &sq_hamiltonian, const size_t N_P)
Definition: AP1roG.cpp:155
Definition: SQHamiltonian.hpp:54
size_t numberOfOrbitals() const
Definition: SQHamiltonian.hpp:363
NonLinearEquationEnvironment< Scalar > AP1roG(const RSQHamiltonian< Scalar > &sq_hamiltonian, const AP1roGGeminalCoefficients &G_initial)
Definition: PSEnvironment.hpp:39
Definition: BaseOneElectronIntegralBuffer.hpp:25