-
Notifications
You must be signed in to change notification settings - Fork 17
QIR Base profile Compliant QASM Conversions #228
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
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
6e6f511
added adaptive profile support for qbraid_qir
feelerx 97bd199
fixed entrypoint return type value mismatch
feelerx 202ca34
removed dummy test
feelerx 52265d0
updated pyqasm enabling the use of pyqasm.loads() instead of pyqasm.load
feelerx 0d1b26c
removed dummy test
feelerx da0aa20
rectified errors with return types and uncallable functions in adapti…
feelerx 35b903d
removed unnecessary spaces
feelerx 9d3d572
added description for profile definition and used enum to define the …
feelerx 6c6020f
merged adaptive and custom files into a single visitor file
feelerx ac2a138
corrected ValueError to NotImplementedError, user can now use both st…
feelerx ab23d37
added template for the adaptive profile
feelerx 05a0a9f
fixed all refactoring suggestions
feelerx 5a605bc
added entry to CHANGELOG.md
feelerx a2c2887
added tests for the adaptive profile that covers core implementation …
feelerx cec6191
changed hardcoded qir_profiles value from default 'custom' to one bas…
feelerx 7e49a5d
removed dummy test file
feelerx e80d095
fixed format action and other corrections
feelerx e402d24
further format-checks
feelerx 9eaf059
fixed suggestions from review
feelerx 915f252
corrected pull request number in CHANGELOG.md
feelerx 153aefc
Moved profiles from qbraid_qir/qasm3/profiles to qbraid_qir/profiles,…
feelerx 92f4340
changed custom profile to base profile that is compliant with qir-spe…
feelerx d41dfe8
changed profile name from 'base' back to 'custom' due to tests issues
feelerx 9f8571f
moved /qbraid-qir/profiles/abstract.py to /qbraid-qir/profile.py
feelerx 715eaf1
Merge branch 'main' into Adaptive-Profile
TheGupta2012 4acf020
merged with changes made in adaptive profile
feelerx da3f6cf
changed complex_if.ll and simple_if.ll to match the new base profile …
feelerx bdee3f5
changed profile name from custom to base. Fixed test that hardcoded c…
feelerx dc2e03d
moved /qbraid-qir/profiles/abstract.py to /qbraid-qir/profile.py
feelerx 4f5b74c
changed complex_if.ll and simple_if.ll to match the new base profile …
feelerx 775e85a
fixes
feelerx 5f4c5d4
rebased and applied changes untop of main
feelerx 6e361c6
Merge branch 'main' into Base-Profile
feelerx af11150
visitor.py local changes
feelerx cc10e8a
removed comment
feelerx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| { | ||
| "profile_name": "Base", | ||
| "version": "1.0.0", | ||
| "description": "Basic QIR Profile for standard quantum circuits without advanced features", | ||
| "capabilities": { | ||
| "forward_branching": { | ||
| "enabled": false, | ||
| "description": "Does not support arbitrary forward branching" | ||
| }, | ||
| "conditional_execution": { | ||
| "enabled": true, | ||
| "description": "Support for basic if/else statements based on measurement results", | ||
| "supported_conditions": [ | ||
| "i1_from_result", | ||
| "negation", | ||
| "binary_expression_on_result" | ||
| ] | ||
| }, | ||
| "qubit_reuse": { | ||
| "enabled": false, | ||
| "description": "Does not allow quantum operations on qubits after measurement", | ||
| "reset_after_measurement": false | ||
| }, | ||
| "measurement_tracking": { | ||
| "enabled": false, | ||
| "description": "Does not track measurement state of individual qubits", | ||
| "per_qubit_state": false | ||
| }, | ||
| "output_recording": { | ||
| "grouped_by_register": false, | ||
| "preserves_register_structure": false, | ||
| "inverted_bit_order": false | ||
| } | ||
| }, | ||
| "required_functions": { | ||
| "quantum_intrinsics": [ | ||
| "pyqir._native.mz", | ||
| "pyqir._native.reset", | ||
| "pyqir._native.if_result", | ||
| "pyqir._native.barrier", | ||
| "qis.h", "qis.x", "qis.y", "qis.z", | ||
| "qis.s", "qis.s_adj", "qis.t", "qis.t_adj", | ||
| "qis.cx", "qis.cz", "qis.ccx", "qis.swap", | ||
| "qis.rx", "qis.ry", "qis.rz" | ||
| ], | ||
| "runtime_functions": [ | ||
| "pyqir.rt.initialize", | ||
| "pyqir.rt.result_record_output" | ||
| ] | ||
| }, | ||
| "restrictions": { | ||
| "barrier_operations": { | ||
| "subset_barriers_allowed": false, | ||
| "must_cover_all_qubits": true, | ||
| "emit_calls_configurable": true | ||
| }, | ||
| "external_gates": { | ||
| "modifiers_supported": true, | ||
| "parameter_support": "constants_only", | ||
| "linkage_type": "EXTERNAL", | ||
| "no_qubit_aliasing": true | ||
| } | ||
| }, | ||
| "validation_rules": { | ||
| "function_structure": { | ||
| "single_return_point": true, | ||
| "calls_to_output_functions_must_precede_return": true | ||
| }, | ||
| "barrier_validation": { | ||
| "allow_partial_barriers": false, | ||
| "require_full_qubit_coverage": true | ||
| }, | ||
| "qubit_usage": { | ||
| "allow_post_measurement_operations": false, | ||
| "track_measurement_state": true, | ||
| "reset_clears_measurement_state": false | ||
| }, | ||
| "classical_control": { | ||
| "require_if_result_function": true, | ||
| "support_nested_conditionals": true, | ||
| "boolean_condition_support": true | ||
| }, | ||
| "output_format": { | ||
| "register_grouped_output": false, | ||
| "individual_bit_recording": true, | ||
| "preserve_register_order": false | ||
| }, | ||
| "function_usage": { | ||
| "prefer_qis_over_native": false, | ||
| "required_base_functions": [ | ||
| "pyqir._native.if_result", | ||
| "pyqir._native.mz", | ||
| "pyqir._native.reset" | ||
| ] | ||
| } | ||
| }, | ||
| "compliance_checks": [ | ||
| { | ||
| "rule_id": "BASE_001", | ||
| "description": "Must use pyqir._native.mz for measurements", | ||
| "severity": "error", | ||
| "check_type": "function_usage" | ||
| }, | ||
| { | ||
| "rule_id": "BASE_002", | ||
| "description": "Must use pyqir._native.reset for qubit reset operations", | ||
| "severity": "error", | ||
| "check_type": "function_usage" | ||
| }, | ||
| { | ||
| "rule_id": "BASE_003", | ||
| "description": "Must use pyqir._native.if_result for conditional branching", | ||
| "severity": "error", | ||
| "check_type": "function_usage" | ||
| }, | ||
| { | ||
| "rule_id": "BASE_004", | ||
| "description": "Must not use qubits after measurement without reset", | ||
| "severity": "error", | ||
| "check_type": "state_tracking" | ||
| }, | ||
| { | ||
| "rule_id": "BASE_005", | ||
| "description": "Output recording must use simple sequential format", | ||
| "severity": "error", | ||
| "check_type": "output_format" | ||
| }, | ||
| { | ||
| "rule_id": "BASE_006", | ||
| "description": "Barrier operations must cover all qubits or be configurable via emit_barrier_calls parameter", | ||
| "severity": "warning", | ||
| "check_type": "barrier_handling" | ||
| }, | ||
| { | ||
| "rule_id": "BASE_007", | ||
| "description": "Return instruction must return an i64 zero exit code", | ||
| "severity": "error", | ||
| "check_type": "function_structure" | ||
| }, | ||
| { | ||
| "rule_id": "BASE_008", | ||
| "description": "Forward branching is not supported in base profile", | ||
| "severity": "error", | ||
| "check_type": "control_flow" | ||
| } | ||
| ], | ||
| "profile_metadata": { | ||
| "target_platforms": ["basic_quantum_processors"], | ||
| "quantum_runtime_version": ">=0.28.0", | ||
| "pyqir_version": ">=0.10.0", | ||
| "supported_gate_sets": ["universal", "parameterized"], | ||
| "max_qubits": "unspecified", | ||
| "max_classical_bits": "unspecified", | ||
| "required_llvm_instructions": ["call", "ret", "inttoptr", "getelementptr"] | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.