Skip to content

Add params validation for basic gates#169

Merged
TheGupta2012 merged 2 commits intomainfrom
fix-num-params-error
Apr 11, 2025
Merged

Add params validation for basic gates#169
TheGupta2012 merged 2 commits intomainfrom
fix-num-params-error

Conversation

@TheGupta2012
Copy link
Copy Markdown
Member

Fixes #109

Summary of changes

  • src/pyqasm/maps/gates.py: Added PARAMS_OP_SET dictionary to define the number of parameters for each QASM operation and implemented the map_qasm_op_num_params function to map QASM operations to their respective parameter counts. [1] [2]

  • src/pyqasm/visitor.py: Integrated map_qasm_op_num_params into the _visit_basic_gate_operation method to validate the number of parameters for each QASM operation and raise an error if there is a mismatch. [1] [2]

@TheGupta2012 TheGupta2012 merged commit ed75edb into main Apr 11, 2025
@TheGupta2012 TheGupta2012 deleted the fix-num-params-error branch April 21, 2025 05:59
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.

[FEAURE] Improved exception message for invalid num parameters

1 participant