Skip to content

Commit

Permalink
Changes to update ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-mills-cqc committed Jan 10, 2025
1 parent 76cef0e commit f7e2e3e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ocvqc_py/graph_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,12 @@ def add_edge(self, vertex_one: int, vertex_two: int) -> None:

# If edges are in the entanglement_graph they should be in
# the flow_graph. It would be a bug if not.
assert (
vertex_one in self.flow_graph.nodes
), f"Vertex {vertex_one} missing from flow graph"
assert (
vertex_two in self.flow_graph.nodes
), f"Vertex {vertex_two} missing from flow graph"
assert vertex_one in self.flow_graph.nodes, (
f"Vertex {vertex_one} missing from flow graph"
)
assert vertex_two in self.flow_graph.nodes, (
f"Vertex {vertex_two} missing from flow graph"
)

# Check that edges only point towards output vertices.
# This ensures that output vertices do not have flow.
Expand Down Expand Up @@ -550,9 +550,9 @@ def corrected_measure(self, vertex: int, t_multiple: int = 0) -> None:
vertex_measure_order = self.measurement_order_list[vertex]

if vertex_measure_order is None:
assert (
vertex not in self._vertices_with_flow
), "Output vertices should not have flow."
assert vertex not in self._vertices_with_flow, (
"Output vertices should not have flow."
)

if (vertex not in self._vertices_with_flow) and (
vertex_measure_order is not None
Expand Down Expand Up @@ -732,9 +732,9 @@ def corrected_measure(self, vertex: int, t_multiple: int = 0) -> None:
assert len(list(self.flow_graph.successors(vertex))) <= 1

if vertex in self._vertices_with_flow:
assert (
vertex_measure_order is not None
), f"Vertex {vertex} has flow but is an output. "
assert vertex_measure_order is not None, (
f"Vertex {vertex} has flow but is an output. "
)

assert len(list(self.flow_graph.successors(vertex))) == 1

Expand Down

0 comments on commit f7e2e3e

Please sign in to comment.