Skip to content

Commit

Permalink
Describe optimization parameters in docs (#615)
Browse files Browse the repository at this point in the history
* Describe optimization parameters in docs

* update docstring

* Fix typo in docstring

Co-authored-by: Jim Garrison <garrison@ibm.com>

---------

Co-authored-by: Jim Garrison <garrison@ibm.com>
  • Loading branch information
ibrahim-shehzad and garrison committed Jun 12, 2024
1 parent 67f24cb commit d6a8654
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion circuit_knitting/cutting/automated_cut_finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,25 @@ def find_cuts(

@dataclass
class OptimizationParameters:
"""Specify parameters that control the optimization."""
"""Specify parameters that control the optimization.
If either of the constraints specified by ``max_backjumps`` or ``max_gamma`` are exceeded, the search terminates but
nevertheless returns the result of a greedy best first search, which gives an *upper-bound* on gamma.
"""

#: The seed to use when initializing Numpy random number generators in the best first search priority queue.
seed: int | None = OptimizationSettings().seed

#: Maximum allowed value of gamma which, if exceeded, forces the search to terminate.
max_gamma: float = OptimizationSettings().max_gamma

#: Maximum number of backjumps that can be performed before the search is forced to terminate; setting it to ``None`` implies that no such restriction is placed.
max_backjumps: None | int = OptimizationSettings().max_backjumps

#: Bool indicating whether or not to allow LO gate cuts while finding cuts.
gate_lo: bool = OptimizationSettings().gate_lo

#: Bool indicating whether or not to allow LO wire cuts while finding cuts.
wire_lo: bool = OptimizationSettings().wire_lo


Expand Down

0 comments on commit d6a8654

Please sign in to comment.