From 0286ec6f8c5d8b356adf2c097e434704f6fcb26e Mon Sep 17 00:00:00 2001 From: Dave Bacon Date: Sun, 7 Nov 2021 18:58:58 +0000 Subject: [PATCH 1/4] Documentation lint fixes --- cirq-core/cirq/sim/clifford/clifford_simulator_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cirq-core/cirq/sim/clifford/clifford_simulator_test.py b/cirq-core/cirq/sim/clifford/clifford_simulator_test.py index 333914198b9..3a12d3d6f75 100644 --- a/cirq-core/cirq/sim/clifford/clifford_simulator_test.py +++ b/cirq-core/cirq/sim/clifford/clifford_simulator_test.py @@ -198,7 +198,7 @@ def test_simulate_moment_steps_intermediate_measurement(): np.testing.assert_almost_equal(step.state.to_numpy(), expected) if i == 2: expected = np.array([np.sqrt(0.5), np.sqrt(0.5) * (-1) ** result]) - np.testing.assert_almost_equal(step.state.to_numpy(), expected) + np.testing.assert_almost_equal(step.state.toCliffordTria_numpy(), expected) def test_clifford_state_initial_state(): From 811bcad9b00705ce8238a6eb9aeae392265af814 Mon Sep 17 00:00:00 2001 From: Dave Bacon Date: Sun, 7 Nov 2021 19:14:31 +0000 Subject: [PATCH 2/4] Fix lint errors --- cirq-core/cirq/circuits/circuit_operation_test.py | 2 -- cirq-core/cirq/sim/act_on_args_container_test.py | 2 +- cirq-core/cirq/sim/simulator_base_test.py | 2 +- cirq-google/cirq_google/engine/engine_sampler.py | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cirq-core/cirq/circuits/circuit_operation_test.py b/cirq-core/cirq/circuits/circuit_operation_test.py index 6a9c43cc4fe..7ada684253d 100644 --- a/cirq-core/cirq/circuits/circuit_operation_test.py +++ b/cirq-core/cirq/circuits/circuit_operation_test.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import List - import pytest, sympy import cirq diff --git a/cirq-core/cirq/sim/act_on_args_container_test.py b/cirq-core/cirq/sim/act_on_args_container_test.py index d16430dd6f0..ddc71f89214 100644 --- a/cirq-core/cirq/sim/act_on_args_container_test.py +++ b/cirq-core/cirq/sim/act_on_args_container_test.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import List, Dict, Any, Sequence, Tuple, Optional, Union +from typing import List, Dict, Any, Sequence, Optional, Union import cirq diff --git a/cirq-core/cirq/sim/simulator_base_test.py b/cirq-core/cirq/sim/simulator_base_test.py index 4539a764245..70e173e66be 100644 --- a/cirq-core/cirq/sim/simulator_base_test.py +++ b/cirq-core/cirq/sim/simulator_base_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import math -from typing import List, Dict, Any, Sequence, Tuple, Union +from typing import List, Dict, Any, Sequence, Union import numpy as np import pytest diff --git a/cirq-google/cirq_google/engine/engine_sampler.py b/cirq-google/cirq_google/engine/engine_sampler.py index 6ec32acb8f8..9453d91c2e7 100644 --- a/cirq-google/cirq_google/engine/engine_sampler.py +++ b/cirq-google/cirq_google/engine/engine_sampler.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import List, TYPE_CHECKING, Union, Optional, cast, Sequence, Tuple +from typing import List, TYPE_CHECKING, Union, Optional, cast, Sequence import cirq from cirq_google import engine From da429759e260f814e9698800235e75b9ab4562aa Mon Sep 17 00:00:00 2001 From: Dave Bacon Date: Sun, 7 Nov 2021 19:16:57 +0000 Subject: [PATCH 3/4] Fix bad file --- cirq-core/cirq/sim/clifford/clifford_simulator_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cirq-core/cirq/sim/clifford/clifford_simulator_test.py b/cirq-core/cirq/sim/clifford/clifford_simulator_test.py index 3a12d3d6f75..333914198b9 100644 --- a/cirq-core/cirq/sim/clifford/clifford_simulator_test.py +++ b/cirq-core/cirq/sim/clifford/clifford_simulator_test.py @@ -198,7 +198,7 @@ def test_simulate_moment_steps_intermediate_measurement(): np.testing.assert_almost_equal(step.state.to_numpy(), expected) if i == 2: expected = np.array([np.sqrt(0.5), np.sqrt(0.5) * (-1) ** result]) - np.testing.assert_almost_equal(step.state.toCliffordTria_numpy(), expected) + np.testing.assert_almost_equal(step.state.to_numpy(), expected) def test_clifford_state_initial_state(): From 991a8b70ad84a144d62a5374f3be46d7f6e0b135 Mon Sep 17 00:00:00 2001 From: Dave Bacon Date: Sun, 7 Nov 2021 19:19:30 +0000 Subject: [PATCH 4/4] abc --- cirq-core/cirq/sim/act_on_args_container_test.py | 2 +- cirq-core/cirq/sim/simulator_base_test.py | 2 +- cirq-google/cirq_google/engine/engine_sampler.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cirq-core/cirq/sim/act_on_args_container_test.py b/cirq-core/cirq/sim/act_on_args_container_test.py index ddc71f89214..16380bc592c 100644 --- a/cirq-core/cirq/sim/act_on_args_container_test.py +++ b/cirq-core/cirq/sim/act_on_args_container_test.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import List, Dict, Any, Sequence, Optional, Union +from typing import Any, Dict, List, Optional, Sequence, Union import cirq diff --git a/cirq-core/cirq/sim/simulator_base_test.py b/cirq-core/cirq/sim/simulator_base_test.py index 70e173e66be..16bf16a8bc0 100644 --- a/cirq-core/cirq/sim/simulator_base_test.py +++ b/cirq-core/cirq/sim/simulator_base_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import math -from typing import List, Dict, Any, Sequence, Union +from typing import Any, Dict, List, Sequence, Union import numpy as np import pytest diff --git a/cirq-google/cirq_google/engine/engine_sampler.py b/cirq-google/cirq_google/engine/engine_sampler.py index 9453d91c2e7..beb0a329790 100644 --- a/cirq-google/cirq_google/engine/engine_sampler.py +++ b/cirq-google/cirq_google/engine/engine_sampler.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import List, TYPE_CHECKING, Union, Optional, cast, Sequence +from typing import cast, List, Optional, Sequence, TYPE_CHECKING, Union import cirq from cirq_google import engine