Loading compiler/qcor_ast_visitor.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ #include "xacc.hpp" #include "xacc_service.hpp" // #include "qcor.hpp" #include "clang/AST/Decl.h" #include "clang/AST/Expr.h" #include "clang/Basic/IdentifierTable.h" Loading Loading @@ -163,7 +162,6 @@ bool QCORASTVisitor::VisitLambdaExpr(LambdaExpr *LE) { function->persist(ss); std::string replacement = "\n{std::istringstream iss(R\"(" + ss.str() + ")\");\n"; // "{\nauto irstr = R\"irstr(" + ss.str() + ")irstr\";\n"; replacement += "auto function = " "xacc::getIRProvider(\"quantum\")->createComposite(\"f\");\n"; Loading examples/bell_state.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ int main(int argc, char** argv) { qcor::Initialize(argc, argv); auto future = qcor::submit([&](qcor::qpu_handler &qh) { auto handle = qcor::submit([&](qcor::qpu_handler &qh) { qh.execute([&](qbit q) { H(q[0]); CX(q[0], q[1]); Loading @@ -16,6 +16,6 @@ int main(int argc, char** argv) { // You just launched an async call, // go do other work if necessary... auto results = future.get(); auto results = qcor::sync(handle); results->print(); } examples/deuteronH2.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -21,11 +21,12 @@ int main(int argc, char **argv) { // Schedule an asynchronous VQE execution // with the given quantum kernel ansatz auto future = qcor::submit([&](qcor::qpu_handler &qh) { auto handle = qcor::submit([&](qcor::qpu_handler &qh) { qh.vqe(ansatz, observable, optimizer, std::vector<double>{.5}); }); auto results = future.get(); auto results = qcor::sync(handle); std::cout << results->getInformation("opt-val").as<double>() << "\n"; } examples/deuteron_H2_expgen.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ int main(int argc, char **argv) { qcor::getObservable("pauli", std::string("5.907 - 2.1433 X0X1 " "- 2.1433 Y0Y1" "+ .21829 Z0 - 6.125 Z1")); auto future = qcor::submit([&](qcor::qpu_handler &qh) { auto handle = qcor::submit([&](qcor::qpu_handler &qh) { qh.vqe( [&](qbit q, double x) { X(q[0]); Loading @@ -21,7 +21,7 @@ int main(int argc, char **argv) { observable, optimizer, 0.0); }); auto results = future.get(); auto results = qcor::sync(handle); auto energy = results->getInformation("opt-val").as<double>(); std::cout << "Results: " << energy << "\n"; Loading examples/deuteron_H2_from_fermion_expgen.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ int main(int argc, char **argv) { "- 2.1433 Y0Y1" "+ .21829 Z0 - 6.125 Z1")); auto future = qcor::submit([&](qcor::qpu_handler &qh) { auto handle = qcor::submit([&](qcor::qpu_handler &qh) { qh.vqe( [&](qbit q, double x) { X(q[0]); Loading @@ -22,7 +22,7 @@ int main(int argc, char **argv) { observable, optimizer, 0.0); }); auto results = future.get(); auto results = qcor::sync(handle); auto energy = results->getInformation("opt-val").as<double>(); std::cout << "Results: " << energy << "\n"; } Loading
compiler/qcor_ast_visitor.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ #include "xacc.hpp" #include "xacc_service.hpp" // #include "qcor.hpp" #include "clang/AST/Decl.h" #include "clang/AST/Expr.h" #include "clang/Basic/IdentifierTable.h" Loading Loading @@ -163,7 +162,6 @@ bool QCORASTVisitor::VisitLambdaExpr(LambdaExpr *LE) { function->persist(ss); std::string replacement = "\n{std::istringstream iss(R\"(" + ss.str() + ")\");\n"; // "{\nauto irstr = R\"irstr(" + ss.str() + ")irstr\";\n"; replacement += "auto function = " "xacc::getIRProvider(\"quantum\")->createComposite(\"f\");\n"; Loading
examples/bell_state.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ int main(int argc, char** argv) { qcor::Initialize(argc, argv); auto future = qcor::submit([&](qcor::qpu_handler &qh) { auto handle = qcor::submit([&](qcor::qpu_handler &qh) { qh.execute([&](qbit q) { H(q[0]); CX(q[0], q[1]); Loading @@ -16,6 +16,6 @@ int main(int argc, char** argv) { // You just launched an async call, // go do other work if necessary... auto results = future.get(); auto results = qcor::sync(handle); results->print(); }
examples/deuteronH2.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -21,11 +21,12 @@ int main(int argc, char **argv) { // Schedule an asynchronous VQE execution // with the given quantum kernel ansatz auto future = qcor::submit([&](qcor::qpu_handler &qh) { auto handle = qcor::submit([&](qcor::qpu_handler &qh) { qh.vqe(ansatz, observable, optimizer, std::vector<double>{.5}); }); auto results = future.get(); auto results = qcor::sync(handle); std::cout << results->getInformation("opt-val").as<double>() << "\n"; }
examples/deuteron_H2_expgen.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ int main(int argc, char **argv) { qcor::getObservable("pauli", std::string("5.907 - 2.1433 X0X1 " "- 2.1433 Y0Y1" "+ .21829 Z0 - 6.125 Z1")); auto future = qcor::submit([&](qcor::qpu_handler &qh) { auto handle = qcor::submit([&](qcor::qpu_handler &qh) { qh.vqe( [&](qbit q, double x) { X(q[0]); Loading @@ -21,7 +21,7 @@ int main(int argc, char **argv) { observable, optimizer, 0.0); }); auto results = future.get(); auto results = qcor::sync(handle); auto energy = results->getInformation("opt-val").as<double>(); std::cout << "Results: " << energy << "\n"; Loading
examples/deuteron_H2_from_fermion_expgen.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ int main(int argc, char **argv) { "- 2.1433 Y0Y1" "+ .21829 Z0 - 6.125 Z1")); auto future = qcor::submit([&](qcor::qpu_handler &qh) { auto handle = qcor::submit([&](qcor::qpu_handler &qh) { qh.vqe( [&](qbit q, double x) { X(q[0]); Loading @@ -22,7 +22,7 @@ int main(int argc, char **argv) { observable, optimizer, 0.0); }); auto results = future.get(); auto results = qcor::sync(handle); auto energy = results->getInformation("opt-val").as<double>(); std::cout << "Results: " << energy << "\n"; }