Open kevinsung opened 2 weeks ago
hi @kevinsung, yes the source is here: https://github.com/jcmgray/quimb/blob/main/quimb/tensor/circuit.py#L787-L806, its a two qubit gate with that first matrix you give on the number conserving subspace - some other info here: https://pennylane.ai/qml/demos/tutorial_givens_rotations/.
Would be very happy to add that phi
parameter - would you want to open an PR ?
Sure, I can open a PR. Should I add it to the existing gate? That would break some APIs, like Circuit.givens
, right?
That's true, maybe a new gate method called 'givens2' for the two parameter version is necessary (or some other more appropriate name?).
Is your feature request related to a problem?
From looking at the documentation, the Givens rotation has only one parameter,
theta
. I couldn't find the documentation of the gate matrix, but I believe it iswhere
c = cos(theta)
ands = sin(theta)
. In general however, a Givens rotation can be complex with the formFor example, see https://www.cs.cornell.edu/~bindel/papers/2002-toms.pdf.
Describe the solution you'd like
The complex Givens rotation can be accommodated by adding a parameter
phi
and replacings
withs * e^{i phi}
. I don't know if the current gate should be modified, or a new gate added.Describe alternatives you've considered
A workaround is to use the Givens gate together with two Rz gates. But it's more convenient to have a single gate to represent the concept, and it might enable better performance optimizations (I'm not sure).
Additional context
No response