qml.devices.preprocess.mid_circuit_measurements¶
- mid_circuit_measurements(tape, device, mcm_config=MCMConfig(mcm_method=None, postselect_mode=None), **kwargs)[source]¶
Provide the transform to handle mid-circuit measurements.
In the case where no method is specified, if the tape or device uses finite-shot, the
qml.dynamic_one_shottransform will be applied, otherwiseqml.defer_measurementsis used instead.Warning
This transform is deprecated and will be removed in a future release. Instead, the device should determine which mcm method to use, and explicitly include
dynamic_one_shot()ordefer_measurements()in its preprocess transforms if necessary. SeeDefaultQubit.setup_execution_configandDefaultQubit.preprocess_transformsfor an example.
code/api/pennylane.devices.preprocess.mid_circuit_measurements
Download Python script
Download Notebook
View on GitHub