i-gate-cudaq
Table of Contents
I gate (CUDA-Q)
I gate implementation using CUDA-Q.
// Compile: nvq++ main.cpp -o main // Run: ./main #include <cudaq.h> struct kernel { __qpu__ void operator()() { cudaq::qubit q; h(q); // prepare |+> // identity is a no-op; the state is unchanged mz(q); } }; int main() { auto counts = cudaq::sample(kernel{}); counts.dump(); // ~50% |0>, ~50% |1> }
i-gate-cudaq.txt ยท Last modified: by 127.0.0.1
