Skip to content

Commit

Permalink
Make the docstring for graph_to_swaps a bit clearer.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlyongemallo committed Oct 30, 2023
1 parent 5beb9bc commit 417be1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyzx/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,9 @@ def extract_simple(g: BaseGraph[VT, ET], up_to_perm: bool = True) -> Circuit:


def graph_to_swaps(g: BaseGraph[VT, ET], no_swaps: bool = False) -> Circuit:
"""Converts a graph containing only normal and Hadamard edges into a circuit of Hadamard
and SWAP gates. If 'no_swaps' is True, only add Hadamards where needed"""
"""Converts a graph containing only normal and Hadamard edges (i.e., no vertices other than
inputs and outputs) into a circuit of Hadamard and SWAP gates. If 'no_swaps' is True, only add
Hadamards where needed"""
swap_map = {}
leftover_swaps = False
inputs = g.inputs()
Expand Down

0 comments on commit 417be1d

Please sign in to comment.