Print noisy circuit when a Braket noise model is applied to PL device with `parallel=True`
#255 opened on May 9, 2024
Repository metrics
- Stars
- (44 stars)
- PR merge metrics
- (PR metrics pending)
Description
PennyLane device with Braket backend supports noise model. The noise model added to the device will automatically apply to circuit executed by the device.
Normally, one can call print(device.circuit) to visualize the circuit after the device has executed it. This allows users to check if the noise is applied as expected. But in the case where the device is set to parallel=True, this does not work. The underlying issue is that batch_execute does not populate the deivce's circuit field (because there are multiple circuits being executed on the device).
Describe the feature you'd like
If the device is initialized with parallel=True, the device should cache all of the circuits that have been run on the device so that they can be accessed later. We should also have updated documentation on how to attach a noise model to a device and how to print the resulting circuit(s).
Describe alternatives you've considered
The alternative is to use parallel=False so that only a single circuit is run and populated in the circuit field of the device, and then call print(device.circuit).