Added support to Angle, extern and Complex type#239
Merged
TheGupta2012 merged 13 commits intomainfrom Aug 11, 2025
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Angle typeAngle and Complex type
TheGupta2012
reviewed
Aug 4, 2025
TheGupta2012
reviewed
Aug 4, 2025
TheGupta2012
reviewed
Aug 4, 2025
TheGupta2012
reviewed
Aug 4, 2025
TheGupta2012
requested changes
Aug 4, 2025
Member
TheGupta2012
left a comment
There was a problem hiding this comment.
Hi @vinayswamik , code looks good! Some minor comments but should be good to go. Are you adding extern with this PR as well?
Collaborator
Author
Yeah, i will add |
- Changed `angle_vars_in_expr` to a single variable `angle_var_in_expr` for improved clarity and functionality. - Introduced new trigonometric functions (`arccos`, `arcsin`, `arctan`) to the FUNCTION_MAP. - Adjusted tests to validate new angle expressions and ensure correct bit string conversions.
Angle and Complex typeAngle, extern and Complex type
- Updated `Qasm3ExprEvaluator` to include support for `BitstringLiteral` in expression evaluations. - Improved `Qasm3SubroutineProcessor` to validate argument types, including checks for `BitType` and `AngleType`. - Added a new method in `QasmVisitor` to validate the width of bitstring literals. - Adjusted `PulseValidator` to handle string representations of bitstrings. - Updated tests to reflect changes in bitstring handling and validation logic.
TheGupta2012
reviewed
Aug 8, 2025
TheGupta2012
reviewed
Aug 8, 2025
TheGupta2012
reviewed
Aug 8, 2025
TheGupta2012
reviewed
Aug 8, 2025
TheGupta2012
reviewed
Aug 8, 2025
TheGupta2012
requested changes
Aug 8, 2025
Member
TheGupta2012
left a comment
There was a problem hiding this comment.
Hi @vinayswamik , can you please address these changes? Should be good to merge post that!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Add angle type support in QASM
angle_bit_stringattribute in theVariableclass to represent angle values.loadsfunction to acceptcompiler_angle_type_sizefor angle type width.Qasm3ExprEvaluatorto validate angle variables in expressions, ensuring consistent size.PulseValidatorand updated related tests for angle declarations and assignments.Add support for complex type operations in QASM
FUNCTION_MAPfor complex functions such asabs,real,imag,sqrt,sin,cos, andtan.Qasm3ExprEvaluatorto handle complex expressions and added checks forcomplextypes.PulseValidatorto create binary expressions from complex numbers.Add extern function support in QASM
externfunction declarations and calls, allowing forexternal functionintegration within QASM programs.Qasm3ExprEvaluatorand QasmVisitor to process extern functions, including validation and argument type checks.Closes #34
Closes #33
Closes #204