def __init__(self, max_parallel_z: Optional[int] = None, max_parallel_xy: Optional[int] = None): super().__init__( ops.AnyIntegerPowerGateFamily(ops.CNotPowGate), ops.AnyIntegerPowerGateFamily(ops.CCNotPowGate), ops.AnyIntegerPowerGateFamily(ops.CZPowGate), ops.AnyIntegerPowerGateFamily(ops.CCZPowGate), ops.ParallelGateFamily(ops.ZPowGate, max_parallel_allowed=max_parallel_z), ops.ParallelGateFamily(ops.XPowGate, max_parallel_allowed=max_parallel_xy), ops.ParallelGateFamily(ops.YPowGate, max_parallel_allowed=max_parallel_xy), ops.ParallelGateFamily(ops.PhasedXPowGate, max_parallel_allowed=max_parallel_xy), ops.MeasurementGate, ops.IdentityGate, unroll_circuit_op=False, )
def neutral_atom_gateset(max_parallel_z=None, max_parallel_xy=None): return ops.Gateset( ops.AnyIntegerPowerGateFamily(ops.CNotPowGate), ops.AnyIntegerPowerGateFamily(ops.CCNotPowGate), ops.AnyIntegerPowerGateFamily(ops.CZPowGate), ops.AnyIntegerPowerGateFamily(ops.CCZPowGate), ops.ParallelGateFamily(ops.ZPowGate, max_parallel_allowed=max_parallel_z), ops.ParallelGateFamily(ops.XPowGate, max_parallel_allowed=max_parallel_xy), ops.ParallelGateFamily(ops.YPowGate, max_parallel_allowed=max_parallel_xy), ops.ParallelGateFamily(ops.PhasedXPowGate, max_parallel_allowed=max_parallel_xy), ops.MeasurementGate, ops.IdentityGate, unroll_circuit_op=False, )
def __init__( self, measurement_duration: 'cirq.DURATION_LIKE', gate_duration: 'cirq.DURATION_LIKE', control_radius: float, max_parallel_z: int, max_parallel_xy: int, max_parallel_c: int, qubits: Iterable[GridQubit], ) -> None: """Initializes the description of the AQuA device. Args: measurement_duration: the maximum duration of a measurement. gate_duration: the maximum duration of a gate control_radius: the maximum distance between qubits for a controlled gate. Distance is measured in units of the indices passed into the GridQubit constructor. max_parallel_z: The maximum number of qubits that can be acted on in parallel by a Z gate max_parallel_xy: The maximum number of qubits that can be acted on in parallel by a local XY gate max_parallel_c: the maximum number of qubits that can be acted on in parallel by a controlled gate. Must be less than or equal to the lesser of max_parallel_z and max_parallel_xy qubits: Qubits on the device, identified by their x, y location. Must be of type GridQubit Raises: ValueError: if the wrong qubit type is provided or if invalid parallel parameters are provided """ self._measurement_duration = Duration(measurement_duration) self._gate_duration = Duration(gate_duration) self._control_radius = control_radius self._max_parallel_z = max_parallel_z self._max_parallel_xy = max_parallel_xy if max_parallel_c > min(max_parallel_z, max_parallel_xy): raise ValueError("max_parallel_c must be less than or equal to the" "min of max_parallel_z and max_parallel_xy") self._max_parallel_c = max_parallel_c self.xy_gateset_all_allowed = ops.Gateset( ops.ParallelGateFamily(ops.XPowGate), ops.ParallelGateFamily(ops.YPowGate), ops.ParallelGateFamily(ops.PhasedXPowGate), unroll_circuit_op=False, ) self.controlled_gateset = ops.Gateset( ops.AnyIntegerPowerGateFamily(ops.CNotPowGate), ops.AnyIntegerPowerGateFamily(ops.CCNotPowGate), ops.AnyIntegerPowerGateFamily(ops.CZPowGate), ops.AnyIntegerPowerGateFamily(ops.CCZPowGate), unroll_circuit_op=False, ) self.gateset = NeutralAtomGateset(max_parallel_z, max_parallel_xy) for q in qubits: if not isinstance(q, GridQubit): raise ValueError(f'Unsupported qubit type: {q!r}') self.qubits = frozenset(qubits) self._metadata = devices.GridDeviceMetadata( [(a, b) for a in self.qubits for b in self.qubits if a.is_adjacent(b)], self.gateset)