Skip to content

Commit

Permalink
Merge pull request #4158 from ye-luo/fix-excited
Browse files Browse the repository at this point in the history
Fix excited states in splines when spin-up/down sets are built from the same spin species and occupation is specified on the first sposet
  • Loading branch information
ye-luo authored Aug 10, 2022
2 parents 6c09b89 + 711c34e commit a58ef79
Show file tree
Hide file tree
Showing 5 changed files with 225 additions and 225 deletions.
1 change: 1 addition & 0 deletions src/QMCWaveFunctions/EinsplineSetBuilderESHDF.fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ void EinsplineSetBuilder::OccupyBands_ESHDF(int spin, int sortBands, int numOrbs
}
if (occ_format == "energy")
{
app_log() << " Occupying bands based on energy in mode " << (Occ.size() > 0? "\"excited\"" : "\"ground\"") << std::endl;
// To get the occupations right.
std::vector<int> Removed(0, 0);
std::vector<int> Added(0, 0);
Expand Down
7 changes: 3 additions & 4 deletions src/QMCWaveFunctions/EinsplineSetBuilder_createSPOs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ std::unique_ptr<SPOSet> EinsplineSetBuilder::createSPOSetFromXML(xmlNodePtr cur)
///////////////////////////////////////////////
// Read occupation information from XML file //
///////////////////////////////////////////////
std::vector<int> Occ_Old(0, 0);
Occ.resize(0, 0);
const std::vector<int> last_occ(Occ);
Occ.resize(0, 0); // correspond to ground
bool NewOcc(false);

{
Expand Down Expand Up @@ -210,10 +210,9 @@ std::unique_ptr<SPOSet> EinsplineSetBuilder::createSPOSetFromXML(xmlNodePtr cur)
}
cur = cur->next;
}
if (Occ != Occ_Old)
if (Occ != last_occ)
{
NewOcc = true;
Occ_Old = Occ;
}
else
NewOcc = false;
Expand Down
8 changes: 4 additions & 4 deletions src/QMCWaveFunctions/EinsplineSpinorSetBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ std::unique_ptr<SPOSet> EinsplineSpinorSetBuilder::createSPOSetFromXML(xmlNodePt
///////////////////////////////////////////////
// Read occupation information from XML file //
///////////////////////////////////////////////
std::vector<int> Occ_Old(0, 0);
Occ.resize(0, 0);
const std::vector<int> last_occ(Occ);
Occ.resize(0, 0); // correspond to ground
bool NewOcc(false);

{
Expand Down Expand Up @@ -117,10 +117,10 @@ std::unique_ptr<SPOSet> EinsplineSpinorSetBuilder::createSPOSetFromXML(xmlNodePt
}
cur = cur->next;
}
if (Occ != Occ_Old)

if (Occ != last_occ)
{
NewOcc = true;
Occ_Old = Occ;
}
else
NewOcc = false;
Expand Down
136 changes: 68 additions & 68 deletions tests/solids/diamondC_1x1x1_pp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1151,27 +1151,27 @@ if(NOT QMC_CUDA)
)

if(QMC_MIXED_PRECISION)
list(APPEND DET_DIAMOND_EXCITED_SCALARS "totenergy" "-9.41184528 0.00001992")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "kinetic" "12.45900142 0.00001980")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "potential" "-21.87084670 0.00001931")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "eeenergy" "-2.52408721 0.00001190")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "ionion" "-12.77567000 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "localecp" "-6.28770825 0.00001516")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "nonlocalecp" "-0.28338106 0.00000595")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "mpc" "-2.25993608 0.00001149")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "totenergy" "-10.14873515 0.00001992")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "kinetic" "14.67050590 0.00001980")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "potential" "-24.81924106 0.00001931")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "eeenergy" "-3.54361899 0.00001190")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "ionion" "-12.77567050 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "localecp" "-8.35089725 0.00001516")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "nonlocalecp" "-0.14905431 0.00002")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "mpc" "-3.24606471 0.00001149")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "samples" "9 0.0")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "flux" "-14.97659183 0.00004665")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "flux" "-3.81746292 0.00004665")
else()
list(APPEND DET_DIAMOND_EXCITED_SCALARS "totenergy" "-9.41183124 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "kinetic" "12.45901380 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "potential" "-21.87084504 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "eeenergy" "-2.52408475 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "ionion" "-12.77567000 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "localecp" "-6.28771209 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "nonlocalecp" "-0.28338076 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "mpc" "-2.25993371 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "totenergy" "-10.14872875 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "kinetic" "14.67051169 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "potential" "-24.81924044 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "eeenergy" "-3.54361900 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "ionion" "-12.77566767 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "localecp" "-8.35088811 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "nonlocalecp" "-0.14906566 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "mpc" "-3.24606659 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "samples" "9 0.0")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "flux" "-14.97660158 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "flux" "-3.81745231 0.000001")
endif()

qmc_run_and_check(
Expand Down Expand Up @@ -1295,24 +1295,24 @@ if(NOT QMC_CUDA)
)

if(QMC_MIXED_PRECISION)
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "totenergy" "-9.53268532 0.00001562")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "kinetic" "10.18368670 0.00001143")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "potential" "-19.71637202 0.00000463")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "eeenergy" "-2.38849840 0.00000125")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "ionion" "-12.77567000 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "localecp" "-4.96629415 0.0000047")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "nonlocalecp" "0.41409069 0.000001 ")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "mpc" "-2.00359004 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "totenergy" "-9.83788669 0.00001562")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "kinetic" "9.63546916 0.00001143")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "potential" "-19.47335586 0.00000463")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "eeenergy" "-2.70238228 0.00000125")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "ionion" "-12.77567050 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "localecp" "-4.36957276 0.0000047")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "nonlocalecp" "0.37426968 0.000001 ")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "mpc" "-2.42116567 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "samples" "9 0.0")
else()
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "totenergy" "-9.53268995 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "kinetic" "10.18368235 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "potential" "-19.71637230 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "eeenergy" "-2.38849743 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "ionion" "-12.77567000 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "localecp" "-4.96629755 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "nonlocalecp" "0.41409012 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "mpc" "-2.00358802 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "totenergy" "-9.83788331 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "kinetic" "9.63547298 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "potential" "-19.47335629 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "eeenergy" "-2.70238234 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "ionion" "-12.77566767 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "localecp" "-4.36957578 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "nonlocalecp" "0.37426950 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "mpc" "-2.421165687 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "samples" "9 0.0")
endif()

Expand Down Expand Up @@ -1831,27 +1831,27 @@ else()
)

if(QMC_MIXED_PRECISION)
list(APPEND DET_DIAMOND_EXCITED_SCALARS "totenergy" "-9.95745569 0.00002")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "kinetic" "10.21668907 0.00001385")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "potential" "-20.17414476 0.000003")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "eeenergy" "-4.02104702 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "ionion" "-12.77567000 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "localecp" "-3.57226857 0.00000228")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "nonlocalecp" "0.19483814 0.00000166")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "mpc" "-3.62855170 0.0000011")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "totenergy" "-10.81024057 0.00002")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "kinetic" "7.82750187 0.00001385")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "potential" "-18.63774243 0.000003")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "eeenergy" "-3.34229714 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "ionion" "-12.77566736 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "localecp" "-3.05848951 0.00000228")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "nonlocalecp" "0.53871159 0.00000166")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "mpc" "-3.08131288 0.0000011")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "samples" "9 0.0")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "flux" "-3.42024391 0.00002337")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "flux" "6.94056030 0.00002337")
else()
list(APPEND DET_DIAMOND_EXCITED_SCALARS "totenergy" "-9.95744357 0.00001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "kinetic" "10.21669957 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "potential" "-20.17414314 0.000005")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "eeenergy" "-4.02104723 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "ionion" "-12.77567000 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "localecp" "-3.57227218 0.000005")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "nonlocalecp" "0.19484358 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "mpc" "-3.62855318 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "totenergy" "-10.81025508 0.00001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "kinetic" "7.82748481 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "potential" "-18.63773988 0.000005")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "eeenergy" "-3.34229762 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "ionion" "-12.77566736 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "localecp" "-3.05848319 0.000005")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "nonlocalecp" "0.53870829 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "mpc" "-3.08131298 0.000001")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "samples" "9 0.0")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "flux" "-3.42019506 0.000004")
list(APPEND DET_DIAMOND_EXCITED_SCALARS "flux" "6.94056450 0.000004")
endif()

qmc_run_and_check(
Expand Down Expand Up @@ -1937,24 +1937,24 @@ else()
)

if(QMC_MIXED_PRECISION)
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "totenergy" "-9.21905229 0.00002")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "kinetic" "15.42550061 0.000007")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "potential" "-24.64455290 0.00002")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "eeenergy" "-3.60278140 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "ionion" "-12.77567000 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "localecp" "-5.26184234 0.00002")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "nonlocalecp" "-3.00426184 0.00001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "mpc" "-3.24225487 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "totenergy" "-9.22093805 0.00002")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "kinetic" "13.08373893 0.000007")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "potential" "-22.30467698 0.00002")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "eeenergy" "-3.59062633 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "ionion" "-12.77566736 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "localecp" "-5.11984833 0.00002")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "nonlocalecp" "-0.81853496 0.00001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "mpc" "-3.26087135 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "samples" "9 0.0")
else()
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "totenergy" "-9.21905527 0.00001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "kinetic" "15.42549492 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "potential" "-24.64455020 0.00001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "eeenergy" "-3.60278146 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "ionion" "-12.77567000 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "localecp" "-5.26184183 0.00001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "nonlocalecp" "-3.00425958 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "mpc" "-3.24225511 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "totenergy" "-9.22093528 0.00001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "kinetic" "13.08374229 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "potential" "-22.30467757 0.00001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "eeenergy" "-3.59062641 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "ionion" "-12.77566736 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "localecp" "-5.11984842 0.00001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "nonlocalecp" "-0.81853538 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "mpc" "-3.26087164 0.000001")
list(APPEND DET_DIAMOND_DMC_EXCITED_SCALARS "samples" "9 0.0")
endif()

Expand Down
Loading

0 comments on commit a58ef79

Please sign in to comment.