Skip to content

Commit

Permalink
Merge pull request #221 from BQSKit/hash-structure-2Q
Browse files Browse the repository at this point in the history
Hash structure of only multi-qubit gates
  • Loading branch information
mtweiden authored Feb 15, 2024
2 parents d283a54 + be0940b commit d835de3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bqskit/passes/search/generators/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ def gen_successors(self, circuit: Circuit, data: PassData) -> list[Circuit]:
def hash_structure(circuit: Circuit) -> int:
hashes = []
for cycle, op in circuit.operations_with_cycles():
if op.num_qudits <= 1:
continue
hashes.append(hash((cycle, str(op))))
if len(hashes) > 100:
hashes = [sum(hashes)]
Expand Down

0 comments on commit d835de3

Please sign in to comment.