We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CUDA-QUANTUM version: 0.8.0 OS: Amazon Linux 2023 x86_64
Looking the basic C++ GHZ script:
#include <cudaq.h> template <std::size_t N> struct ghz { auto operator()() __qpu__ { cudaq::qarray<N> q; h(q[0]); for (int i = 0; i < N - 1; i++) { x<cudaq::ctrl>(q[i], q[i + 1]); } mz(q); } }; int main() { auto kernel = ghz<10>{}; auto counts = cudaq::sample(kernel); if (!cudaq::mpi::is_initialized() || cudaq::mpi::rank() == 0) { counts.dump(); // Fine grain access to the bits and counts for (auto &[bits, count] : counts) { printf("Observed: %s, %lu\n", bits.data(), count); } } return 0; }
When I try to compile and translate this to OQ2 using:
cudaq-quake ghz.cpp | cudaq-opt --pass-pipeline="builtin.module(canonicalize,lambda-lifting,apply-op-specialization,func.func(memtoreg{quantum=0}),cc-loop-normalize,cc-loop-unroll)" | cudaq-translate --convert-to=openqasm2 &> ghz.qasm
Here's the output qasm file:
// Code generated by NVIDIA's nvq++ compiler OPENQASM 2.0; include "qelib1.inc"; gate ZN3ghzILm10EEclEv(param0) { } qreg var0[10]; h var0[0]; cx var0[0], var0[1]; cx var0[1], var0[2]; cx var0[2], var0[3]; cx var0[3], var0[4]; cx var0[4], var0[5]; cx var0[5], var0[6]; cx var0[6], var0[7]; cx var0[7], var0[8]; cx var0[8], var0[9]; creg var11[10]; measure var0 -> var11;
Looks good! But is there a way to strip the extraneous
gate ZN3ghzILm10EEclEv(param0) { }
during the cudaq-opt step? I looked at the cudaq-opt --help output but did not see an pipeline-pass for this, if one exists.
cudaq-opt
cudaq-opt --help
The text was updated successfully, but these errors were encountered:
No branches or pull requests
CUDA-QUANTUM version: 0.8.0
OS: Amazon Linux 2023 x86_64
Looking the basic C++ GHZ script:
When I try to compile and translate this to OQ2 using:
Here's the output qasm file:
Looks good! But is there a way to strip the extraneous
during the
cudaq-opt
step? I looked at thecudaq-opt --help
output but did not see an pipeline-pass for this, if one exists.The text was updated successfully, but these errors were encountered: