Skip to content

Calling cudaq.control or cudaq.adjoint on a kernel passed as argument to a device kernel fails during synthesis #3499

@bettinaheim

Description

@bettinaheim

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

The PySynthCallableBlockArgs pass (and subsequent support in the runtime) requires that all quake.ApplyOp instructions are eliminated during compilation. However, the substitution fails when the indirectly invoked kernel is an argument to a device kernel.

Steps to reproduce the bug

A set of failing tests are added in #3489. After that merge, search for the link to this issue in the code base to find them.

Expected behavior

It should be possible to compile and run the examples in the tests.

Is this a regression? If it is, put the last known working version (or commit) here.

Not a regression

Environment

Suggestions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions