[Regression] C++ frontend rejects the use of `std::numbers` constant in `r1` gate
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 53/100
Research direction
Start with the C++ frontend path that cudaq-quake uses to lower the reproducer, then run the provided example with std::numbers::pi and compare it with an equivalent numeric constant. Done means the C++ frontend accepts the r1 call and produces valid Quake; the issue does not identify a source file or test, so locating the relevant frontend tests will take project familiarity.
Written by the indexing model from the issue text.
Description
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
Trying the example provided in the docs for lowering an r1 gate through cudaq-quake using the C++ frontend:
#include <cudaq.h>
#include <numbers>
struct example {
void operator()() __qpu__ {
cudaq::qubit q;
r1(std::numbers::pi, q);
}
};
I get the following error:
> cudaq-quake test.cpp
test.cpp:18:8: error: symbol is not accessible in this kernel
18 | r1(std::numbers::pi, q);
| ^~~~~~~~~~~~~~
test.cpp:18:5: error: statement not supported in qpu kernel
18 | r1(std::numbers::pi, q);
| ^
Seems like a regression since it's in an example in the docs but fails to lower.
Steps to reproduce the bug
// test.cpp
#include <cudaq.h>
#include <numbers>
struct example {
void operator()() __qpu__ {
cudaq::qubit q;
r1(std::numbers::pi, q);
}
};
run:
cudaq-quake test.cpp
Expected behavior
Seems like this should produce valid quake
Is this a regression? If it is, put the last known working version (or commit) here.
Seems to be a regression but not sure when it worked last
Environment
- CUDA-Q version:
latest - Python version:
3.12.3 - C++ compiler:
clang++ 22.1.4 - Operating system:
Ubuntu 24.04.5 LTS x86_64
Suggestions
No response
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 508
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 100
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cuda-quantum
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
NVIDIA/cuda-quantum#6035 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 77/100
NVIDIA/cuda-quantum#6034 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-quantum#6033 ·
Maintainers usually reply within 1 day
-
Point the CUDA-Q Pulse research preview docs to the released cudaq-pulse packagePossibly taken @fedonman claimed this 2 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
NVIDIA/cuda-quantum#6031 ·
Maintainers usually reply within 1 day
-
Realtime fnv1a_hash sign-extends char, so a non-ASCII handler name gets a platform-dependent function idPossibly taken @fedonman claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
NVIDIA/cuda-quantum#6029 ·
Maintainers usually reply within 1 day
All issues in NVIDIA/cuda-quantum
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainers usually reply within 1 day
-
bug compatibility difficulty:easy prio:normal
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NatronGitHub/openfx-misc#524 ·
Maintainers usually reply within 1 day
-
documentation enhancement help wanted P0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Maintainers usually reply within 1 day
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openscad/openscad#7360 · 2 comments ·
Maintainers usually reply within 1 day