qml.devices.preprocess.no_analytic¶
- no_analytic(tape, name='device')[source]¶
Raises an error if the tape does not have finite shots. :param tape: a quantum circuit :type tape: QuantumTape or .QNode or Callable :param name: name to use in error message. :type name: str
- 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 analytic results. This is relevant for devices that can only return samples and/or counts based results.
code/api/pennylane.devices.preprocess.no_analytic
Download Python script
Download Notebook
View on GitHub