Skip to content

Commit

Permalink
Add odd_overlap implementation lost in merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
pehamTom committed Nov 20, 2024
1 parent f63bba1 commit 5704930
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mqt/qecc/circuit_synthesis/synthesis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ def symbolic_vector_eq(v1: npt.NDArray[z3.BoolRef | bool], v2: npt.NDArray[z3.Bo

def odd_overlap(v_sym: npt.NDArray[z3.BoolRef | bool], v_con: npt.NDArray[np.int8]) -> z3.BoolRef:
"""Return True if the overlap of symbolic vector with constant vector is odd."""
if np.array_equal(v_con, np.zeros(len(v_con), dtype=np.int8)):
return z3.BoolVal(False)
return z3.PbEq([(v_sym[i], 1) for i, c in enumerate(v_con) if c == 1], 1)


Expand Down

0 comments on commit 5704930

Please sign in to comment.