-
Notifications
You must be signed in to change notification settings - Fork 617
Open
Labels
area/pythonInvolves Python codeInvolves Python codeplatform/colabGoogle Colab issues and PRsGoogle Colab issues and PRspriority/p1Fix is needed as soon as possibleFix is needed as soon as possible
Description
Using a set in a call to the sample(…)
method from the Python random
standard library has been deprecated since Python 3.9, and in Python 3.11, it causes an error. This happens in the function util.py:_apply_random_control(…)
starting on line 111:
open_qubits = set(all_qubits) - set(gate.qubits)
n_open = min(len(open_qubits), 3)
if n_open == 0:
# No open qubits to control. Return unmodified gate.
return gate
control_locs = random.sample(open_qubits, n_open)
There may be other places where it happens, so we should do a sweep through
the code to look for calls to sample()
.
Metadata
Metadata
Assignees
Labels
area/pythonInvolves Python codeInvolves Python codeplatform/colabGoogle Colab issues and PRsGoogle Colab issues and PRspriority/p1Fix is needed as soon as possibleFix is needed as soon as possible