Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-johnson committed Jan 9, 2024
2 parents 5488244 + aa280e8 commit 65cb19e
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions circuit_knitting/cutting/cut_finding/disjoint_subcircuits_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,37 @@ def copy(self):
return copy.copy(self)

def print(self, simple=False):
"""Print the various properties of a DisjointSubcircuitState.
In its current state, this function only works for 2 qubit LO gate cuts.
It will be updated as more functionalities are added in the future.
"""
cut_actions = debugActionListWithNames(self.actions)
"""Print the various properties of a DisjointSubcircuitState."""

# cut_actions = PrintActionListWithNames(self.actions)
# cut_actions_sublist = []
# Cut = namedtuple("Cut", ["Action", "Gate"])

# for i in range(len(cut_actions)):
# if cut_actions[i][0] == "CutTwoQubitGate":
# cut_actions_sublist.append(
# Cut(
# Action=cut_actions[i][0],
# Gate=[cut_actions[i][1][0], cut_actions[i][1][1]],
# )
# )
# elif (cut_actions[i][0] == "CutLeftWire") or (cut_actions[i][0] == ("CutRightWire")):


cut_actions = PrintActionListWithNames(self.actions)
cut_actions_sublist = []
Cut = namedtuple("Cut", ["Action", "Gate"])

for i in range(len(cut_actions)):
if cut_actions[i][0] == "CutTwoQubitGate":
cut_actions_sublist.append(
Cut(
Action=cut_actions[i][0],
Gate=[cut_actions[i][1][0], cut_actions[i][1][1]],
)
{
"Cut action": cut_actions[i][0],
"Cut location": {
"Gate": [cut_actions[i][1][0], cut_actions[i][1][1]]
},
"Input wire": cut_actions[i][2][0][0],
}
)

if simple: # print only a subset of properties.
Expand Down

0 comments on commit 65cb19e

Please sign in to comment.