diff --git a/recirq/benchmarks/rabi_oscillations.py b/recirq/benchmarks/rabi_oscillations.py index 3a8b5916..0366f644 100644 --- a/recirq/benchmarks/rabi_oscillations.py +++ b/recirq/benchmarks/rabi_oscillations.py @@ -18,8 +18,6 @@ from matplotlib import pyplot as plt -# this is for older systems with matplotlib <3.2 otherwise 3d projections fail -from mpl_toolkits import mplot3d # pylint: disable=unused-import import cirq diff --git a/recirq/benchmarks/xeb/grid_parallel_two_qubit_xeb.py b/recirq/benchmarks/xeb/grid_parallel_two_qubit_xeb.py index 27a85c64..61aee9d8 100644 --- a/recirq/benchmarks/xeb/grid_parallel_two_qubit_xeb.py +++ b/recirq/benchmarks/xeb/grid_parallel_two_qubit_xeb.py @@ -29,7 +29,6 @@ Optional, Sequence, Type, - TYPE_CHECKING, Tuple, cast, ) diff --git a/recirq/cluster_state_mipt/cluster_state.py b/recirq/cluster_state_mipt/cluster_state.py index 8a1977cd..63502352 100644 --- a/recirq/cluster_state_mipt/cluster_state.py +++ b/recirq/cluster_state_mipt/cluster_state.py @@ -13,7 +13,6 @@ # limitations under the License. import cirq -import cirq_google as cg import numpy as np def get_two_qubits_6x6(d=6): diff --git a/recirq/cluster_state_mipt/data_collect_test.py b/recirq/cluster_state_mipt/data_collect_test.py index 72215f9e..ce7630a6 100644 --- a/recirq/cluster_state_mipt/data_collect_test.py +++ b/recirq/cluster_state_mipt/data_collect_test.py @@ -18,9 +18,7 @@ import tempfile from unittest import mock -import cirq import cirq_google as cg -import numpy as np import pytest from recirq.cluster_state_mipt import data_collect diff --git a/recirq/engine_utils.py b/recirq/engine_utils.py index 584abaad..8b371448 100644 --- a/recirq/engine_utils.py +++ b/recirq/engine_utils.py @@ -17,8 +17,8 @@ import math import os import uuid -from dataclasses import dataclass, field -from typing import List, Any, Optional, Callable, Dict, Union +from dataclasses import dataclass +from typing import List, Any, Optional, Callable import numpy as np diff --git a/recirq/kpz/experiment.py b/recirq/kpz/experiment.py index 56174742..b960299e 100644 --- a/recirq/kpz/experiment.py +++ b/recirq/kpz/experiment.py @@ -44,7 +44,7 @@ """ -from typing import Iterator, List, Set, Tuple, Union, Optional +from typing import Iterator, List, Union, Optional import cirq import numpy as np diff --git a/recirq/kpz/experiment_test.py b/recirq/kpz/experiment_test.py index 3b09dc8d..1132fc9b 100644 --- a/recirq/kpz/experiment_test.py +++ b/recirq/kpz/experiment_test.py @@ -14,7 +14,6 @@ import cirq import numpy as np -import pytest from recirq.kpz import experiment as kpz diff --git a/recirq/lattice_gauge/lattice_gauge_grid_test.py b/recirq/lattice_gauge/lattice_gauge_grid_test.py index 55c85faa..eea884b6 100644 --- a/recirq/lattice_gauge/lattice_gauge_grid_test.py +++ b/recirq/lattice_gauge/lattice_gauge_grid_test.py @@ -14,8 +14,6 @@ import cirq -import numpy as np -import matplotlib.pyplot as plt from recirq.lattice_gauge.lattice_gauge_grid import LGTGrid def test_z_plaquette_to_physical_qubit_indices(): diff --git a/recirq/qaoa/experiments/optimization_tasks.py b/recirq/qaoa/experiments/optimization_tasks.py index fc12e7f2..d5badbcd 100644 --- a/recirq/qaoa/experiments/optimization_tasks.py +++ b/recirq/qaoa/experiments/optimization_tasks.py @@ -1,6 +1,5 @@ from typing import Dict, Sequence, Optional, List, Tuple import os -import shutil import numpy as np import cirq diff --git a/recirq/qaoa/experiments/p1_landscape_tasks.py b/recirq/qaoa/experiments/p1_landscape_tasks.py index b5688d5f..4ba26a28 100644 --- a/recirq/qaoa/experiments/p1_landscape_tasks.py +++ b/recirq/qaoa/experiments/p1_landscape_tasks.py @@ -6,19 +6,14 @@ import cirq import numpy as np import recirq -from recirq.qaoa.circuit_structure import BadlyStructuredCircuitError, \ - find_circuit_structure_violations -from recirq.qaoa.classical_angle_optimization import OptimizationResult -from recirq.qaoa.experiments.angle_precomputation_tasks import AnglePrecomputationTask, \ - DEFAULT_BASE_DIR as DEFAULT_PRECOMPUTATION_BASE_DIR from recirq.qaoa.experiments.problem_generation_tasks import \ - DEFAULT_BASE_DIR as DEFAULT_PROBLEM_GENERATION_BASE_DIR, ProblemGenerationTaskT, \ + DEFAULT_PROBLEM_GENERATION_BASE_DIR, ProblemGenerationTaskT, \ SKProblemGenerationTask -from recirq.qaoa.gates_and_compilation import compile_to_non_negligible from recirq.qaoa.placement import place_line_on_device from recirq.qaoa.problem_circuits import get_compiled_hardware_grid_circuit, \ get_compiled_sk_model_circuit, get_compiled_3_regular_maxcut_circuit -from recirq.qaoa.problems import ProblemT, HardwareGridProblem, SKProblem, ThreeRegularProblem +from recirq.qaoa.problems import HardwareGridProblem, SKProblem, ThreeRegularProblem + EXPERIMENT_NAME = 'qaoa-p1-landscape' DEFAULT_BASE_DIR = os.path.expanduser(f'~/cirq-results/{EXPERIMENT_NAME}') diff --git a/recirq/qaoa/experiments/precomputed_execution_tasks.py b/recirq/qaoa/experiments/precomputed_execution_tasks.py index 9f84d3da..faae7f36 100644 --- a/recirq/qaoa/experiments/precomputed_execution_tasks.py +++ b/recirq/qaoa/experiments/precomputed_execution_tasks.py @@ -4,7 +4,6 @@ import recirq from recirq.qaoa.circuit_structure import BadlyStructuredCircuitError, \ find_circuit_structure_violations -from recirq.qaoa.classical_angle_optimization import OptimizationResult from recirq.qaoa.experiments.angle_precomputation_tasks import AnglePrecomputationTask, \ DEFAULT_BASE_DIR as DEFAULT_PRECOMPUTATION_BASE_DIR from recirq.qaoa.experiments.problem_generation_tasks import \ @@ -13,7 +12,8 @@ from recirq.qaoa.placement import place_line_on_device from recirq.qaoa.problem_circuits import get_compiled_hardware_grid_circuit, \ get_compiled_sk_model_circuit, get_compiled_3_regular_maxcut_circuit -from recirq.qaoa.problems import ProblemT, HardwareGridProblem, SKProblem, ThreeRegularProblem +from recirq.qaoa.problems import HardwareGridProblem, SKProblem, ThreeRegularProblem + EXPERIMENT_NAME = 'qaoa-precomputed' DEFAULT_BASE_DIR = os.path.expanduser(f'~/cirq-results/{EXPERIMENT_NAME}') diff --git a/recirq/qaoa/placement.py b/recirq/qaoa/placement.py index ba407f8f..60c6c2df 100644 --- a/recirq/qaoa/placement.py +++ b/recirq/qaoa/placement.py @@ -15,7 +15,7 @@ # release containing routing is pushed and no previous Cirq releases that don't contain routing # are supported in ReCirq. try: - from cirq import RouteCQCC + from cirq import RouteCQC except ImportError: RouteCQC = NotImplemented try: diff --git a/recirq/qaoa/placement_test.py b/recirq/qaoa/placement_test.py index 4ec15d09..cb9a24ab 100644 --- a/recirq/qaoa/placement_test.py +++ b/recirq/qaoa/placement_test.py @@ -15,8 +15,6 @@ min_weight_simple_path_anneal from recirq.qaoa.problem_circuits import get_generic_qaoa_circuit -from recirq.qaoa.placement import pytket - def permute_gate(qubits: Sequence[cirq.Qid], permutation: List[int]): return cca.LinearPermutationGate( diff --git a/recirq/qcqmc/afqmc_circuits.py b/recirq/qcqmc/afqmc_circuits.py index f7b01488..6b93bc13 100644 --- a/recirq/qcqmc/afqmc_circuits.py +++ b/recirq/qcqmc/afqmc_circuits.py @@ -14,9 +14,8 @@ """Trial wavefunction circuit ansatz primitives.""" import itertools -from typing import Dict, Iterable, Iterator, List, Sequence, Tuple +from typing import Dict, Iterable, List, Sequence, Tuple -import attrs import cirq import numpy as np import openfermion diff --git a/recirq/qcqmc/convert_to_ipie_test.py b/recirq/qcqmc/convert_to_ipie_test.py index 37cd0e1c..b3427b76 100644 --- a/recirq/qcqmc/convert_to_ipie_test.py +++ b/recirq/qcqmc/convert_to_ipie_test.py @@ -20,7 +20,7 @@ import fqe.wavefunction as fqe_wfn import fqe.bitstring as fqe_bs -from recirq.qcqmc import analysis, convert_to_ipie +from recirq.qcqmc import convert_to_ipie def test_rotate_wavefunction_explicitly(): diff --git a/recirq/qcqmc/optimize_wf.py b/recirq/qcqmc/optimize_wf.py index 1e6259fd..47308b7f 100644 --- a/recirq/qcqmc/optimize_wf.py +++ b/recirq/qcqmc/optimize_wf.py @@ -15,7 +15,7 @@ import copy import itertools -from typing import Dict, List, Mapping, Optional, Sequence, Tuple, Union +from typing import Dict, List, Mapping, Optional, Sequence, Tuple import cirq import fqe diff --git a/recirq/qcqmc/optimize_wf_test.py b/recirq/qcqmc/optimize_wf_test.py index 23419b38..eb1324d0 100644 --- a/recirq/qcqmc/optimize_wf_test.py +++ b/recirq/qcqmc/optimize_wf_test.py @@ -14,7 +14,6 @@ import fqe import fqe.hamiltonians.restricted_hamiltonian as fqe_hams -import fqe.wavefunction as fqe_wfn import numpy as np import pytest diff --git a/recirq/qml_lfe/learn_dynamics_c_test.py b/recirq/qml_lfe/learn_dynamics_c_test.py index 0b67b7d8..a62bc6ae 100644 --- a/recirq/qml_lfe/learn_dynamics_c_test.py +++ b/recirq/qml_lfe/learn_dynamics_c_test.py @@ -13,7 +13,6 @@ # limitations under the License. import os -import pytest import numpy as np from recirq.qml_lfe import learn_dynamics_c diff --git a/recirq/qml_lfe/learn_dynamics_q_test.py b/recirq/qml_lfe/learn_dynamics_q_test.py index de7987b6..d9540a03 100644 --- a/recirq/qml_lfe/learn_dynamics_q_test.py +++ b/recirq/qml_lfe/learn_dynamics_q_test.py @@ -13,7 +13,6 @@ # limitations under the License. import os -import pytest import numpy as np from recirq.qml_lfe import learn_dynamics_q diff --git a/recirq/qml_lfe/learn_states_c_test.py b/recirq/qml_lfe/learn_states_c_test.py index 0f4b27e4..f2e9c7f9 100644 --- a/recirq/qml_lfe/learn_states_c_test.py +++ b/recirq/qml_lfe/learn_states_c_test.py @@ -1,6 +1,4 @@ import os -import pytest -import tempfile import numpy as np from recirq.qml_lfe import learn_states_c diff --git a/recirq/qml_lfe/learn_states_q_test.py b/recirq/qml_lfe/learn_states_q_test.py index 222ed3cc..34285f48 100644 --- a/recirq/qml_lfe/learn_states_q_test.py +++ b/recirq/qml_lfe/learn_states_q_test.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pytest import os import numpy as np from recirq.qml_lfe import learn_states_q diff --git a/recirq/qml_lfe/run_config.py b/recirq/qml_lfe/run_config.py index d366b2bb..afb5ee52 100644 --- a/recirq/qml_lfe/run_config.py +++ b/recirq/qml_lfe/run_config.py @@ -15,7 +15,6 @@ """Runtime configuration items for excuting experiments on Weber (or sim).""" from typing import Dict, List -import os import cirq import cirq_google diff --git a/recirq/qml_lfe/run_config_test.py b/recirq/qml_lfe/run_config_test.py index 871971a3..90cf1eb9 100644 --- a/recirq/qml_lfe/run_config_test.py +++ b/recirq/qml_lfe/run_config_test.py @@ -11,7 +11,6 @@ # 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. -import pytest import cirq from recirq.qml_lfe import run_config import numpy as np diff --git a/recirq/readout_scan/run-readout-scan.py b/recirq/readout_scan/run-readout-scan.py index 9d9b2c77..a00c0746 100644 --- a/recirq/readout_scan/run-readout-scan.py +++ b/recirq/readout_scan/run-readout-scan.py @@ -19,7 +19,6 @@ from recirq.readout_scan.tasks import ReadoutScanTask, run_readout_scan -import datetime import cirq_google as cg MAX_N_QUBITS = 5 diff --git a/recirq/serialization_utils_test.py b/recirq/serialization_utils_test.py index 71a9676d..9679bf70 100644 --- a/recirq/serialization_utils_test.py +++ b/recirq/serialization_utils_test.py @@ -14,15 +14,9 @@ import recirq -import abc -import inspect import io -import itertools -import textwrap -import networkx as nx import numpy as np -import pytest import cirq diff --git a/recirq/time_crystals/dtc_simulation.py b/recirq/time_crystals/dtc_simulation.py index e758d7e6..c5db51c8 100644 --- a/recirq/time_crystals/dtc_simulation.py +++ b/recirq/time_crystals/dtc_simulation.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Sequence, Tuple, List, Iterator +from typing import Sequence, List, Iterator import functools import numpy as np diff --git a/recirq/time_crystals/dtc_simulation_test.py b/recirq/time_crystals/dtc_simulation_test.py index f35e7053..094c75a7 100644 --- a/recirq/time_crystals/dtc_simulation_test.py +++ b/recirq/time_crystals/dtc_simulation_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import List, Tuple +from typing import Tuple import numpy as np import itertools diff --git a/recirq/toric_code/toric_code_state_prep_test.py b/recirq/toric_code/toric_code_state_prep_test.py index 79ef7a58..d8963676 100644 --- a/recirq/toric_code/toric_code_state_prep_test.py +++ b/recirq/toric_code/toric_code_state_prep_test.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Tuple - import cirq import numpy as np import pytest