Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
5698571f
Commit
5698571f
authored
Jun 15, 2020
by
Nguyen, Thien Minh
Browse files
Added analytical result to buffer
Signed-off-by:
Thien Nguyen
<
nguyentm@ornl.gov
>
parent
16c22bdf
Changes
2
Hide whitespace changes
Inline
Side-by-side
quantum/plugins/algorithms/qite/qite.cpp
View file @
5698571f
...
...
@@ -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
());
...
...
quantum/plugins/algorithms/qite/tests/QITETester.cpp
View file @
5698571f
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment