Qualtran
Qualtran copied to clipboard
Single-qubit and Controlled Z rotations
Update single-qubit Z rotations ZPowGate and Rz. These are atomic operations.
Introduce actual constructions for CZPowGate and CRz for better resource counting. The previous hack would just count them as "one rotation". Now the former is a rotation and two Toffolis (TODO: can these be And?); the latter is two rotations and two cliffords.
Connect the single-qubit gates to their controlled versions via the controlled protocol.
There's still hacks for Controlled-S and Controlled-T, which I will port in a follow-up.
How should we handle X and Y rotations? One possibility is to make them compile to ZPow/Rz. Otherwise: duplicate the controlled construction for each flavor.
@tanujkhattar there are two tests failing that I'd like your help with
- the TextbookQFT uses cirq
controlled_bywhich is causing breaking simulation tests in a weird way. This triggers #1446 but even after hack-fixing that it runs into a different issue. - I don't understand the flamegraph format.
test_get_flame_graph_data_qft_textbookhas different numbers now but I don't know how to verify that these are correct.
TODO: can these be And?
Yep you can use CZPow = And^dagger . ZPow . And
@tanujkhattar do you have any thoughts on the cirq simulation failure