@@ -269,7 +269,7 @@ def test_recursive_params():
269
269
270
270
# First example should behave like an X when simulated
271
271
result = cirq .Simulator ().simulate (cirq .Circuit (circuitop ), param_resolver = outer_params )
272
- assert np .allclose (result .state_vector (copy = False ), [0 , 1 ])
272
+ assert np .allclose (result .state_vector (), [0 , 1 ])
273
273
274
274
275
275
@pytest .mark .parametrize ('add_measurements' , [True , False ])
@@ -345,9 +345,9 @@ def test_repeat_zero_times(add_measurements, use_repetition_ids, initial_reps):
345
345
subcircuit .freeze (), repetitions = initial_reps , use_repetition_ids = use_repetition_ids
346
346
)
347
347
result = cirq .Simulator ().simulate (cirq .Circuit (op ))
348
- assert np .allclose (result .state_vector (copy = False ), [0 , 1 ] if initial_reps % 2 else [1 , 0 ])
348
+ assert np .allclose (result .state_vector (), [0 , 1 ] if initial_reps % 2 else [1 , 0 ])
349
349
result = cirq .Simulator ().simulate (cirq .Circuit (op ** 0 ))
350
- assert np .allclose (result .state_vector (copy = False ), [1 , 0 ])
350
+ assert np .allclose (result .state_vector (), [1 , 0 ])
351
351
352
352
353
353
def test_no_repetition_ids ():
@@ -377,13 +377,13 @@ def test_parameterized_repeat():
377
377
assert cirq .parameter_names (op ) == {'a' }
378
378
assert not cirq .has_unitary (op )
379
379
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 0 })
380
- assert np .allclose (result .state_vector (copy = False ), [1 , 0 ])
380
+ assert np .allclose (result .state_vector (), [1 , 0 ])
381
381
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1 })
382
- assert np .allclose (result .state_vector (copy = False ), [0 , 1 ])
382
+ assert np .allclose (result .state_vector (), [0 , 1 ])
383
383
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 2 })
384
- assert np .allclose (result .state_vector (copy = False ), [1 , 0 ])
384
+ assert np .allclose (result .state_vector (), [1 , 0 ])
385
385
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : - 1 })
386
- assert np .allclose (result .state_vector (copy = False ), [0 , 1 ])
386
+ assert np .allclose (result .state_vector (), [0 , 1 ])
387
387
with pytest .raises (TypeError , match = 'Only integer or sympy repetitions are allowed' ):
388
388
cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1.5 })
389
389
with pytest .raises (ValueError , match = 'Circuit contains ops whose symbols were not specified' ):
@@ -392,13 +392,13 @@ def test_parameterized_repeat():
392
392
assert cirq .parameter_names (op ) == {'a' }
393
393
assert not cirq .has_unitary (op )
394
394
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 0 })
395
- assert np .allclose (result .state_vector (copy = False ), [1 , 0 ])
395
+ assert np .allclose (result .state_vector (), [1 , 0 ])
396
396
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1 })
397
- assert np .allclose (result .state_vector (copy = False ), [0 , 1 ])
397
+ assert np .allclose (result .state_vector (), [0 , 1 ])
398
398
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 2 })
399
- assert np .allclose (result .state_vector (copy = False ), [1 , 0 ])
399
+ assert np .allclose (result .state_vector (), [1 , 0 ])
400
400
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : - 1 })
401
- assert np .allclose (result .state_vector (copy = False ), [0 , 1 ])
401
+ assert np .allclose (result .state_vector (), [0 , 1 ])
402
402
with pytest .raises (TypeError , match = 'Only integer or sympy repetitions are allowed' ):
403
403
cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1.5 })
404
404
with pytest .raises (ValueError , match = 'Circuit contains ops whose symbols were not specified' ):
@@ -407,11 +407,11 @@ def test_parameterized_repeat():
407
407
assert cirq .parameter_names (op ) == {'a' , 'b' }
408
408
assert not cirq .has_unitary (op )
409
409
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1 , 'b' : 1 })
410
- assert np .allclose (result .state_vector (copy = False ), [0 , 1 ])
410
+ assert np .allclose (result .state_vector (), [0 , 1 ])
411
411
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 2 , 'b' : 1 })
412
- assert np .allclose (result .state_vector (copy = False ), [1 , 0 ])
412
+ assert np .allclose (result .state_vector (), [1 , 0 ])
413
413
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1 , 'b' : 2 })
414
- assert np .allclose (result .state_vector (copy = False ), [1 , 0 ])
414
+ assert np .allclose (result .state_vector (), [1 , 0 ])
415
415
with pytest .raises (TypeError , match = 'Only integer or sympy repetitions are allowed' ):
416
416
cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1.5 , 'b' : 1 })
417
417
with pytest .raises (ValueError , match = 'Circuit contains ops whose symbols were not specified' ):
@@ -420,11 +420,11 @@ def test_parameterized_repeat():
420
420
assert cirq .parameter_names (op ) == {'a' , 'b' }
421
421
assert not cirq .has_unitary (op )
422
422
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1 , 'b' : 1 })
423
- assert np .allclose (result .state_vector (copy = False ), [1 , 0 ])
423
+ assert np .allclose (result .state_vector (), [1 , 0 ])
424
424
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1.5 , 'b' : 1 })
425
- assert np .allclose (result .state_vector (copy = False ), [0 , 1 ])
425
+ assert np .allclose (result .state_vector (), [0 , 1 ])
426
426
result = cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1 , 'b' : 1.5 })
427
- assert np .allclose (result .state_vector (copy = False ), [0 , 1 ])
427
+ assert np .allclose (result .state_vector (), [0 , 1 ])
428
428
with pytest .raises (TypeError , match = 'Only integer or sympy repetitions are allowed' ):
429
429
cirq .Simulator ().simulate (cirq .Circuit (op ), param_resolver = {'a' : 1.5 , 'b' : 1.5 })
430
430
with pytest .raises (ValueError , match = 'Circuit contains ops whose symbols were not specified' ):
0 commit comments