Skip to content

Allowing inlining of quantum functions - #3420

Merged
albi3ro merged 3 commits into
mainfrom
inline-quantum-functions
Oct 30, 2026
Merged

albi3ro merged 3 commits into
mainfrom
inline-quantum-functions

Conversation

@albi3ro

@albi3ro albi3ro commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Context:

Performed by Cursor.

Right now, gradients don't work with decomposed operators, because gradients can't handle function calls with both quantum and classical instructions inside them.

As an easier fix for this, I thought we could just inline the function calls for now.

But we added something so that functions with quantum instructions can only be inlined if they have a target attribute. This branch is just getting rid of that restriction and seeing what the consequences are.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@maliasadi maliasadi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just update the changelog before merging the PR 🙌

@albi3ro albi3ro changed the title Test allowing inlining of quantum functions Allowing inlining of quantum functions Oct 30, 2026
@albi3ro
albi3ro merged commit b379ebf into main Oct 30, 2026
49 of 50 checks passed
@albi3ro
albi3ro deleted the inline-quantum-functions branch October 30, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants