# Y gate (CUDA-Q) [[y-gate|Y gate]] implementation using CUDA-Q. ```cpp // Compile: nvq++ main.cpp -o main // Run: ./main #include struct kernel { __qpu__ void operator()() { cudaq::qubit q; y(q); // |0> -> i|1>; global phase not observable at measurement mz(q); } }; int main() { auto counts = cudaq::sample(kernel{}); counts.dump(); // 100% |1> } ```