Skip to content

Commit

Permalink
Removed QMC_COMPLEX include guards on RotatedSPOs construction.
Browse files Browse the repository at this point in the history
  • Loading branch information
jptowns committed Nov 29, 2023
1 parent e3cc3e7 commit cbcea13
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
4 changes: 0 additions & 4 deletions src/QMCWaveFunctions/Fermion/DiracDeterminant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
#include "CPU/SIMD/inner_product.hpp"
#include "Numerics/MatrixOperators.h"
#include "QMCWaveFunctions/TWFFastDerivWrapper.h"
#ifndef QMC_COMPLEX
#include "QMCWaveFunctions/RotatedSPOs.h"
#endif

namespace qmcplusplus
{
Expand All @@ -44,11 +42,9 @@ DiracDeterminant<DU_TYPE>::DiracDeterminant(std::unique_ptr<SPOSet>&& spos,
{
resize(NumPtcls, NumPtcls);

#ifndef QMC_COMPLEX
RotatedSPOs* rot_spo = dynamic_cast<RotatedSPOs*>(Phi.get());
if (rot_spo)
rot_spo->buildOptVariables(NumPtcls);
#endif

if (Phi->getOrbitalSetSize() < NumPtcls)
{
Expand Down
16 changes: 1 addition & 15 deletions src/QMCWaveFunctions/SPOSetBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
#include "SPOSetBuilder.h"
#include "OhmmsData/AttributeSet.h"
#include <Message/UniformCommunicateError.h>

#if !defined(QMC_COMPLEX)
#include "QMCWaveFunctions/RotatedSPOs.h"
#endif

namespace qmcplusplus
{
Expand Down Expand Up @@ -91,12 +88,8 @@ std::unique_ptr<SPOSet> SPOSetBuilder::createSPOSet(xmlNodePtr cur)

if (optimize == "rotation" || optimize == "yes")
{
#ifdef QMC_COMPLEX
app_error() << "Orbital optimization via rotation doesn't support complex wavefunction yet.\n";
abort();
#else
app_warning() << "Specifying orbital rotation via optimize tag is deprecated. Use the rotated_spo element instead"
<< std::endl;
<< std::endl;

sposet->storeParamsBeforeRotation();
// create sposet with rotation
Expand All @@ -119,7 +112,6 @@ std::unique_ptr<SPOSet> SPOSetBuilder::createSPOSet(xmlNodePtr cur)
tcur = tcur->next;
}
sposet = std::move(rot_spo);
#endif
}

if (sposet->getName().empty())
Expand All @@ -141,11 +133,6 @@ std::unique_ptr<SPOSet> SPOSetBuilder::createRotatedSPOSet(xmlNodePtr cur)
attrib.add(method, "method", {"global", "history"});
attrib.put(cur);


#ifdef QMC_COMPLEX
myComm->barrier_and_abort("Orbital optimization via rotation doesn't support complex wavefunctions yet.");
return nullptr;
#else
std::unique_ptr<SPOSet> sposet;
processChildren(cur, [&](const std::string& cname, const xmlNodePtr element) {
if (cname == "sposet")
Expand Down Expand Up @@ -176,7 +163,6 @@ std::unique_ptr<SPOSet> SPOSetBuilder::createRotatedSPOSet(xmlNodePtr cur)
}
});
return rot_spo;
#endif
}

} // namespace qmcplusplus

0 comments on commit cbcea13

Please sign in to comment.