Skip to content

Commit 7b70fb3

Browse files
Fix count == 0 edge case
1 parent 028c34e commit 7b70fb3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pyqrackising/generate_tfim_samples.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ def delta_like_edges(state, i, j, neighbors):
9292

9393

9494
def sample_fixed_hamming_weight(h_weight, count, n_rows, n_cols, burnin=10):
95+
if count == 0:
96+
return []
97+
9598
n_qubits = n_rows * n_cols
9699
neighbors = build_neighbors(n_rows, n_cols)
97100

0 commit comments

Comments
 (0)