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

Improve the classical declarations and assignments #90

Open
TheGupta2012 opened this issue May 1, 2024 · 0 comments
Open

Improve the classical declarations and assignments #90

TheGupta2012 opened this issue May 1, 2024 · 0 comments
Labels
enhancement New feature or request pyqir Interfacing with QIR python bindings qasm3 Related to OpenQASM 3 conversions unitary-hack Issues tagged with Unitary Hack '24

Comments

@TheGupta2012
Copy link
Collaborator

TheGupta2012 commented May 1, 2024

Feature Description

Continuation of #85.

Details

Some tasks were left in the issue -

  1. Array Initialization using ArrayLiteral. Eg-
// 1-D 
array[int[32], 3] my_arr = {1, 2, 3};

This should be able to handle arbitrary dimensions eg. -

// N-D should also be supported
array[int[32], 2, 3] my_arr = {{1, 2, 3}, {4, 5, 6};

To be updated -

  1. Type casting during assignment and expression evaluation: Users should be able to cast types allowed in openqasm3. Reference - type casting in openqasm

To be updated -

  • Some logic change for -
    self._validate_variable_assignment_value(self._get_scope()[var_name], var_value)
    to handle "castable" values. Eg. An int[32] can be cast to float[32] but not vice versa.
  1. Validating constant value expressions to only use const variables: Constant expression can not contain variables, it should be validated that the init expression only uses literals or other const variables. Reference - constants in openqasm.

To be updated -

  • It would be nice to have a flag in self._evaluate_expression for evaluating the constant initial expressions. This could be set to True and the values coming in should then be validated whether they are constant or not.
  • Another approach could be creating a new constant expression evaluator but may result in redundancy.
  1. Add complex type support (optional)

  2. Add angle type support (optional)

@TheGupta2012 TheGupta2012 added the enhancement New feature or request label May 1, 2024
@TheGupta2012 TheGupta2012 added pyqir Interfacing with QIR python bindings qasm3 Related to OpenQASM 3 conversions unitary-hack Issues tagged with Unitary Hack '24 labels May 13, 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 pyqir Interfacing with QIR python bindings qasm3 Related to OpenQASM 3 conversions unitary-hack Issues tagged with Unitary Hack '24
Projects
None yet
Development

No branches or pull requests

1 participant