Feature Description
Signature: .compare(other_module)
Purpose: Compares two QasmModule objects across multiple attributes: qubit count, depth, gate counts, external gates, user operation history, etc.
Output: Uses tabulate for a formatted comparison table in stdout.
Implementation (Optional)
Comparison Attributes
-
Qubit Count
-
Depth
-
Gate Counts: Per-gate-type statistics (e.g., count of CX, H, X, etc.)
-
External Gates: List of gates marked as external (e.g., from loads(external_gates=...))
-
User Operation History: A list of operations performed on the module
-
TBD
User Operation History
Helps user understand how they arrived at the current state of their module object.
- Initialize: As a list property in
QasmModule (e.g., self._user_operations = []).
- Record: Append operation names and params (e.g., "unroll", "validate", "segment") to the list whenever a method is called.
- Output: Include this list in the comparison table.
Feature Description
Signature:
.compare(other_module)Purpose: Compares two
QasmModuleobjects across multiple attributes: qubit count, depth, gate counts, external gates, user operation history, etc.Output: Uses
tabulatefor a formatted comparison table in stdout.Implementation (Optional)
Comparison Attributes
Qubit Count
Depth
Gate Counts: Per-gate-type statistics (e.g., count of CX, H, X, etc.)
External Gates: List of gates marked as external (e.g., from loads(external_gates=...))
User Operation History: A list of operations performed on the module
TBD
User Operation History
Helps user understand how they arrived at the current state of their module object.
QasmModule(e.g., self._user_operations = []).