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

Classical bitset of size zero not supported #37

Open
garrison opened this issue Apr 24, 2024 · 0 comments
Open

Classical bitset of size zero not supported #37

garrison opened this issue Apr 24, 2024 · 0 comments

Comments

@garrison
Copy link

garrison commented Apr 24, 2024

If one creates a bit array of size zero (e.g. bit[0] c1;), the program will fail to parse

assert(S > 0 && "Invalid bitset of size zero!");

However, this is not explicitly forbidden by the openqasm3 spec, as far as I can tell (see https://openqasm.com/language/types.html#arrays).

In the circuit-knitting-toolbox, we programmatically generate many circuits, all of which have two registers for consistency in handling them. But, one of the registers has zero bits in some of the circuits.

We can work around this easily, but I wanted to flag it as something that would be desirable to either support or clarify.

garrison added a commit to Qiskit-Extensions/circuit-knitting-toolbox that referenced this issue Apr 24, 2024
garrison added a commit to Qiskit-Extensions/circuit-knitting-toolbox that referenced this issue Apr 25, 2024
* Force at least one classical bit in `qpd_measurements` register

This is a potential workaround to
openqasm/qe-qasm#37

* Add release note
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

No branches or pull requests

1 participant