Skip to content
Merged
Show file tree
Hide file tree
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 May 28, 2025
97bd199
fixed entrypoint return type value mismatch
feelerx May 28, 2025
202ca34
removed dummy test
feelerx May 28, 2025
52265d0
updated pyqasm enabling the use of pyqasm.loads() instead of pyqasm.load
feelerx May 29, 2025
0d1b26c
removed dummy test
feelerx May 29, 2025
da0aa20
rectified errors with return types and uncallable functions in adapti…
feelerx May 29, 2025
35b903d
removed unnecessary spaces
feelerx May 29, 2025
9d3d572
added description for profile definition and used enum to define the …
feelerx May 29, 2025
6c6020f
merged adaptive and custom files into a single visitor file
feelerx May 30, 2025
ac2a138
corrected ValueError to NotImplementedError, user can now use both st…
feelerx May 31, 2025
ab23d37
added template for the adaptive profile
feelerx May 31, 2025
05a0a9f
fixed all refactoring suggestions
feelerx Jun 2, 2025
5a605bc
added entry to CHANGELOG.md
feelerx Jun 2, 2025
a2c2887
added tests for the adaptive profile that covers core implementation …
feelerx Jun 4, 2025
cec6191
changed hardcoded qir_profiles value from default 'custom' to one bas…
feelerx Jun 4, 2025
7e49a5d
removed dummy test file
feelerx Jun 4, 2025
e80d095
fixed format action and other corrections
feelerx Jun 4, 2025
e402d24
further format-checks
feelerx Jun 4, 2025
9eaf059
fixed suggestions from review
feelerx Jun 6, 2025
915f252
corrected pull request number in CHANGELOG.md
feelerx Jun 6, 2025
153aefc
Moved profiles from qbraid_qir/qasm3/profiles to qbraid_qir/profiles,…
feelerx Jun 7, 2025
92f4340
changed custom profile to base profile that is compliant with qir-spe…
feelerx Jun 9, 2025
d41dfe8
changed profile name from 'base' back to 'custom' due to tests issues
feelerx Jun 9, 2025
9f8571f
moved /qbraid-qir/profiles/abstract.py to /qbraid-qir/profile.py
feelerx Jun 9, 2025
715eaf1
Merge branch 'main' into Adaptive-Profile
TheGupta2012 Jun 9, 2025
4acf020
merged with changes made in adaptive profile
feelerx Jun 9, 2025
da3f6cf
changed complex_if.ll and simple_if.ll to match the new base profile …
feelerx Jun 9, 2025
bdee3f5
changed profile name from custom to base. Fixed test that hardcoded c…
feelerx Jun 9, 2025
dc2e03d
moved /qbraid-qir/profiles/abstract.py to /qbraid-qir/profile.py
feelerx Jun 9, 2025
4f5b74c
changed complex_if.ll and simple_if.ll to match the new base profile …
feelerx Jun 9, 2025
775e85a
fixes
feelerx Jun 10, 2025
5f4c5d4
rebased and applied changes untop of main
feelerx Jun 10, 2025
6e361c6
Merge branch 'main' into Base-Profile
feelerx Jun 10, 2025
af11150
visitor.py local changes
feelerx Jun 10, 2025
cc10e8a
removed comment
feelerx Jun 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Types of changes:
### ➕ New Features

- Added Adaptive Profile Support as defined by the QIR Specification for QASM conversions ([#225](https://github.com/qBraid/qbraid-qir/pull/225))
Comment thread
TheGupta2012 marked this conversation as resolved.
- Edited Custom Profile to Base Profile as defined by the QIR Specification for QASM conversions ([#228](https://github.com/qBraid/qbraid-qir/pull/228))

### 🌟 Improvements
- Improved coverage for `qbraid_qir` with additional tests for the gate maps for QASM 3 conversions. ( [#227](https://github.com/qBraid/qbraid-qir/pull/227) )
Expand Down
156 changes: 156 additions & 0 deletions qbraid_qir/profiles/base_execution.json
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"]
}
}
Loading