x-gate-cudaq
Table of Contents
X gate (CUDA-Q)
X gate implementation using CUDA-Q.
// Compile: nvq++ main.cpp -o main // Run: ./main #include <cudaq.h> struct kernel { __qpu__ void operator()() { cudaq::qubit q; x(q); // |0> -> |1> mz(q); } }; int main() { auto counts = cudaq::sample(kernel{}); counts.dump(); // 100% |1> }
x-gate-cudaq.txt ยท Last modified: by 127.0.0.1
