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.
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: https://github.com/amazon-braket/amazon-braket-sdk-python/pull/993#discussion_r1628310002