Skip to content

Commit

Permalink
Document scratch_reg_resize_pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec committed Jan 31, 2025
1 parent c88f0b8 commit d34440f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pytket/docs/passes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ For more on pytket passes see the `compilation <https://docs.quantinuum.com/tket
:members:
:special-members: __init__

.. autofunction:: pytket.passes.scratch_reg_resize_pass

.. autoclass:: pytket.passes.PassSelector
:special-members: __init__
:members:
Expand Down
7 changes: 5 additions & 2 deletions pytket/pytket/passes/resizeregpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ def _is_scratch(bit: Bit) -> bool:


def scratch_reg_resize_pass(max_size: int = MAX_C_REG_WIDTH) -> BasePass:
"""Given a max scratch register width, return a compiler pass that
breaks up the internal scratch bit registers into smaller registers
"""Create a pass that breaks up the internal scratch bit registers into smaller
registers.
:param max_size: desired maximum size of scratch bit registers
:return: a pass to break up the scratch registers
"""

def trans(circ: Circuit, max_size: int = max_size) -> Circuit:
Expand Down

0 comments on commit d34440f

Please sign in to comment.