Skip to content

[FEATURE] Implement a .compare() method for QasmModule #216

@TheGupta2012

Description

@TheGupta2012

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

  1. Qubit Count

  2. Depth

  3. Gate Counts: Per-gate-type statistics (e.g., count of CX, H, X, etc.)

  4. External Gates: List of gates marked as external (e.g., from loads(external_gates=...))

  5. User Operation History: A list of operations performed on the module

  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestllm-assistedUsed LLMs to fine tune issue description.no-qc-knowledge-reqdDoes not require knowledge of QC or QIS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions