Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #4158

Merged
merged 6 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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