Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
move initializer optimizations to transpiler #1943
What is the expected enhancement?
The arbitrary state initializer is based on https://arxiv.org/abs/quant-ph/0406176v5, and it implements some of the optimizations that the paper talks about to reduce the depth. But the optimizations are ad-hoc, and they don't fully capture all optimization opportunities. We should make the synthesizer dumb, and relegate the optimizations to the transpiler.
For example, consider the circuit for initializing
Note that this manual optimization misses the fact that the last 4 CNOTs can be removed also.
If we just relegate all optimizations to the transpiler, then optimizing this circuit is fairly straightforward. It involves removing zero rotations, removing adjacent CNOTs, and commuting CNOTs that share a target but are on different qubits (these passes have to be done repetitively until converging to a fixed-point).
I'm removing these optimizations from the initializer as part of the refactoring in #1816. This issue should be fixed through the construction of a default pass manager that addresses the above.