Skip to content

Azure Quantum backend#439

Merged
Takishima merged 56 commits intoProjectQ-Framework:developfrom
saich08:feature/azure-quantum
Aug 8, 2022
Merged

Azure Quantum backend#439
Takishima merged 56 commits intoProjectQ-Framework:developfrom
saich08:feature/azure-quantum

Conversation

@saich08
Copy link
Contributor

@saich08 saich08 commented Jun 29, 2022

Hi Team,

This is the PR to integrate Azure Quantum as backend to ProjectQ framework. As of now, Azure Quantum supports hardware and simulators from IonQ and Quantinuum targets.

Please review, welcome all feedback!

Thanks!

@coveralls
Copy link

coveralls commented Jul 16, 2022

Pull Request Test Coverage Report for Build 2761899788

  • 305 of 305 (100.0%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 2759348897: 0.0%
Covered Lines: 7296
Relevant Lines: 7296

💛 - Coveralls

@saich08
Copy link
Contributor Author

saich08 commented Jul 16, 2022

@Takishima, Addressed rest of the active comments as well. Please review when you get a chance.

Looks like few PR check failing are failing (3 • Clang 3.5 • x64, 3 • GCC 7 • x64 and coveralls). I'll see what I can do.

@Takishima
Copy link
Collaborator

Takishima commented Jul 18, 2022

With regards the failures 3 • Clang 3.5 • x64 and 3 • GCC 7 • x64, it looks like issues related to updating Python packages so don't worry too much about those. I will look into those and see if I can find an easy fix.

The coveralls problems are mostly due to to lack of test coverage in the following files:

Name                                                          Stmts   Miss  Cover   Missing
-------------------------------------------------------------------------------------------
...
projectq/backends/_azure/_azure_quantum.py                      168     15    91%   105, 160, 191-197, 239, 267-268, 295, 307, 327, 338, 350
projectq/backends/_azure/_azure_quantum_client.py                15      2    87%   26-27
projectq/backends/_azure/_exceptions.py                           2      0   100%
projectq/backends/_azure/_util.py                               120     10    92%   105, 144, 181, 188, 236, 243, 288, 300, 308-311
...
-------------------------------------------------------------------------------------------
TOTAL                                                          7352     34    99%

@Takishima
Copy link
Collaborator

I have managed to fix the CI failure issues by making sure pip and setuptools are up-to-date. Now the only remaining issues are linked to test coverage.

Otherwise, I think this PR looks good (though I will go through the code once more, but I don't expect to have anything else to complain about ;-) )

Takishima and others added 5 commits July 19, 2022 10:49
* Improve coveralls

* Improve coveralls

* Rename util.py to utils.py

* Minor fixes

* Update testcases

* Update testcases
* Improve coveralls

* Improve coveralls

* Precommit reformatting
* Improve coveralls

* Precommit formatting
@saich08
Copy link
Contributor Author

saich08 commented Jul 24, 2022

@Takishima, we should be good with coveralls now. I got 100% coverage for azure-quantum modules.

projectq/backends/_azure/_azure_quantum.py 158 0 100%
projectq/backends/_azure/_azure_quantum_client.py 15 0 100%
projectq/backends/_azure/_exceptions.py 2 0 100%
projectq/backends/_azure/_utils.py 112 0 100%

@Takishima
Copy link
Collaborator

Thanks for working that out. I will take another look at this next week.

@Takishima
Copy link
Collaborator

Takishima commented Jul 25, 2022

The current issues stems for the fact that azure-quantum for Python 3.6 is version 0.18.X and the following code does not work properly:

from azure.quantum.target import IonQ, Quantinuum, Target
from azure.quantum.target.target_factory import TargetFactory

NB: this fails with the following error message:

...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'azure.quantum.target'

Is there any way to make this work with Python 3.6 and azure-quantum <= 0.18?

@Takishima
Copy link
Collaborator

Actually I just saw that Python 3.6 has reached its EOL. I will merge another PR to remove 3.6 from the CI and then we can merge this.

@Takishima
Copy link
Collaborator

Just one more question. Otherwise I am happy to merge this.

@saich08 saich08 closed this Jul 29, 2022
@saich08 saich08 reopened this Jul 29, 2022
@saich08
Copy link
Contributor Author

saich08 commented Jul 29, 2022

Closed PR by mistake, sorry about that :).

@Takishima Takishima merged commit 739f782 into ProjectQ-Framework:develop Aug 8, 2022
@saich08 saich08 deleted the feature/azure-quantum branch August 8, 2022 07:40
@saich08
Copy link
Contributor Author

saich08 commented Aug 10, 2022

Thanks @Takishima for great review comments and contributions to this PR. This has been great learning experience. I am looking forward to contributing more. Hoping to see this change in ProjectQ release soon :).

Takishima added a commit that referenced this pull request Oct 18, 2022
* Merge master into develop branch (#436)

* Preparing release vv0.7.2

* Fix missed bug in optimize.py

* Fix typo in _optimize.py

* Fix linters/formatters warnings

* Update missed hooks

* Hotfix: fix GitHub action workflows

* Release version v0.7.3 (#435)

* Merge master into develop branch (#431)

* Preparing release vv0.7.2

* Fix missed bug in optimize.py

* Fix typo in _optimize.py

* Fix linters/formatters warnings

* Update missed hooks

* Hotfix: fix GitHub action workflows

Co-authored-by: GitHub actions <noreply@github.com>
Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>

* IonQ API: Move to v0.2, and fixup backends path (#433)

* Move to v0.2, and fixup backends path

The previous path was mistakenly incorrect, could we release this as a patch release of project-Q? Happy to help how I can.

* changelog

* fix

* One more fixup

* remove urljoin

* fmt

* Preparing release v0.7.3

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub actions <noreply@github.com>
Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>
Co-authored-by: Jon Donovan <donovan@ionq.co>

Co-authored-by: GitHub actions <noreply@github.com>
Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jon Donovan <donovan@ionq.co>

* Bump docker/setup-qemu-action from 1 to 2 (#437)

* Bump docker/setup-qemu-action from 1 to 2

Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](docker/setup-qemu-action@v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update CHANGELOG

* Fix CentOS 7 build

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>

* Fix setuptools-scm version for Python 3.6 (#440)

* Add `blacken-docs` and `pyupgrade` to pre-commit configuration (#441)

* Add `blacken-docs` and `pyupgrade` to pre-commit configuration

* Apply new pre-commit hooks and fix related issues.

* Update CHANGELOG

* Fix unit tests failures

* Fix pre-commit failure

* Generalise the use of f-strings

* Fix IonQ tests

* Run `pyupgrade` before `isort` and `black`

* Deprecate support for Python 3.6 (#442)

* Azure Quantum backend (#439)

* Add Azure Quantum backend template files

* Add implementation of Azure Quantum

* Add support for Honeywell and improve exception handling

* Fixes and reformatting

* Fixes and Improvements

* Fixes and Improvements

* Fixes and Improvements

* Fixes and Improvements

* Fix QASM transulation

* Fixes and Improvements

* Documentation related changes

* Fix typos

* Add docstrings to util methods

* Fix typos

* Add Unittests

* Add Unittests

* Add Unittests & rename honeywell to quantinuum

* Fixes for QSAM convector

* Add Unittests

* Add Unittests

* Add Unittests

* Add Unittests

* Fix Quantinuum Backend for Azure Quantum

* Add Unittests

* Add Unittests

* Add Unittests

* Add Unittests

* Fix Vdag gate for IonQ backend

* Minor updates

* Update Docs

* Add Azure Quantum example

* Update README.rst

* Update Docs

* Update Docs

* Update Unittests

* Azure Quantum: CI Fixes (#4)

* Azure Quantum: CI Fixes

* Fix optional dependency problem

* Update pre-commit reformatting

* Fix pylint issues

* Fix pylint issues

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Resolve comments (#5)

* Resolve comments

* Remove rearrange_result method from _utils.py

* Update with pytest.approx for assert floating numbers

* Pytest skipif testcases for Azure Quantum (#6)

* Pytest skipif testcases for Azure Quantum

* Fix projectq.backends._azure._exceptions import

* Add common utils module (#7)

* Create common utils module

* Optimize _rearrange_result method

* Make sure pip, setuptools and wheel packages are up to date on CI

* Fix formatting issues from latest changes in develop branch

* Improve coveralls (#8)

* Improve coveralls

* Improve coveralls

* Rename util.py to utils.py

* Minor fixes

* Update testcases

* Update testcases

* Improve coveralls (#9)

* Improve coveralls

* Improve coveralls

* Precommit reformatting

* Improve coveralls (#10)

* Improve coveralls

* Precommit formatting

* Fix CI failures

* Avoid a few more #pragma: no cover

* Fix flake8 warning

* Remove one more # pragma: no cover

* Reformat file

Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>

* Fix installation on Apple Silicon and older Python versions (#444)

* Preparing release v0.8.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub actions <noreply@github.com>
Co-authored-by: Nguyen Damien <ngn.damien@gmail.com>
Co-authored-by: Jon Donovan <donovan@ionq.co>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sai Seshu Chadaram <ssc1729@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants