Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
32f63251
Commit
32f63251
authored
May 27, 2020
by
Mccaskey, Alex
Browse files
fixing bug in vqe kernel evaluation, where kernel has no params and vec is empty
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
616280e5
Pipeline
#103867
passed with stage
in 8 minutes and 9 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
quantum/plugins/algorithms/vqe/vqe.cpp
View file @
32f63251
...
...
@@ -79,8 +79,12 @@ void VQE::execute(const std::shared_ptr<AcceleratorBuffer> buffer) const {
}
if
(
nFunctionInstructions
>
kernel
->
nInstructions
())
{
if
(
x
.
empty
())
{
fsToExec
.
push_back
(
f
);
}
else
{
auto
evaled
=
f
->
operator
()(
x
);
fsToExec
.
push_back
(
evaled
);
}
coefficients
.
push_back
(
std
::
real
(
coeff
));
}
else
{
identityCoeff
+=
std
::
real
(
coeff
);
...
...
@@ -160,8 +164,12 @@ VQE::execute(const std::shared_ptr<AcceleratorBuffer> buffer,
}
if
(
nFunctionInstructions
>
kernel
->
nInstructions
())
{
if
(
x
.
empty
())
{
fsToExec
.
push_back
(
f
);
}
else
{
auto
evaled
=
f
->
operator
()(
x
);
fsToExec
.
push_back
(
evaled
);
}
coefficients
.
push_back
(
std
::
real
(
coeff
));
}
else
{
identityCoeff
+=
std
::
real
(
coeff
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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