cirq.google.XmonDevice

class cirq.google.XmonDevice(measurement_duration: cirq.value.duration.Duration, exp_w_duration: cirq.value.duration.Duration, exp_11_duration: cirq.value.duration.Duration, qubits: Iterable[cirq.devices.grid_qubit.GridQubit])[source]

A device with qubits placed in a grid. Neighboring qubits can interact.

__init__(measurement_duration: cirq.value.duration.Duration, exp_w_duration: cirq.value.duration.Duration, exp_11_duration: cirq.value.duration.Duration, qubits: Iterable[cirq.devices.grid_qubit.GridQubit]) → None[source]

Initializes the description of an xmon device.

Parameters:
  • measurement_duration – The maximum duration of a measurement.
  • exp_w_duration – The maximum duration of an ExpW operation.
  • exp_11_duration – The maximum duration of an ExpZ operation.
  • qubits – Qubits on the device, identified by their x, y location.

Methods

at(row, col) Returns the qubit at the given position, if there is one, else None.
can_add_operation_into_moment(operation, moment) Determines if it’s possible to add an operation into a moment.
col(col) Returns the qubits in the given column, in ascending order.
decompose_operation(operation) Returns a device-valid decomposition for the given operation.
duration_of(operation)
neighbors_of(qubit) Returns the qubits that the given qubit can interact with.
row(row) Returns the qubits in the given row, in ascending order.
validate_circuit(circuit) Raises an exception if a circuit is not valid.
validate_gate(gate) Raises an error if the given gate isn’t allowed.
validate_moment(moment) Raises an exception if a moment is not valid.
validate_operation(operation) Raises an exception if an operation is not valid.
validate_schedule(schedule) Raises an exception if a schedule is not valid.
validate_scheduled_operation(schedule, …) Raises an exception if the scheduled operation is not valid.