Hash structure of only multi-qubit gates #221
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
hash_structure
function in theSeedLayerGenerator
assigns a unique hash to each circuit structure. Due to possible mismatches between the 1Q gates used in seed circuits and the 1Q gates used in the internallayer_gen
, synthesis may revisit the same structure many times.Example:
A seed circuit with CNOTs at locations [(0,1), (1,2), (1,2)] has U3 gates after each CNOT application. Depending on the layer generator assigned by
_get_layer_gen
in QSearch, multiple 1Q gates may follow each of the U3 gates. These extra 1Q gates impact the circuit structure's hash so that the same structure may be revisited multiple times. This change ensures that only multi-qubit gates are involved in determining the hash of the circuit's structure.