-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplugin.cc
117 lines (107 loc) · 4.23 KB
/
plugin.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* @BEGIN LICENSE
*
* mcpdft by Psi4 Developer, a plugin to:
*
* Psi4: an open-source quantum chemistry software package
*
* Copyright (c) 2007-2017 The Psi4 Developers.
*
* The copyrights for code used from other parties are included in
* the corresponding files.
*
* This file is part of Psi4.
*
* Psi4 is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 3.
*
* Psi4 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with Psi4; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* @END LICENSE
*/
#include "psi4/psi4-dec.h"
#include "psi4/libpsi4util/PsiOutStream.h"
#include "psi4/liboptions/liboptions.h"
#include "psi4/libmints/wavefunction.h"
#include "psi4/libpsio/psio.hpp"
#include "psi4/libpsio/psio.hpp"
#include <psi4/libpsi4util/process.h>
#include "mcpdft_solver.h"
namespace psi{ namespace mcpdft {
extern "C" PSI_API
int read_options(std::string name, Options& options)
{
if (name == "MCPDFT"|| options.read_globals()) {
/*- MCPDFT type -*/
options.add_str("MCPDFT_METHOD", "MCPDFT",
"MCPDFT \
1H_MCPDFT \
1DH_MCPDFT \
RS1H_MCPDFT \
RS1DH_MCPDFT \
LS1DH_MCPDFT \
LH_MCPDFT");
/*- The range-separation parameter -*/
options.add_double("MCPDFT_OMEGA", 0.0);
/*- Coupling parameter Lambda for hybrid MCPDFT functionals -*/
options.add_double("MCPDFT_LAMBDA", 0.00);
/*- Reference must be UKS -*/
options.add_str("REFERENCE", "UKS");
/*- The amount of information printed to the output file -*/
options.add_int("PRINT", 1);
/*- MCPDFT functional -*/
options.add_str("MCPDFT_FUNCTIONAL", "SVWN",
"SVWN \
PBE \
REVPBE \
BOP \
BLYP \
WPBE \
LRC_WPBE \
WBLYP");
/*- type of density and density gradient translation:
REGULAR = The gradients of on-top density are not considered in the polarization factor zeta
FULL = The gradients of on-top density is included in the polarization factor zeta -*/
options.add_str("MCPDFT_TRANSLATION_TYPE", "REGULAR", "REGULAR FULL");
/*- JK object type can be DF or PK -*/
options.add_str("MCPDFT_TYPE", "DF", "DF PK");
/*- reference type -*/
options.add_str("MCPDFT_REFERENCE", "V2RDM", "V2RDM CI");
/*- print QTAIM .wfn file? -*/
options.add_bool("WRITE_QTAIM_WFN",false);
/*- Construct effectively unpaired electron matrices, D(r) and U(r)? -*/
options.add_bool("POLYRADICAL_ANALYSIS", false);
}
return true;
}
extern "C" PSI_API
SharedWavefunction mcpdft(SharedWavefunction ref_wfn, Options& options)
{
outfile->Printf("\n\n");
outfile->Printf( " ********************************************************************\n");
outfile->Printf( " * *\n");
outfile->Printf( " * MCPDFT: Multiconfigurational Pair Density Functional Theory *\n");
outfile->Printf( " * *\n");
outfile->Printf( " * Mohammad Mostafanejad and A. Eugene DePrince III *\n");
outfile->Printf( " * *\n");
outfile->Printf( " ********************************************************************\n");
outfile->Printf("\n\n");
std::shared_ptr<MCPDFTSolver> dft (new MCPDFTSolver(ref_wfn,options));
double energy{0.0};
if (options.get_bool("POLYRADICAL_ANALYSIS"))
dft->polyradical_analysis();
else
energy = dft->compute_energy();
Process::environment.globals["CURRENT ENERGY"] = energy;
// TODO: return mcpdft wave function instead of reference
return ref_wfn;
}
}} // End namespaces