NVIDIA/cuda-quantum

random_walk_qpe.cpp not returning correct phase when run through NVQC

qci-petrenko opened this issue · 1 comments

Required prerequisites

  • Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
  • Make sure you've read the documentation. Your issue may be addressed there.
  • Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
  • If possible, make a PR with a failing test to give us a starting point to work on!

Describe the bug

When running the random walk phase estimation example (random_walk_qpe.cpp) in WSL (on a Windows 11 machine - CPU simulation) using the 0.7.1 cuda-quantum image, the expected phase is returned: Phase = 0.487390.

If running through Nvidia's cloud service (--target nvqc), Phase = 0.000000. This is not expected. It's not clear whether this is a GPU simulation issue or something with the cloud service.

Steps to reproduce the bug

The full terminal i/o is below:

cudaq@add20b7f7934:~/examples/cpp/other$ nvq++ random_walk_qpe.cpp
cudaq@add20b7f7934:~/examples/cpp/other$ ./a.out
Phase = 0.487390
cudaq@add20b7f7934:~/examples/cpp/other$ nvq++ random_walk_qpe.cpp --target nvqc
cudaq@add20b7f7934:~/examples/cpp/other$ ./a.out
[2024-05-02 00:29:36.675] Submitting jobs to NVQC service with 1 GPU(s). Max execution time: 3600 seconds (excluding queue wait time).

================ NVQC Device Info ================
GPU Device Name: "NVIDIA H100 80GB HBM3"
CUDA Driver Version / Runtime Version: 12.2 / 11.8
Total global memory (GB): 79.1
Memory Clock Rate (MHz): 2619.000
GPU Clock Rate (MHz): 1980.000
==================================================
Phase = 0.000000

Expected behavior

I expect to have the local simulation and the cloud simulation return the same result.

Is this a regression? If it is, put the last known working version (or commit) here.

Unknown.

Environment

  • CUDA Quantum version: 0.7.1
  • C++ compiler: nvq++
  • Operating system: Windows 11
  • WSL version: 2

Suggestions

No response

Hi @qci-petrenko,

Thank you for reporting the issue.
The current nvqc target doesn't support quantum kernels that return values yet (the returned double value in random_walk_qpe.cpp is being ignored).
We'll put this feature in the next release.