-
Notifications
You must be signed in to change notification settings - Fork 105
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
Refactor GeneralizedRotation
to generators with (possible) nullspace.
#306
Refactor GeneralizedRotation
to generators with (possible) nullspace.
#306
Conversation
GeneralizedRotation
to generators with nullspace (P0
).GeneralizedRotation
to generators with (possible) nullspace.
src/tequila/circuit/gates.py
Outdated
@@ -1056,14 +1052,13 @@ def __init__(self, angle, target, generator=None, p0=None, assume_real=True, con | |||
assert generator is not None | |||
assert p0 is not None | |||
|
|||
super().__init__(name="QubitExcitation", parameter=angle, target=target, control=control) | |||
self.generator = generator | |||
if control is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part needs to go to the parent class (GeneralizedRotationImpl) as this modification of p0,in case a controlled gate is initialized, needs to happen there as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks for the comment!
It looks good so far. I think I found the reasons for the failed tests (see comments). |
@kottmanj Additional remark: The |
…riavh/tequila into refactor/generalized_rotation
…for SWAP and GenRot
Looks ready to go! |
Hi Jakob,
Following our discussion about the
GeneralizedRotation
gate, I have transferred theshifted_gates
functionality fromQubitExcitation
toGeneralizedRotation
. This modification allows theGeneralizedRotation
method to accept generators that do not necessarily have only two eigenvalues of +-r.