NVIDIA / NVIDIA/cuda-quantum

Executing QIR kernels from python interface

Open
#2,933 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

codegen 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

We would like to enable an execution pipeline where we would like to execute generate and separately execute QIR kernels in separate steps .

qir = cudaq.translate(pyKernel, format="qir-base")

and in other processes would like to use cudaq to execute the upper generated qir kernels from python interface.
Currently, the most convenient way is to use the testing utils as defined in

https://github.com/NVIDIA/cuda-quantum/blob/main/python/runtime/cudaq/target/py_testing_utils.cpp#L39

Which works , but if we would want to run noisy simulations, there is no obvious way.

Looking at the code, exposing noiseModel field to ExecutionContext pyBind , would be a quick enabler for this use-case , eg: https://github.com/NVIDIA/cuda-quantum/pull/2932

Would such a change be accepted into main, or would there be another recommended way to execute QIR code directly via cudaq ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with python/runtime/cudaq/target/py_testing_utils.cpp around line 39 and review the ExecutionContext pyBind usage, along with the linked pull request #2932. Determine how generated QIR should be submitted through the Python interface and how a noise model is passed; done means QIR execution works in a separate process with noisy simulation support.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
api, quantum-computing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.