Commit 5698571f authored by Nguyen, Thien's avatar Nguyen, Thien
Browse files

Added analytical result to buffer


Signed-off-by: Nguyen, Thien's avatarThien Nguyen <nguyentm@ornl.gov>
parent 16c22bdf
......@@ -584,6 +584,13 @@ void QITE::execute(const std::shared_ptr<AcceleratorBuffer> buffer) const
const std::complex<double> energyRaw = arma::cdot(psiUpdate, hMat*psiUpdate);
std::cout << "Energy = " << energyRaw << "\n";
m_energyAtStep.emplace_back(energyRaw.real());
// First step: add the approximate operator info to the buffer.
// Users can use this analytical solver to compute the A operator:
// e.g. for deuteron problems, we can recover the UCC ansatz by QITE.
if (i==0)
{
buffer->addExtraInfo("A-op", updatedAham->toString());
}
}
m_energyAtStep.emplace_back(m_energyAtStep.back());
......
......@@ -71,6 +71,7 @@ TEST(QITETester, checkDeuteuronH2)
const double finalEnergy = (*buffer)["opt-val"].as<double>();
std::cout << "Final Energy: " << finalEnergy << "\n";
EXPECT_NEAR(finalEnergy, -1.74886, 1e-3);
buffer->print();
}
TEST(QITETester, checkDeuteuronH3)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment