Loading docker/ci/ubuntu1804/base/Dockerfile +1 −1 Original line number Diff line number Diff line from xacc/ubuntu:18.04 run apt-get update && apt-get install -y ninja-build \ && git clone https://github.com/hfinkel/llvm-project-csp llvm \ && git clone https://github.com/ornl-qci/llvm-project-csp llvm \ && cd llvm && mkdir build && cd build \ && cmake -G Ninja ../llvm -DCMAKE_INSTALL_PREFIX=$HOME/.llvm -DBUILD_SHARED_LIBS=TRUE -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS=clang \ && cmake --build . --target install \ Loading docker/ci/ubuntu1804/master/Dockerfile +1 −1 Original line number Diff line number Diff line from qcor/qcor-base from qcor/deploy-base run git clone --recursive https://github.com/eclipse/xacc && cd xacc && mkdir build && cd build \ && cmake .. \ && make -j$(nproc) install Loading examples/unitary/ccnot.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,9 @@ __qpu__ void ccnot(qreg q) { } // To program at the unitary matrix level, // simply indicate you are using qcor::unitary namespace // invoke the decompose call, indicating which // buffer to target, can optionally provide decomposition // algorithm name and an optimizer. decompose { // Create the unitary matrix UnitaryMatrix ccnot = UnitaryMatrix::Identity(8, 8); Loading @@ -19,7 +21,7 @@ __qpu__ void ccnot(qreg q) { ccnot(6, 7) = 1.0; ccnot(7, 6) = 1.0; } (q, QFAST); (q); // Add some measures for (int i = 0; i < q.size(); i++) { Loading handlers/token_collector/token_collector_util.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -119,9 +119,15 @@ std::string run_token_collector(clang::Preprocessor &PP, i++; } if (arguments.size() < 1) { if (arguments.size() == 0) { xacc::error("Invalid decompose arguments, must at least provide the qreg variable"); } if (arguments.size() == 1) { arguments.push_back("QFAST"); } std::map<int, std::function<void(const std::string arg)>> arg_to_action{ {0, [&](const std::string arg) { Loading handlers/token_collector/unitary/unitary_token_collector.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -83,10 +83,18 @@ void UnitaryTokenCollector::collect(clang::Preprocessor &PP, } ss << "\n"; // Add the qfast decomp and hook up to the qrt program. const auto optimizer_provided = ss.str().find("decompose_optimizer = ") != std::string::npos; if (optimizer_provided) { ss << "auto decomposed_program = " "__internal__::decompose_unitary(decompose_algo_name, " << var_name << ", decompose_buffer_name, decompose_optimizer);\n"; } else { ss << "auto decomposed_program = " "__internal__::decompose_unitary(decompose_algo_name, " << var_name << ", decompose_buffer_name);\n"; } // Add the qfast decomp and hook up to the qrt program. ss << "parent_kernel->addInstruction(decomposed_program);\n"; } Loading Loading
docker/ci/ubuntu1804/base/Dockerfile +1 −1 Original line number Diff line number Diff line from xacc/ubuntu:18.04 run apt-get update && apt-get install -y ninja-build \ && git clone https://github.com/hfinkel/llvm-project-csp llvm \ && git clone https://github.com/ornl-qci/llvm-project-csp llvm \ && cd llvm && mkdir build && cd build \ && cmake -G Ninja ../llvm -DCMAKE_INSTALL_PREFIX=$HOME/.llvm -DBUILD_SHARED_LIBS=TRUE -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS=clang \ && cmake --build . --target install \ Loading
docker/ci/ubuntu1804/master/Dockerfile +1 −1 Original line number Diff line number Diff line from qcor/qcor-base from qcor/deploy-base run git clone --recursive https://github.com/eclipse/xacc && cd xacc && mkdir build && cd build \ && cmake .. \ && make -j$(nproc) install Loading
examples/unitary/ccnot.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,9 @@ __qpu__ void ccnot(qreg q) { } // To program at the unitary matrix level, // simply indicate you are using qcor::unitary namespace // invoke the decompose call, indicating which // buffer to target, can optionally provide decomposition // algorithm name and an optimizer. decompose { // Create the unitary matrix UnitaryMatrix ccnot = UnitaryMatrix::Identity(8, 8); Loading @@ -19,7 +21,7 @@ __qpu__ void ccnot(qreg q) { ccnot(6, 7) = 1.0; ccnot(7, 6) = 1.0; } (q, QFAST); (q); // Add some measures for (int i = 0; i < q.size(); i++) { Loading
handlers/token_collector/token_collector_util.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -119,9 +119,15 @@ std::string run_token_collector(clang::Preprocessor &PP, i++; } if (arguments.size() < 1) { if (arguments.size() == 0) { xacc::error("Invalid decompose arguments, must at least provide the qreg variable"); } if (arguments.size() == 1) { arguments.push_back("QFAST"); } std::map<int, std::function<void(const std::string arg)>> arg_to_action{ {0, [&](const std::string arg) { Loading
handlers/token_collector/unitary/unitary_token_collector.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -83,10 +83,18 @@ void UnitaryTokenCollector::collect(clang::Preprocessor &PP, } ss << "\n"; // Add the qfast decomp and hook up to the qrt program. const auto optimizer_provided = ss.str().find("decompose_optimizer = ") != std::string::npos; if (optimizer_provided) { ss << "auto decomposed_program = " "__internal__::decompose_unitary(decompose_algo_name, " << var_name << ", decompose_buffer_name, decompose_optimizer);\n"; } else { ss << "auto decomposed_program = " "__internal__::decompose_unitary(decompose_algo_name, " << var_name << ", decompose_buffer_name);\n"; } // Add the qfast decomp and hook up to the qrt program. ss << "parent_kernel->addInstruction(decomposed_program);\n"; } Loading