Skip to content

Commit f7c7b59

Browse files
committed
incorporated PR comments
1 parent 2cac42f commit f7c7b59

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

external/upstream/fetch_mrcpp.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ else()
3939
GIT_REPOSITORY
4040
https://github.com/MRChemSoft/mrcpp.git
4141
GIT_TAG
42-
720133372c9717134c5a01e963cb9804a1e8c36e
42+
f9e50bae7c28ece70fa0c909e4be7170d406543a
4343
)
4444

4545
FetchContent_GetProperties(mrcpp_sources)

src/driver.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ bool guess_energy(const json &input, Molecule &mol, FockBuilder &F);
115115
void write_orbitals(const json &input, Molecule &mol);
116116
void calc_properties(const json &input, Molecule &mol);
117117
void plot_quantities(const json &input, Molecule &mol);
118+
bool _useExchange = false;
118119
} // namespace scf
119120

120121
namespace rsp {
@@ -255,7 +256,11 @@ json driver::scf::run(const json &json_scf, Molecule &mol) {
255256
OrbitalVector Phi_mom;
256257
if (scf::guess_orbitals(json_guess, json_occ, mol)) {
257258
if (json_scf.contains("scf_solver")) {
258-
if (json_scf["scf_solver"]["deltascf_method"] == "IMOM" || json_scf["scf_solver"]["deltascf_method"] == "MOM") Phi_mom = orbital::deep_copy(mol.getOrbitals());
259+
if (json_scf["scf_solver"]["deltascf_method"] == "IMOM" || json_scf["scf_solver"]["deltascf_method"] == "MOM") {
260+
if (_useExchange)
261+
MSG_ABORT("Running DeltaSCF calculations with exact exchange is currently not supported!");
262+
Phi_mom = orbital::deep_copy(mol.getOrbitals());
263+
}
259264
}
260265
scf::guess_energy(json_guess, mol, F);
261266
json_out["initial_energy"] = mol.getSCFEnergy().json();
@@ -1275,6 +1280,7 @@ void driver::build_fock_operator(const json &json_fock, Molecule &mol, FockBuild
12751280
auto K_p = std::make_shared<ExchangeOperator>(P_p, Phi_p, X_p, Y_p, exchange_prec);
12761281
F.getExchangeOperator() = K_p;
12771282
}
1283+
scf::_useExchange = true; // determine if exact exchange is used in order to prevent MOM/IMOM calculations
12781284
}
12791285
///////////////////////////////////////////////////////////
12801286
///////////////// External Operator ///////////////////

src/scf_solver/GroundStateSolver.cpp

+8-10
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,10 @@ json GroundStateSolver::optimize(Molecule &mol, FockBuilder &F, OrbitalVector &P
324324
if (restricted) {
325325
DoubleVector occNew = getNewOccupations(Phi_n, Phi_mom);
326326
orbital::set_occupations(Phi_n, occNew);
327-
if (plevel > 1) {
328-
orbital::print(Phi_n);
329-
mol.calculateOrbitalPositions();
330-
mol.printOrbitalPositions();
331-
}
327+
// ToDo: output depending on print level
328+
orbital::print(Phi_n);
329+
mol.calculateOrbitalPositions();
330+
mol.printOrbitalPositions();
332331
}
333332
else {
334333
// in case of unrestricted calculation, get the new occupation for alpha and beta spins independently
@@ -341,11 +340,10 @@ json GroundStateSolver::optimize(Molecule &mol, FockBuilder &F, OrbitalVector &P
341340
DoubleVector occNew(occAlpha.size() + occBeta.size());
342341
occNew << occAlpha, occBeta;
343342
orbital::set_occupations(Phi_n, occNew);
344-
if (plevel > 1) {
345-
orbital::print(Phi_n);
346-
mol.calculateOrbitalPositions();
347-
mol.printOrbitalPositions();
348-
}
343+
// ToDo: output depending on print level
344+
orbital::print(Phi_n);
345+
mol.calculateOrbitalPositions();
346+
mol.printOrbitalPositions();
349347
}
350348
}
351349

0 commit comments

Comments
 (0)