Skip to content

Commit

Permalink
Added more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
henryzou50 committed Mar 19, 2024
1 parent 2d92aff commit dedabf1
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 64 deletions.
158 changes: 94 additions & 64 deletions sabre_mods/demo_synthetic_circuits.ipynb

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions sabre_mods/experiments/utils/synthetic_circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ def _build_layer(self, circuit, coupling_list, gate_type, param, seed):
selected_edges = []
used_qubits = set()


# Note that if num_gates = max_matching, then it is not guaranteed that the selected_edges
# will have num_gates. This is because the selected_edges are selected based on the shuffled_coupling_list
# and the used_qubits. If the shuffled_coupling_list does not have enough non-overlapping edges, then the
# selected_edges will have less than num_gates.
for edge in shuffled_coupling_list:
# Check if the number of gates has been reached
if len(selected_edges) >= num_gates:
Expand Down

0 comments on commit dedabf1

Please sign in to comment.