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

Consider allowing gates to be called with an empty list of target qubits #996

Open
Manvi-Agrawal opened this issue Jun 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Manvi-Agrawal
Copy link

Manvi-Agrawal commented Jun 6, 2024

Describe the feature you'd like
Currently a gate cannot be called with an empty list of target qubits. It might be nice for this to be allowed, but to generate no instructions in the resulting program.

How would this feature be used? Please describe.
A circuit may be built programmatically, with gates added to lists of qubits that are determined dynamically. If some of these lists are empty, it may be convenient to still call the function to add the gate, rather than first checking to see if the list is empty.

Describe alternatives you've considered
A user could work around this by ensuring that they do not call gates with an empty list of target qubits.

Additional context
See comment thread here:
#993 (comment)

@Manvi-Agrawal
Copy link
Author

@jcjaskula-aws created this issue for the edge case discovered by you here. #993 (comment)

@rmshaffer rmshaffer added the enhancement New feature or request label Jun 18, 2024
@rmshaffer rmshaffer changed the title Evaluate whether an empty register is valid gate input Consider allowing gates to be called with an empty list of target qubits Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants