qml.devices.preprocess.validate_device_wires¶
-
validate_device_wires
(tape, wires=None, name='device')[source]¶ Validates that all wires present in the tape are in the set of provided wires. Adds the device wires to measurement processes like
StateMP
that are broadcasted across all available wires.- Parameters
tape (QuantumTape or QNode or Callable) – a quantum circuit.
wires=None (Optional[Wires]) – the allowed wires. Wires of
None
allows any wires to be present in the tape.name="device" (str) – the name of the device to use in error messages.
- Returns
The unaltered input circuit. The output type is explained in
qml.transform
.- Return type
qnode (QNode) or quantum function (Callable) or tuple[List[QuantumTape], function]
- Raises
WireError – if the tape has a wire not present in the provided wires.
code/api/pennylane.devices.preprocess.validate_device_wires
Download Python script
Download Notebook
View on GitHub