Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Custom Gate Definitions don't follow OpenQASM standard #31

Open
DRovara opened this issue Oct 18, 2024 · 0 comments
Open

🐛 Custom Gate Definitions don't follow OpenQASM standard #31

DRovara opened this issue Oct 18, 2024 · 0 comments
Labels
bug Something isn't working c++

Comments

@DRovara
Copy link
Collaborator

DRovara commented Oct 18, 2024

Environment information

Any environment

Description

Two aspects of the OpenQASM standard are not respected by the current implementation for custom gates:

  • Custom gate definitions cannot access underlying registers, only the qubits that were passed to them. The current implementation assumes this is possible, so dome of the parsing and data dependency logic is incorrect, and assertions can access quantum registers even in custom gate definitions.
  • Custom gate definitions should also support angle parameters, which, at the moment, they don't.

Expected behavior

Something like this should not work:

qreg q[3];
gate test t {
    assert-ent t, q[0];
}

Something like this should work:

gate test(x) t {
    ...
}

How to Reproduce

Run the two code snippets above in the debugger.

@DRovara DRovara added bug Something isn't working c++ labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c++
Projects
None yet
Development

No branches or pull requests

1 participant