Support additional numpy functions in python mlir
Open
Nobody has claimed this yet.
enhancement
python-lang
stale-notified
- Dominant language
- C++
- Stars
- 1.1k
- Forks
- 456
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 165
Description
Required prerequisites
- Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.
Describe the feature
Support using the following numpy functions in quantum kernels:
- abs
- arcsin
@cudaq.kernel
def kernel():
x = np.abs(1.0j)
ang = np.arcsin(0.0)
Currently raises the error:
cudaq.kernel.ast_bridge.CompilerError: ampitude_estimation.py:39: error: unsupported NumPy call (abs)
(offending source -> np.abs(np.sqrt(a_value)))
Contributor 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.
Research direction
Start by locating the Python MLIR handling for NumPy calls and the existing support checks for quantum kernels. Use the provided np.abs and np.arcsin kernel examples to reproduce the unsupported-call errors, then verify both functions compile successfully without those errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100