Beispiel #1
0
    def qid_pairs(self) -> FrozenSet['cirq.SymmetricalQidPair']:
        """Qubits have all-to-all connectivity, so returns all pairs.

        Returns:
            All qubit pairs on the device.
        """
        qs = self.qubits
        return frozenset([devices.SymmetricalQidPair(q, q2) for q in qs for q2 in qs if q < q2])
Beispiel #2
0
 def qid_pairs(self) -> FrozenSet['cirq.SymmetricalQidPair']:
     return frozenset(
         [
             devices.SymmetricalQidPair(*edge)  # type: ignore
             for edge in self.device_graph.edges
             if len(edge) == 2 and all(isinstance(q, ops.Qid) for q in edge)
         ]
     )
Beispiel #3
0
    def qid_pairs(self) -> FrozenSet['cirq.SymmetricalQidPair']:
        """Qubits have all-to-all connectivity, so returns all pairs.

        Returns:
            All qubit pairs on the device.
        """
        with _compat.block_overlapping_deprecation('device\\.metadata'):
            qs = self.qubits
            return frozenset([devices.SymmetricalQidPair(q, q2) for q in qs for q2 in qs if q < q2])
Beispiel #4
0
 def qid_pairs(self) -> FrozenSet['cirq.SymmetricalQidPair']:
     with _compat.block_overlapping_deprecation('device\\.metadata'):
         return frozenset(
             [
                 devices.SymmetricalQidPair(*edge)  # type: ignore
                 for edge in self.device_graph.edges
                 if len(edge) == 2 and all(isinstance(q, ops.Qid) for q in edge)
             ]
         )