-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Family of iSwap gates #7470
Comments
I just realized now that gate exponentiation is indeed supported by qiskit. It was hard to discover because |
Using arbitrary matrix powers isn't necessarily ideal; doing so creates a If there is a general representation, we can override |
I agree that we should override |
I think defining this on top of iSwapGate is the wrong way around, but the principle is the same. By analogy to rotation gates, I'd think the more natural choice for the "base" of the exponent is Then we're back to the original question a little - we might want a slightly more general way of representing any such controllable n-qubit - we're interested in a general form that allows any Pauli vector as the interaction, while fitting within the transpiler requirements that gates separated by more than just |
I disagree that iSwapGate should be recovered by It is definitely useful to be able to specify gates in terms of rotation angles rather than exponents. This can be achieved by providing constructor functions that take the angle as input:
|
I just remembered that we recently added the XYGate. This is basically the same thing. A rotation about the XX+YY axis is typically called an XY gate in the literature (see this or this) - though I don't love the name. But I think there is no new gate to be added here, right? It would be nice to override the iSwapGate.power() method so that it gives an XY gate, rather than a UnitaryGate. The UnitaryGate thing is just a fallback so any arbitrary gate can be raised to a power. It would also be good to edit the docstring for XYGate to mention these relationships. i.e. the fact that XY(pi,0) gives iSwapGate. Also perhaps adding a reference |
@ajavadia Thanks for telling me about XYGate. I have closed qiskit-community/qiskit-nature#462 because indeed, no new gate needs to be added. We should still override the power method of iSwap gate (and others, for that matter) so that the resulting gate stays of the same type. |
Should we make iSwapGate a subclass of XYGate? |
I agree
I'm not sure, what is the advantage? Our gates don't currently have a lot of deep structure to them (i.e. RX/RZ/RY could all be UGate, but they are not). |
The advantage would be that we would only have to implement and maintain the gate decomposition and exponentiation in one class instead of duplicating it between two classes. |
What should we add?
It would be nice to add variable iSwap gates instead of the fixed one we have right now. These could be used as the two-qubit interaction within
qiskit.circuit.library.ExcitationPreserving
and qiskit-community/qiskit-nature#462.The current iSwap is defined as
so the natural choice for a parameterized version would be just to replace
pi / 4
by an angle and keep the interaction asXX + YY
. What would be a good way to incorporate different interactions, such asYX - XY
as in qiskit-community/qiskit-nature#462?@kevinsung @ajavadia
The text was updated successfully, but these errors were encountered: