tequilahub / tequila

A High-Level Abstraction Framework for Quantum Algorithms
MIT License
362 stars 101 forks source link

Refactor `GeneralizedRotation` to generators with (possible) nullspace. #306

Closed dariavh closed 12 months ago

dariavh commented 1 year ago

Hi Jakob,

Following our discussion about the GeneralizedRotation gate, I have transferred the shifted_gates functionality from QubitExcitation to GeneralizedRotation. This modification allows the GeneralizedRotation method to accept generators that do not necessarily have only two eigenvalues of +-r.

kottmanj commented 1 year ago

It looks good so far. I think I found the reasons for the failed tests (see comments). I'll stop annotating since you are currently modifying faster than I comment :D

dariavh commented 1 year ago

@kottmanj Additional remark: The map_qubits method in the QubitExcitationImpl class has duplicate code from its base class QGateImpl. I can refactor the method to call the base class and additionally map the qubits in the p0 generator. Is this change acceptable to you?

kottmanj commented 12 months ago

Looks ready to go! Thanks a lot.