![]() |
A device with qubits placed on a line.
Inherits From: Device
cirq.IonDevice(
measurement_duration: 'cirq.DURATION_LIKE',
twoq_gates_duration: 'cirq.DURATION_LIKE',
oneq_gates_duration: 'cirq.DURATION_LIKE',
qubits: Iterable[cirq.LineQubit
]
) -> None
Qubits have all-to-all connectivity.
Args | |
---|---|
measurement_duration
|
The maximum duration of a measurement. |
twoq_gates_duration
|
The maximum duration of a two qubit operation. |
oneq_gates_duration
|
The maximum duration of a single qubit operation. |
qubits
|
Qubits on the device, identified by their x location. |
Raises | |
---|---|
TypeError
|
If not all the qubits supplied are cirq.LineQubit s.
|
Attributes | |
---|---|
metadata
|
Returns the associated Metadata with the device if applicable. |
Methods
at
at(
position: int
) -> Optional[cirq.LineQubit
]
Returns the qubit at the given position, if there is one, else None.
can_add_operation_into_moment
can_add_operation_into_moment(
operation: 'cirq.Operation', moment: 'cirq.Moment'
) -> bool
THIS FUNCTION IS DEPRECATED.
IT WILL BE REMOVED IN cirq v0.15
.
can_add_operation_into_moment will be removed in the future. Consider using device.validate_circuit instead.
Determines if it's possible to add an operation into a moment.
For example, on the XmonDevice two CZs shouldn't be placed in the same
moment if they are on adjacent qubits.
Args:
operation: The operation being added.
moment: The moment being transformed.
Returns:
Whether or not the moment will validate after adding the operation.
decompose_circuit
decompose_circuit(
circuit: cirq.Circuit
) -> cirq.Circuit
decompose_operation
decompose_operation(
operation: cirq.Operation
) -> cirq.OP_TREE
THIS FUNCTION IS DEPRECATED.
IT WILL BE REMOVED IN cirq v0.15
.
Use cirq.ConvertToIonGates() instead to decompose operations.
duration_of
duration_of(
operation
)
neighbors_of
neighbors_of(
qubit: cirq.LineQubit
) -> Iterable[cirq.LineQubit
]
Returns the qubits that the given qubit can interact with.
qid_pairs
qid_pairs() -> FrozenSet['cirq.SymmetricalQidPair']
THIS FUNCTION IS DEPRECATED.
IT WILL BE REMOVED IN cirq v0.15
.
qubit coupling data can now be found in device.metadata if provided.
Qubits have all-to-all connectivity, so returns all pairs.
Returns:
All qubit pairs on the device.
qubit_set
qubit_set() -> FrozenSet['cirq.LineQubit']
THIS FUNCTION IS DEPRECATED.
IT WILL BE REMOVED IN cirq v0.15
.
Use metadata.qubit_set if applicable.
validate_circuit
validate_circuit(
circuit: cirq.AbstractCircuit
)
Raises an exception if a circuit is not valid.
Args | |
---|---|
circuit
|
The circuit to validate. |
Raises | |
---|---|
ValueError
|
The circuit isn't valid for this device. |
validate_gate
validate_gate(
gate: cirq.Gate
)
validate_moment
validate_moment(
moment: 'cirq.Moment'
) -> None
Raises an exception if a moment is not valid.
Args | |
---|---|
moment
|
The moment to validate. |
Raises | |
---|---|
ValueError
|
The moment isn't valid for this device. |
validate_operation
validate_operation(
operation
)
Raises an exception if an operation is not valid.
Args | |
---|---|
operation
|
The operation to validate. |
Raises | |
---|---|
ValueError
|
The operation isn't valid for this device. |
__eq__
__eq__(
other: _SupportsValueEquality
) -> bool