qml.devices.preprocess.no_sampling¶
- no_sampling(tape, name='device')[source]¶
Raises an error if the tape has finite shots.
- Parameters
tape (QuantumTape or QNode or Callable) – a quantum circuit
name (str) – name to use in error message.
- 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]
This transform can be added to forbid finite shots. For example,
default.qubit
uses it for adjoint and backprop validation.
code/api/pennylane.devices.preprocess.no_sampling
Download Python script
Download Notebook
View on GitHub