tequilahub / tequila

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

iSWAP gate and Givens gate #304

Closed dariavh closed 1 year ago

dariavh commented 1 year ago

To the best of my knowledge, the current code has no direct implementation for the

I have implemented them using GeneralizedRotation gates. I have written some test cases for both gates as well. Please let me know if these gates are of any interest to you and if you have further remarks/requests.

kottmanj commented 1 year ago

Hi Daria, Thanks for contributing. We’re definitely interested in contributions like this. I’m currently on vacation with marginal internet access and won’t be able to go over the code before September. It does however look good on first glance.

One thing I spotted: I think the Givens gate is the same as “QubitExcitation” with target=[first,second]. Makes still sense to have it as an alias though. You can however then replace the GeneralizedRotation with the corresponding call to QubitExcitation(….).

A convenient iSWAP is however not there yet (know that, because people asked about it in the past :-) ). Need to check one or two things with the GeneralizedRotation definitions in order to make sure that gradient building will work as expected. I’ll provide more details in ~1.5 weeks when I’m back.

Have a nice weekend.

dariavh commented 1 year ago

@kottmanj Thank you for your extensive review. I have incorporated your comments into the last commit, let me know if you agree with those changes.