Skip to content

Commit

Permalink
docstring note
Browse files Browse the repository at this point in the history
  • Loading branch information
1ucian0 committed Mar 3, 2023
1 parent 87bc0b0 commit 8039977
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions qiskit/transpiler/passes/utils/unroll_forloops.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@


class UnrollForLoops(TransformationPass):
"""UnrollForLoops transpilation pass unrolls for-loops when possible."""
"""``UnrollForLoops`` transpilation pass unrolls for-loops when possible."""

def __init__(self, max_target_depth=-1):
"""Things like `for x in {0, 3, 4} {rx(x) qr[1];}` will turn into
`rx(0) qr[1]; rx(3) qr[1]; rx(4) qr[1];`.
.. note::
The ``UnrollForLoops`` unrolls only one level of block depth. No inner loop will
be considered by ``max_target_depth``.
Args:
max_target_depth (int): Optional. Checks if the unrolled block is over a particular depth.
To disable the check, use ``-1`` (Default)
max_target_depth (int): Optional. Checks if the unrolled block is over a particular
subcircuit depth. To disable the check, use ``-1`` (Default).
"""
super().__init__()
self.max_target_depth = max_target_depth
Expand Down

0 comments on commit 8039977

Please sign in to comment.