Add kernel math function support#4680
Conversation
Signed-off-by: LubuSeb <187313664+LubuSeb@users.noreply.github.com>
18e1a52 to
83f384a
Compare
Command Bot: Processing... |
CI Summary (
|
| Job | Result | Link |
|---|---|---|
build_and_test |
❌ failure | view |
Top-level jobs (13)
| Job | Result |
|---|---|
binaries |
⏩ skipped |
build_and_test |
❌ failure |
config_devdeps |
✅ success |
config_source_build |
⏩ skipped |
config_wheeldeps |
✅ success |
devdeps |
✅ success |
docker_image |
⏩ skipped |
gen_code_coverage |
⏩ skipped |
metadata |
✅ success |
python_metapackages |
⏩ skipped |
python_wheels |
⏩ skipped |
source_build |
⏩ skipped |
wheeldeps |
✅ success |
⏩ Skipped jobs (7) — intentionally skipped on PR builds; run on merge_group / workflow_dispatch
| Job |
|---|
binaries |
config_source_build |
docker_image |
gen_code_coverage |
python_metapackages |
python_wheels |
source_build |
All sub-jobs (42) — every matrix leg, with links
| Job | Status | Link |
|---|---|---|
| Build and test (amd64, gcc12, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, gcc12, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (amd64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, llvm, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Python) | ❌ failure | view |
| CI Summary | ❔ in_progress | view |
| Configure build (devdeps) | ✅ success | view |
| Configure build (source_build) | ⏩ skipped | view |
| Configure build (wheeldeps) | ✅ success | view |
| Create CUDA Quantum installer | ⏩ skipped | view |
| Create Docker images | ⏩ skipped | view |
| Create Python metapackages | ⏩ skipped | view |
| Create Python wheels | ⏩ skipped | view |
| Gen code coverage | ⏩ skipped | view |
| Load dependencies (amd64, gcc12) / Caching | ✅ success | view |
| Load dependencies (amd64, gcc12) / Finalize | ✅ success | view |
| Load dependencies (amd64, gcc12) / Metadata | ✅ success | view |
| Load dependencies (amd64, llvm) / Caching | ✅ success | view |
| Load dependencies (amd64, llvm) / Finalize | ✅ success | view |
| Load dependencies (amd64, llvm) / Metadata | ✅ success | view |
| Load dependencies (arm64, gcc12) / Caching | ✅ success | view |
| Load dependencies (arm64, gcc12) / Finalize | ✅ success | view |
| Load dependencies (arm64, gcc12) / Metadata | ✅ success | view |
| Load dependencies (arm64, llvm) / Caching | ✅ success | view |
| Load dependencies (arm64, llvm) / Finalize | ✅ success | view |
| Load dependencies (arm64, llvm) / Metadata | ✅ success | view |
| Load source build cache | ⏩ skipped | view |
| Load wheel dependencies (amd64, 12.6) / Caching | ✅ success | view |
| Load wheel dependencies (amd64, 12.6) / Finalize | ✅ success | view |
| Load wheel dependencies (amd64, 12.6) / Metadata | ✅ success | view |
| Load wheel dependencies (amd64, 13.0) / Caching | ✅ success | view |
| Load wheel dependencies (amd64, 13.0) / Finalize | ✅ success | view |
| Load wheel dependencies (amd64, 13.0) / Metadata | ✅ success | view |
| Load wheel dependencies (arm64, 12.6) / Caching | ✅ success | view |
| Load wheel dependencies (arm64, 12.6) / Finalize | ✅ success | view |
| Load wheel dependencies (arm64, 12.6) / Metadata | ✅ success | view |
| Load wheel dependencies (arm64, 13.0) / Caching | ✅ success | view |
| Load wheel dependencies (arm64, 13.0) / Finalize | ✅ success | view |
| Load wheel dependencies (arm64, 13.0) / Metadata | ✅ success | view |
| Prepare cache clean-up | ❔ in_progress | view |
| Retrieve PR info | ✅ success | view |
⚠️ Required checks (5/6) — 1 missing — declared in .github/required-checks.yml for push
| Required check | Status | Link |
|---|---|---|
| Build and test (amd64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, llvm, openmpi) / Dev environment (Python) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (arm64, llvm, openmpi) / Dev environment (Python) | ❌ failure | view |
| Build and test (amd64, gcc12, openmpi) / Dev environment (Debug) | ✅ success | view |
| Build and test (amd64, gcc12, openmpi) / Dev environment (Python) | ✅ success | view |
Signed-off-by: LubuSeb <187313664+LubuSeb@users.noreply.github.com>
|
Pushed Local validation on the latest head: python -m py_compile python/cudaq/kernel/ast_bridge.py python/tests/kernel/test_kernel_float.pyThe latest head currently only has DCO, so it should be ready for another |
Command Bot: Processing... |
Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Command Bot: Processing... |
Signed-off-by: LubuSeb <187313664+LubuSeb@users.noreply.github.com>
Head branch was pushed to by a user without write access
|
Pushed Root cause from the failed job: The follow-up keeps the test scoped to the known UCCSD output support: observed states must still be a 5-or-6-sized subset of the six expected bitstrings. No math lowering code changed in this commit. Local validation available in this Windows checkout: python -m py_compile python/tests/kernel/test_kernel_uccsd.py python/cudaq/kernel/ast_bridge.py python/tests/kernel/test_kernel_float.py
git diff --checkI could not run the CUDA-Q runtime pytest locally because this checkout does not have a built The latest head only has DCO again, so it should need another |
Closes #2942.
Summary
asin,acos, andatan, including float overloadstan,asin,acos,atan, andlogReproduction / scope
The bounty issue asks for continuous mathematical function support in CUDA-Q kernels. Existing C++ lowering already handled several functions through
visitMathLibFunc; this change extends that same path for inverse trig functions. Python lowering already mapped selected NumPy calls through the AST bridge; this change adds the missing real-valued operations there while leaving untested complex inverse trig/log/tan support out of scope.Minimality
This is limited to the existing lowering tables/switches and targeted tests. It does not refactor the frontend, broaden discrete-control support, or add backend-specific behavior.
Validation
python -m py_compile python/cudaq/kernel/ast_bridge.py python/tests/kernel/test_kernel_float.pygit diff --cached --check<cmath>syntax smoke check for the float overload names used by the new C++ testNot run locally: CUDA-Q native lit/runtime tests, because the local environment does not have the CUDA-Q compiler/test toolchain installed.
AI assistance disclosure
I used AI assistance to inspect the codebase and draft parts of this change; I reviewed the final patch and validation results before submission.