Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move initializer optimizations to transpiler #1943

Closed
ajavadia opened this issue Mar 9, 2019 · 0 comments

Comments

Projects
1 participant
@ajavadia
Copy link
Member

commented Mar 9, 2019

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 [1/math.sqrt(2), 0, 0, 0, 0, 0, 0, 1/math.sqrt(2)].

The non-optimized/canonical synthesis is:
image

The optimized version as implemented currently is:
image

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.

@jaygambetta jaygambetta added this to To do in Transpiler via automation Mar 10, 2019

@ajavadia ajavadia added this to the 0.8 milestone Apr 4, 2019

@ajavadia ajavadia self-assigned this Apr 6, 2019

@atilag atilag closed this in #2266 May 2, 2019

Transpiler automation moved this from To do to done May 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.