Will the device combine the two rotation gates into one?
Is there a way to specify if we want the device to optimize the circuit or not?
Will using a qml.Barrier gate prevent optimization?
Hi @ankit27kh! It is up to the device whether optimizations are implemented. The current built-in PennyLane simulators (default.qubit and lightning.qubit) do not, I believe, modify the circuit — they implement every gate as is. However, some devices (especially hardware devices) may transpile before execution.
Note that you can use our compilation transforms if you would like to optimize a circuit before it is sent to the device: