Commit bbff4bcf authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

fixing memory bug in vqe


Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 98ce4318
Pipeline #65277 passed with stage
in 6 minutes and 18 seconds
......@@ -23,7 +23,7 @@ bool VQE::initialize(const AlgorithmParameters &parameters) {
try {
observable = parameters.at("observable").as_no_error<std::shared_ptr<Observable>>();
} catch (std::exception &e) {
observable = std::shared_ptr<Observable>(parameters.at("observable").as<Observable*>());
observable = std::shared_ptr<Observable>(parameters.at("observable").as<Observable*>(), [](Observable*){});
}
optimizer = parameters.at("optimizer").as<std::shared_ptr<Optimizer>>();
kernel = parameters.at("ansatz").as<std::shared_ptr<Function>>();
......
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