Skip to content

Commit a49cdcd

Browse files
authored
Merge branch 'main' into saurav/black-jupyter-script
2 parents 1f6915c + 716549e commit a49cdcd

File tree

114 files changed

+410
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+410
-161
lines changed

cirq-aqt/cirq_aqt/aqt_device.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
The native gate set consists of the local gates: X, Y, and XX entangling gates
2525
"""
2626

27+
from __future__ import annotations
28+
2729
import json
2830
from enum import Enum
2931
from typing import Any, cast, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Union

cirq-aqt/cirq_aqt/aqt_device_metadata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
"""DeviceMetadata for ion trap device with mutually linked qubits placed on a line."""
1616

17+
from __future__ import annotations
18+
1719
from typing import Any, Iterable, Mapping
1820

1921
import networkx as nx

cirq-aqt/cirq_aqt/aqt_device_metadata_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
"""Tests for AQTDeviceMetadata."""
1616

17+
from __future__ import annotations
18+
1719
from typing import List
1820

1921
import pytest

cirq-aqt/cirq_aqt/aqt_sampler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
2323
"""
2424

25+
from __future__ import annotations
26+
2527
import json
2628
import time
2729
import uuid

cirq-aqt/cirq_aqt/aqt_sampler_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import json
1618
from unittest import mock
1719

cirq-aqt/cirq_aqt/aqt_simulator_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import pytest
1618

1719
import cirq

cirq-aqt/cirq_aqt/aqt_target_gateset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
"""Target gateset for ion trap device with mutually linked qubits placed on a line."""
1616

17+
from __future__ import annotations
18+
1719
from typing import List
1820

1921
import numpy as np

cirq-aqt/cirq_aqt/aqt_target_gateset_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
"""Tests for AQTTargetGateset."""
1616

17+
from __future__ import annotations
18+
1719
import pytest
1820
import sympy
1921

cirq-aqt/cirq_aqt/json_resolver_cache.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import functools
1618
from typing import Dict
1719

cirq-core/cirq/_compat.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# limitations under the License.
1414

1515
"""Workarounds for compatibility issues between versions and libraries."""
16+
17+
from __future__ import annotations
18+
1619
import contextlib
1720
import contextvars
1821
import dataclasses

cirq-core/cirq/_doc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# limitations under the License.
1414
"""Workaround for associating docstrings with public constants."""
1515

16+
from __future__ import annotations
17+
1618
from typing import Any, Dict
1719

1820
RECORDED_CONST_DOCS: Dict[int, str] = {}

cirq-core/cirq/_import.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import importlib
1618
import sys
1719
from contextlib import contextmanager

cirq-core/cirq/_import_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from cirq import _import
1618

1719

18-
def test_lazy_loader():
20+
def test_lazy_loader() -> None:
1921
linalg = _import.LazyLoader("linalg", globals(), "scipy.linalg")
20-
linalg.fun = 1
22+
linalg.fun = 1 # type: ignore[attr-defined]
2123
assert linalg._module is None
2224
assert "linalg" not in linalg.__dict__
2325

cirq-core/cirq/circuits/_block_diagram_drawer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import collections
1618
from typing import Dict, List, Optional, Tuple
1719

cirq-core/cirq/circuits/_block_diagram_drawer_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import itertools
1618

1719
import pytest

cirq-core/cirq/circuits/_box_drawing_character_data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
"""Exposes structured data about unicode/ascii box drawing characters."""
1616

17+
from __future__ import annotations
18+
1719
from typing import List, NamedTuple, Optional
1820

1921
_BoxDrawCharacterSet = NamedTuple(

cirq-core/cirq/circuits/_box_drawing_character_data_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from cirq.circuits._box_drawing_character_data import (
1618
BOLD_BOX_CHARS,
1719
box_draw_character,

cirq-core/cirq/circuits/_bucket_priority_queue.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from typing import Any, Generic, Iterable, Iterator, List, Optional, Set, Tuple, TypeVar
1618

1719
TItem = TypeVar('TItem')

cirq-core/cirq/circuits/_bucket_priority_queue_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import pytest
1618

1719
import cirq

cirq-core/cirq/circuits/circuit_operation_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
from __future__ import annotations
16+
1417
import unittest.mock as mock
1518
from typing import Optional
1619

cirq-core/cirq/circuits/circuit_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import itertools
1618
import os
1719
import time

cirq-core/cirq/circuits/frozen_circuit_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
Behavior shared with Circuit is tested with parameters in circuit_test.py.
1717
"""
1818

19+
from __future__ import annotations
20+
1921
import pytest
2022
import sympy
2123

cirq-core/cirq/circuits/insert_strategy_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import pickle
1618

1719
import pytest

cirq-core/cirq/circuits/moment_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import numpy as np
1618
import pytest
1719
import sympy

cirq-core/cirq/circuits/optimization_pass_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from typing import List, Optional, Set
1618

1719
import pytest

cirq-core/cirq/circuits/qasm_output_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
from __future__ import annotations
16+
1417
import os
1518
import re
1619

cirq-core/cirq/circuits/text_diagram_drawer_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from unittest import mock
1618

1719
import pytest

cirq-core/cirq/contrib/acquaintance/bipartite_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import itertools
1618

1719
import pytest

cirq-core/cirq/contrib/acquaintance/devices_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import pytest
1618

1719
import cirq

cirq-core/cirq/contrib/acquaintance/executor_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from itertools import combinations
1618
from string import ascii_lowercase
1719
from typing import Dict, Sequence, Tuple

cirq-core/cirq/contrib/acquaintance/inspection_utils_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from itertools import combinations, product
1618

1719
import pytest

cirq-core/cirq/contrib/acquaintance/mutation_utils_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from string import ascii_lowercase as alphabet
1618

1719
import pytest

cirq-core/cirq/contrib/acquaintance/optimizers_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
from __future__ import annotations
16+
1417
import cirq
1518
import cirq.contrib.acquaintance as cca
1619
import cirq.testing as ct

cirq-core/cirq/contrib/acquaintance/permutation_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import random
1618

1719
import pytest

cirq-core/cirq/contrib/acquaintance/shift_swap_network_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import itertools
1618
import random
1719

cirq-core/cirq/contrib/acquaintance/shift_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import cirq
1618
import cirq.contrib.acquaintance as cca
1719

cirq-core/cirq/contrib/acquaintance/strategies/cubic_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import itertools
1618

1719
import pytest

cirq-core/cirq/contrib/acquaintance/strategies/quartic_paired_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import itertools
1618
import random
1719

cirq-core/cirq/contrib/acquaintance/testing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from typing import cast, Sequence, TYPE_CHECKING
1618

1719
from cirq import devices, ops, protocols

cirq-core/cirq/contrib/acquaintance/topological_sort_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import pytest
1618

1719
import cirq

cirq-core/cirq/contrib/bayesian_network/bayesian_network_gate_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
from __future__ import annotations
16+
1417
import numpy as np
1518
import pytest
1619

cirq-core/cirq/contrib/circuitdag/circuit_dag_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import itertools
1618
import random
1719

cirq-core/cirq/contrib/graph_device/graph_device_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import pytest
1618

1719
import cirq

0 commit comments

Comments
 (0)