Open cvjjm opened 3 weeks ago
Thanks @cvjjm! from chatting to the team, this seems to come from the adjoint
modifier; exchanging the decomposition and the qml.adjoint
resolves the problem (compiling to S^\dagger
). I wonder if the ability to smartly swap transforms that are associative might help here 🤔
Some other thoughts:
We're curious if you've encountered any other cases where the clifford decomposition struggles?
I noticed that I got very deep circuits for a circuit that should have been Clifford in the first place. I wanted to use clifford_t_decomposition
to verify that and got very long circuits with T gates. I then tried simpler and simpler circuits until I arrived at the minimal example above.
Another good example that should not need T gates but produces loads is:
>>>print(qml.draw(qml.transforms.clifford_t_decomposition(qml.adjoint(qml.IsingXX)))(np.pi/2, [0, 1]))
0: ─╭●──T──H──T†──T†──T†──H──T──H──T──T──H──T†──H──T──H──T──H──T†──T†──T†──T†──H──T──H──T──T──T──H
1: ─╰X────────────────────────────────────────────────────────────────────────────────────────────
───T†──H──T†──H──T──H──T†──T†──H──T†──H──T──T──H─╭●─┤
─────────────────────────────────────────────────╰X─┤
@cvjjm thanks for reporting this! We'll leave the issue open for now and investigate a fix for this. We will update here if there is any movement.
Feature details
It is very cool that PL ships a Clifford plus T decomposition transform!
However it does seem to struggle in certain cases. An extreme example is:
which produces the gate sequence:
Clearly this is not optimal :-)
Implementation
No response
How important would you say this feature is?
1: Not important. Would be nice to have.
Additional information
No response