Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
Format code using clang-format version 12.0.0 (Fedora 12.0.0-0.3.rc1.…
Browse files Browse the repository at this point in the history
…fc34)
  • Loading branch information
votca-bot committed Jun 9, 2021
1 parent 5719da6 commit d5b87cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 25 deletions.
3 changes: 1 addition & 2 deletions src/libxtp/gwbse/gwbse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ void GWBSE::Initialize(tools::Property& options) {
<< TimeStamp() << " BSE level range occ[" << bse_vmin << ":" << bse_vmax
<< "] virt[" << bse_cmin << ":" << bse_cmax << "]" << flush;


_gwopt.reset_3c = options.get(key + ".rebuild_threecenter_freq").as<Index>();

_bseopt.nmax = options.get(key + ".exctotal").as<Index>();
Expand Down Expand Up @@ -221,7 +220,7 @@ void GWBSE::Initialize(tools::Property& options) {
XTP_LOG(Log::error, *_pLog) << " BSE type: TDA" << flush;
}

Index full_bse_size=(_bseopt.useTDA)? bse_size: 2*bse_size;
Index full_bse_size = (_bseopt.useTDA) ? bse_size : 2 * bse_size;
XTP_LOG(Log::error, *_pLog) << TimeStamp() << " BSE Hamiltonian has size "
<< full_bse_size << "x" << full_bse_size << flush;

Expand Down
34 changes: 13 additions & 21 deletions src/libxtp/jobcalculators/iqm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ double IQM::GetBSECouplingFromProp(const tools::Property& bseprop,
std::string algorithm = bseprop.getAttribute<std::string>("algorithm");
bool found = false;
for (const tools::Property* state : bseprop.Select("coupling")) {
QMState state1=state->getAttribute<QMState>("stateA");
QMState state2=state->getAttribute<QMState>("stateB");
QMState state1 = state->getAttribute<QMState>("stateA");
QMState state2 = state->getAttribute<QMState>("stateB");
if (state1 == stateA && state2 == stateB) {
J = state->getAttribute<double>(algorithm) * tools::conv::ev2hrt;
found = true;
Expand Down Expand Up @@ -689,7 +689,7 @@ void IQM::ReadJobFile(Topology& top) {
tools::Property xml;
// load the QC results in a vector indexed by the pair ID
xml.LoadFromXML(_jobfile);

// loop over all jobs = pair records in the job file
for (tools::Property* job : xml.Select("jobs.job")) {
if (!job->exists("status")) {
Expand Down Expand Up @@ -724,19 +724,17 @@ void IQM::ReadJobFile(Topology& top) {
XTP_LOG(Log::error, log)
<< "No pair " << id[0] << ":" << id[1]
<< " found in the neighbor list. Ignoring" << std::flush;
continue;
continue;
}
if (qmp->getType() != QMPair::PairType::Hopping) {
if (qmp->getType() != QMPair::PairType::Hopping) {
XTP_LOG(Log::error, log) << "WARNING Pair " << qmp->getId()
<< " is not of any of the "
"Hopping type. Skipping pair"
<< std::flush;
continue;
}


const tools::Property& pair_property=job->get("output");

const tools::Property& pair_property = job->get("output");

if (pair_property.exists("dftcoupling")) {
const tools::Property& dftprop = pair_property.get("dftcoupling");
Expand All @@ -758,10 +756,8 @@ void IQM::ReadJobFile(Topology& top) {
QMStateType electron = QMStateType(QMStateType::Electron);
if (dftprop.exists(electron.ToLongString())) {
const tools::Property& electrons = dftprop.get(electron.ToLongString());
QMState stateA =
GetElementFromMap(_electron_levels, segA.getType());
QMState stateB =
GetElementFromMap(_electron_levels, segB.getType());
QMState stateA = GetElementFromMap(_electron_levels, segA.getType());
QMState stateB = GetElementFromMap(_electron_levels, segB.getType());
Index levelA = homoA + 1 + stateA.StateIdx(); // e1 is lumo;
Index levelB = homoB + 1 + stateB.StateIdx();
double J2 = GetDFTCouplingFromProp(electrons, levelA, levelB);
Expand All @@ -776,10 +772,8 @@ void IQM::ReadJobFile(Topology& top) {
QMStateType singlet = QMStateType(QMStateType::Singlet);
if (bseprop.exists(singlet.ToLongString())) {
const tools::Property& singlets = bseprop.get(singlet.ToLongString());
QMState stateA =
GetElementFromMap(_singlet_levels, segA.getType());
QMState stateB =
GetElementFromMap(_singlet_levels, segB.getType());
QMState stateA = GetElementFromMap(_singlet_levels, segA.getType());
QMState stateB = GetElementFromMap(_singlet_levels, segB.getType());
double J2 = GetBSECouplingFromProp(singlets, stateA, stateB);
if (J2 >= 0) {
qmp->setJeff2(J2, singlet);
Expand All @@ -789,10 +783,8 @@ void IQM::ReadJobFile(Topology& top) {
QMStateType triplet = QMStateType(QMStateType::Triplet);
if (bseprop.exists(triplet.ToLongString())) {
const tools::Property& triplets = bseprop.get(triplet.ToLongString());
QMState stateA =
GetElementFromMap(_triplet_levels, segA.getType());
QMState stateB =
GetElementFromMap(_triplet_levels, segB.getType());
QMState stateA = GetElementFromMap(_triplet_levels, segA.getType());
QMState stateB = GetElementFromMap(_triplet_levels, segB.getType());
double J2 = GetBSECouplingFromProp(triplets, stateA, stateB);
if (J2 >= 0) {
qmp->setJeff2(J2, triplet);
Expand All @@ -806,7 +798,7 @@ void IQM::ReadJobFile(Topology& top) {
<< "," << bse_s << "," << bse_t
<< ") Incomplete jobs: " << incomplete_jobs << "\n"
<< std::flush;
std::cout<<log;
std::cout << log;
return;
}
} // namespace xtp
Expand Down
4 changes: 2 additions & 2 deletions src/libxtp/jobcalculators/iqm.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class IQM final : public ParallelXJobCalc<std::vector<Job> > {
void ParseSpecificOptions(const tools::Property& user_options);

private:
double GetBSECouplingFromProp(const tools::Property& bseprop, const QMState& stateA,
const QMState& stateB);
double GetBSECouplingFromProp(const tools::Property& bseprop,
const QMState& stateA, const QMState& stateB);
double GetDFTCouplingFromProp(const tools::Property& dftprop, Index stateA,
Index stateB);
void SetJobToFailed(Job::JobResult& jres, Logger& pLog,
Expand Down

0 comments on commit d5b87cc

Please sign in to comment.