ProjectQ-Framework / ProjectQ

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

AWS Braket service backend #388

Closed fernandodelaiglesia closed 3 years ago

fernandodelaiglesia commented 3 years ago

Dear all,

I have been working on creating an AWS Braket service backend to access to the devices offered by this service. The current supported devices are Aspen-8 device by Rigetti, IonQ device and the State Vector Simulator SV1 by Amazon.

Hope that could be useful Thanks

Best

fernandodelaiglesia commented 3 years ago

Dear all,

The checks failed because boto3 is required for this feature. That means that the Travis configuration would require to be updated to install this module (just 'pip install boto3')

In addition may be that the python versions to check would require some update. 2.7 is still there but 3.7 or 3.8 is not.

Thanks Best

Takishima commented 3 years ago

Dear @fernandodelaiglesia , I have been wanting to update the Travis CI configuration for a while now. I will look into doing that this week in another PR.

Regarding the boto3 dependency, I propose that we wait until that PR gets approved and you could then modify the travis configuration accordingly in another commit in this PR.

I will also try to take a look at the code in the coming days.

fernandodelaiglesia commented 3 years ago

Hi @Takishima ,

That sounds great. Thanks a lot. I will review the travis.yaml file during the weekend to follow your instructions.

Thanks as well for the review

Takishima commented 3 years ago

Also, in order to avoid adding too many dependencies to install for users that do no need the functionality from AWS Braket, please consider making boto3 an extra requirements in the setup.py file.

People that need the AWS Braket backend could then install ProjectQ using:

python3 -m pip install projectq[braket]
fernandodelaiglesia commented 3 years ago

Sure!

I think adding an 'extras-require' in the setup call would make the job.

In addition I'm considering to add a sub-section at the end of Getting Started in the document https://github.com/ProjectQ-Framework/ProjectQ/blob/develop/docs/tutorials.rst to describe this installation option. Is that OK?

Takishima commented 3 years ago

Sure!

I think adding an 'extras-require' in the setup call would make the job.

In addition I'm considering to add a sub-section at the end of Getting Started in the document https://github.com/ProjectQ-Framework/ProjectQ/blob/develop/docs/tutorials.rst to describe this installation option. Is that OK?

Yup, that would be awesome.

Takishima commented 3 years ago

PR #389 was just merged into develop.

You should now rebase your branch onto develop so that you get the latest changes to .travis.yml. You can then make the necessary changes to add an 'aws' or 'braket' extra requirement.

fernandodelaiglesia commented 3 years ago

PR #389 was just merged into develop.

You should now rebase your branch onto develop so that you get the latest changes to .travis.yml. You can then make the necessary changes to add an 'aws' or 'braket' extra requirement.

Thank you @Takishima . I will modify .travis.yaml as well as setup.py and the tutorial document as discussed in previous messages.

Thanks a lot for the review. I will go over each of the comments adding comments/questions if applicable.

fernandodelaiglesia commented 3 years ago

Dear @Takishima,

First of all, thank you very much for your great review and suggestions.

Please review the pending comments above before I push the changes. I would apply the extra changes taking into account your proposals specifically for the comments related with the generalization in the creation of the circuit's json.

In addition, please let me know what do you think on my comments on the way of counting qubits and the use of WaekQubitRef in order to translate the same changes to the IBMBackend and AQTBackend after this PR

Thank you

fernandodelaiglesia commented 3 years ago

Hi @Takishima ,

Did you have the opportunity to go over my comments?

Thank you in advance Best

Takishima commented 3 years ago

Hi @Takishima ,

Did you have the opportunity to go over my comments?

Thank you in advance Best

Dear @fernandodelaiglesia , I was on holidays last week and was not able to comment on your latest remarks. I will give you some feedback by Wednesday this week.

Best

fernandodelaiglesia commented 3 years ago

When I was doing the suggested changes and some more tests, I realized that AWS changed the name of the IonQ from 'IonQ' to 'IonQ Device', therefore I had to do some more small changes.

I'll wait for your response to the 2 pending to resolve conversations to do the push

Thanks a lot for your review and suggestions

Takishima commented 3 years ago

I have pushed some changes. Could you have a look if the Jupyter notebook in the examples folder is still working? I do not have the tokens and everything else to test right now.

fernandodelaiglesia commented 3 years ago

I have pushed some changes. Could you have a look if the Jupyter notebook in the examples folder is still working? I do not have the tokens and everything else to test right now.

Thank you!

I've just tested the Jupyter notebook and is working perfectly.

Takishima commented 3 years ago

I will take a look at the whole again this weekend and then will merge it. I particularly want to clean up the test code a bit to make it more readable. At the moment, I find it a bit messy with all those variables floating around...

fernandodelaiglesia commented 3 years ago

Thank you @Takishima !

I will be some days off (until Monday), just in case you need something from me...

Thanks a lot

fernandodelaiglesia commented 3 years ago

Hi @Takishima

Great work!. Thanks a lot

Takishima commented 3 years ago

Ok finally done.

fernandodelaiglesia commented 3 years ago

Thank you!

Great work!