File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ def sample_heavy_set(
147
147
148
148
results = results .agg (lambda meas : cirq .value .big_endian_bits_to_int (meas ), axis = 1 )
149
149
# Compute the number of outputs that are in the heavy set.
150
- num_in_heavy_set = np .sum (np .in1d (results , heavy_set )).item ()
150
+ num_in_heavy_set = np .sum (np .isin (results , heavy_set )).item ()
151
151
152
152
# Return the number of Heavy outputs over the number of valid runs.
153
153
return num_in_heavy_set / len (results )
Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ def apply_unitary(
390
390
# Try each strategy, stopping if one works.
391
391
# Also catch downcasting warnings and throw an error: #2041
392
392
with warnings .catch_warnings ():
393
- warnings .filterwarnings (action = "error" , category = np .ComplexWarning )
393
+ warnings .filterwarnings (action = "error" , category = np .exceptions . ComplexWarning )
394
394
for strat in strats :
395
395
result = strat (unitary_value , args )
396
396
if result is None :
Original file line number Diff line number Diff line change @@ -714,7 +714,8 @@ def test_cast_to_complex():
714
714
)
715
715
716
716
with pytest .raises (
717
- np .ComplexWarning , match = 'Casting complex values to real discards the imaginary part'
717
+ np .exceptions .ComplexWarning ,
718
+ match = 'Casting complex values to real discards the imaginary part' ,
718
719
):
719
720
cirq .apply_unitary (y0 , args )
720
721
You can’t perform that action at this time.
0 commit comments