A fake device that was created to ensure certain Device validation features are leveraged in Circuit functions.
Inherits From: Device
View aliases
Main aliases
cirq.testing.ValidatingTestDevice(
qubits: AbstractSet[cirq.Qid
],
name: str = 'ValidatingTestDevice',
allowed_gates: Tuple[type, ...] = (ops.Gate,),
allowed_qubit_types: Tuple[type, ...] = (devices.GridQubit,),
validate_locality: bool = False,
auto_decompose_gates: Tuple[type, ...] = tuple()
)
It contains the minimum set of features that tests require. Feel free to extend the features here as needed.
Methods
validate_circuit
validate_circuit(
circuit: 'cirq.AbstractCircuit'
) -> None
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_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: cirq.Operation
) -> None
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. |