NVIDIA / NVIDIA/cuda-quantum

Dynamic kernels

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

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

One may need to either grow, reduce or change the structure of the kernel within an algorithm. The idea of inserting a gate in a specific location comes into play here without having to modify/ copy the kernel once again.

For example:

import cudaq 

@cudaq.kernel
def kernel():
    q = cudaq.qvector (3)
    x(q[0])

@cudaq.kernel
def dynamic_kernel(q1: cudaq.qubit, q2: cudaq.qubit):
    cx(q1, q2)
    
for i in range(n_epochs): 
    
    result = scipy.optimize(obj)
    
    if result < 1: 
        cudaq.insert(dynamic_kernel, kernel, position = 2) #insert dynamic kernel into kernel at position 2
    
    #need to think about what position 2 means in this case

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

No source files or tests are named. Start by reviewing the kernel entry points represented by @cudaq.kernel and cudaq.insert, then determine how dynamic insertion should work for the grow, reduce, and structural-change cases. Done means the feature's insertion-position semantics and supported kernel changes are defined and implemented with coverage for the shown workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
quantum-computing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.