Skip to content

Commit

Permalink
Fix mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
verult committed Jun 29, 2022
1 parent da9e55c commit 6dc35a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cirq-google/cirq_google/devices/serializable_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def __init__(
has_subcircuit_support: bool = cirq.FrozenCircuit in gate_definitions

self._metadata = cirq.GridDeviceMetadata(
qubit_pairs=[
(cast(cirq.GridQubit, pair[0]), cast(cirq.GridQubit, pair[1]))
qubit_pairs=cast(List[Tuple[cirq.GridQubit, cirq.GridQubit]], [
(pair[0], pair[1])
for gate_defs in gate_definitions.values()
for gate_def in gate_defs
if gate_def.number_of_qubits == 2
Expand All @@ -113,7 +113,7 @@ def __init__(
and pair[0] < pair[1]
and isinstance(pair[0], cirq.GridQubit)
and isinstance(pair[1], cirq.GridQubit)
],
]),
gateset=cirq.Gateset(
*(g for g in gate_definitions.keys() if issubclass(g, cirq.Gate)),
cirq.GlobalPhaseGate,
Expand Down

0 comments on commit 6dc35a7

Please sign in to comment.