Skip to content

Commit a56c2b7

Browse files
authored
Fix #887: pass a list to random.sample() (#888)
1 parent 9abba82 commit a56c2b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorflow_quantum/python/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _apply_random_control(gate, all_qubits):
113113
if n_open == 0:
114114
# No open qubits to control. Return unmodified gate.
115115
return gate
116-
control_locs = random.sample(open_qubits, n_open)
116+
control_locs = random.sample(list(open_qubits), n_open)
117117
control_values = random.choices([0, 1], k=n_open)
118118
# TODO(tonybruguier,#636): Here we call the parent's class controlled_by
119119
# because Cirq's breaking change #4167 created 3-qubit gates that cannot be

0 commit comments

Comments
 (0)