Loading examples/deuteron/deuteron_exp_inst.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -20,10 +20,10 @@ int main(int argc, char **argv) { auto optimizer = createOptimizer("nlopt"); // Optimize the above function auto result = optimizer->optimize(*objective.get()); auto [optval, opt_params] = optimizer->optimize(*objective.get()); // Print the result printf("energy = %f\n", result.first); printf("energy = %f\n", optval); return 0; } handlers/token_collector/staq/staq_token_collector.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -205,11 +205,11 @@ void StaqTokenCollector::collect(clang::Preprocessor &PP, } } std::cout << "FROM STAQ:\n" << sss.str() << "\n"; // std::cout << "FROM STAQ:\n" << sss.str() << "\n"; auto compiler = xacc::getCompiler("staq"); auto inst = compiler->compile(sss.str())->getComposites()[0]; std::cout << inst->toString() << "\n"; // std::cout << inst->toString() << "\n"; // Map this CompositeInstruction to QRT calls auto visitor = std::make_shared<qcor::qrt_mapper>(inst->name()); Loading python/examples/openfermion_integration.py +0 −3 Original line number Diff line number Diff line Loading @@ -18,9 +18,6 @@ H = FOp('', 0.0002899) + FOp('0^ 0', -.43658) + \ n_params = 1 obj = createObjectiveFunction(ansatz, H, n_params) # evaluate at a concrete set of params vqe_energy = obj([.59]) # Run full optimization optimizer = createOptimizer('nlopt') results = optimizer.optimize(obj) Loading python/py-qcor.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ class KernelArgDictToHeterogeneousMap { // Add type name to this list to support receiving from Python. using PyHeterogeneousMapTypes = xacc::Variant<bool, int, double, std::string, std::shared_ptr<qcor::Optimizer>, std::vector<double>>; std::shared_ptr<qcor::Optimizer>, std::vector<double>, std::vector<std::vector<double>>>; using PyHeterogeneousMap = std::map<std::string, PyHeterogeneousMapTypes>; // Helper to convert a Python *dict* (as a map of variants) into a native Loading Loading
examples/deuteron/deuteron_exp_inst.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -20,10 +20,10 @@ int main(int argc, char **argv) { auto optimizer = createOptimizer("nlopt"); // Optimize the above function auto result = optimizer->optimize(*objective.get()); auto [optval, opt_params] = optimizer->optimize(*objective.get()); // Print the result printf("energy = %f\n", result.first); printf("energy = %f\n", optval); return 0; }
handlers/token_collector/staq/staq_token_collector.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -205,11 +205,11 @@ void StaqTokenCollector::collect(clang::Preprocessor &PP, } } std::cout << "FROM STAQ:\n" << sss.str() << "\n"; // std::cout << "FROM STAQ:\n" << sss.str() << "\n"; auto compiler = xacc::getCompiler("staq"); auto inst = compiler->compile(sss.str())->getComposites()[0]; std::cout << inst->toString() << "\n"; // std::cout << inst->toString() << "\n"; // Map this CompositeInstruction to QRT calls auto visitor = std::make_shared<qcor::qrt_mapper>(inst->name()); Loading
python/examples/openfermion_integration.py +0 −3 Original line number Diff line number Diff line Loading @@ -18,9 +18,6 @@ H = FOp('', 0.0002899) + FOp('0^ 0', -.43658) + \ n_params = 1 obj = createObjectiveFunction(ansatz, H, n_params) # evaluate at a concrete set of params vqe_energy = obj([.59]) # Run full optimization optimizer = createOptimizer('nlopt') results = optimizer.optimize(obj) Loading
python/py-qcor.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ class KernelArgDictToHeterogeneousMap { // Add type name to this list to support receiving from Python. using PyHeterogeneousMapTypes = xacc::Variant<bool, int, double, std::string, std::shared_ptr<qcor::Optimizer>, std::vector<double>>; std::shared_ptr<qcor::Optimizer>, std::vector<double>, std::vector<std::vector<double>>>; using PyHeterogeneousMap = std::map<std::string, PyHeterogeneousMapTypes>; // Helper to convert a Python *dict* (as a map of variants) into a native Loading