Skip to content

Support const int for register sizes #21

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

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Conversation

TheGupta2012
Copy link
Member

@TheGupta2012 TheGupta2012 commented Oct 16, 2024

Summary of changes

Register Sizes

  • Compile time constants are valid expressions for quantum and classical types but const int[32] N = 2; qubit[N] q; was not being parsed correctly
  • This is because sizes were assumed to be integer literals when they could be arbitrary expressions involving compile time constants
  • Changes made to _visit_qubit_register and _visit_classical_declaration ensure that size value is correctly evaluated for classical and quantum registers

Bug in _visit_function_call

  • return_value parameter was undeclared and was not correctly returning value for functions which did not have a return_statement field

@TheGupta2012 TheGupta2012 merged commit 7b3a192 into main Oct 17, 2024
5 checks passed
@TheGupta2012 TheGupta2012 deleted the fix-register-parsing branch October 18, 2024 07:00
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