ProjectQ-Framework / ProjectQ

ProjectQ: An open source software framework for quantum computing
https://projectq.ch
Apache License 2.0
876 stars 271 forks source link

3 additional 2-qubit gates #330

Closed dwierichs closed 5 years ago

dwierichs commented 5 years ago

For convenience, these two-qubit rotation gates might be added to the gate set: Two-qubit X rotation exp(-i/2 \theta XX) Two-qubit Y rotation exp(-i/2 \theta YY) Two-qubit Z rotation exp(-i/2 \theta ZZ)

Takishima commented 5 years ago

Wouldn't you be able to achieve the same result by using All(Rx(theta)) | qureg [1] ?

[1] Assuming that qureg is a quantum register of size 2.

dwierichs commented 5 years ago

The newly implemented gates exponentiate the tensor product, being equivalent to cos(theta/2) Id - i sin(theta/2) X_0 X_1 whereas exp(-i/2 theta X_0) exp(-i/2 theta X_1) = [cos^2(theta/2)-sin^2(theta/2)] Id - i cos(theta/2)sin(theta/2) [X_0 + X_1] ,where the index of the Pauli X is the qubit it acts on, is the tensor product of the exponents. I hope I did not overlook something here but then the two are indeed different.

Takishima commented 5 years ago

It seems you have yet to sign the CLA agreement for contributor to ProjectQ. Could you please send an email to info@projectq.ch requesting the CLA and then sign it ?