Define custom positon for `qml.transforms.insert`
See original GitHub issueFeature details
Currently, the insert transform supports three position settings, end, all and start. all and start will ignore state preparations.
But this only applies to the templates already present in PennyLane. But we can have custom state preparation routines. It will be nice to have some way to mark our state preparation which is then not modified with the insert transform.
Also, only state preparations should be skipped, which come at the beginning of the circuit. Currently, if I add another template like StronglyEntanglingLayers somewhere in between, it is also skipped over by the transform. I don’t think this is the expected behaviour.
Implementation
State preparations can be asked to be made as a separate function (like a template) outside the circuit and then called from within. These will then have a specific argument or name instructing the transform to skip. A named argument seems like the better way. This can also be added to all templates. Users can then control if they want the transform to skip the template or not by marking it True or False.
How important would you say this feature is?
1: Not important. Would be nice to have.
Additional information
No response
Issue Analytics
- State:
 - Created a year ago
 - Comments:6 (6 by maintainers)
 

Top Related StackOverflow Question
Hi @trbromley,
This is what I meant by skipping. The
BitFlipoperations are after the template gates and not inside the template. You can see the difference in the next example. There theBitFlipgates are after every gate of the template.Thanks for clarifying this @ankit27kh!