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_shot transform will be applied, otherwise qml.defer_measurements is 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() or defer_measurements() in its preprocess transforms if necessary. See DefaultQubit.setup_execution_config and DefaultQubit.preprocess_transforms for an example.

Contents

Using PennyLane

Release news

Development

API

Internals