Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
senecameeks committed Oct 21, 2024
1 parent 49acf02 commit d301604
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cirq-core/cirq/work/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Optional,
Sequence,
Tuple,
TypeVar,
TYPE_CHECKING,
Union,
)
Expand All @@ -43,6 +44,8 @@
if TYPE_CHECKING:
import cirq

T = TypeVar('T')


class Sampler(metaclass=value.ABCMetaImplementAnyOneOf):
"""Something capable of sampling quantum circuits. Simulator or hardware."""
Expand Down Expand Up @@ -486,6 +489,6 @@ def _get_measurement_shapes(
return {k: (num_instances[k], qid_shape) for k, qid_shape in qid_shapes.items()}


def _chunked(iterable: Sequence[Any], n: int) -> Iterator[tuple[Any, ...]]: # pragma: no cover
it = iter(iterable) # pragma: no cover
return iter(lambda: tuple(islice(it, n)), ()) # pragma: no cover
def _chunked(iterable: Sequence[T], n: int) -> Iterator[tuple[T, ...]]:
it = iter(iterable)
return iter(lambda: tuple(islice(it, n)), ())

0 comments on commit d301604

Please sign in to comment.