Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client backends for the remote execution of circuits #1157

Merged
merged 26 commits into from
Mar 1, 2024
Merged

Conversation

BrunoLiegiBastonLiegi
Copy link
Contributor

@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi commented Jan 16, 2024

This PR add support for the QiboClientBackend and a QiskitClientBackend implemented in https://github.com/qiboteam/qibo-cloud-backends that allow for the remote execution of circuits. Furthermore, support for QASM gate command is added to the parser.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

@scarrazza
Copy link
Member

@BrunoLiegiBastonLiegi thanks for this, however let me suggest to move these backends directly in https://github.com/qiboteam/qibo-cloud-backends, so we avoid mixing the core code with external providers.

@BrunoLiegiBastonLiegi
Copy link
Contributor Author

Ah ok, sorry about that, I'll move them.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (465e88d) 100.00% compared to head (7895cd2) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1157   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           69        69           
  Lines        10110     10145   +35     
=========================================
+ Hits         10110     10145   +35     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi marked this pull request as ready for review January 31, 2024 08:04
Copy link
Member

@alecandido alecandido left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite the parser being the major upgrade, I didn't pay much attention to it, because we should use a better strategy for defining it (either using the official parser or make our own one, with a specification of a subset of the formal language used).

Using regexes is a simple option for a quick parser, but when things grow and last long it becomes quite involved and complex (and thus much harder to review...).

src/qibo/backends/__init__.py Outdated Show resolved Hide resolved
src/qibo/backends/__init__.py Outdated Show resolved Hide resolved
src/qibo/backends/__init__.py Outdated Show resolved Hide resolved
src/qibo/backends/__init__.py Outdated Show resolved Hide resolved
tests/test_quantum_info_clifford.py Outdated Show resolved Hide resolved
src/qibo/models/circuit.py Outdated Show resolved Hide resolved
src/qibo/models/circuit.py Outdated Show resolved Hide resolved
@BrunoLiegiBastonLiegi
Copy link
Contributor Author

Thanks @alecandido, I agree the parser has to be replaced with something more controllable. If the execution through cloud functionality is not urgent, we could delay this and try to incorporate the use of https://github.com/openqasm/openqasm as we discussed separately.

@alecandido
Copy link
Member

If the execution through cloud functionality is not urgent, we could delay this and try to incorporate the use of openqasm/openqasm as we discussed separately.

It is fine, but even if it's not urgent, I would merge this with the current parser. Just to decouple the two tasks.

@renatomello renatomello added this to the Qibo 0.2.5 milestone Feb 2, 2024
@renatomello renatomello added the enhancement New feature or request label Feb 2, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (31bbbb4) to head (7d8849b).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1157   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           72        72           
  Lines        10480     10516   +36     
=========================================
+ Hits         10480     10516   +36     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@scarrazza
Copy link
Member

@BrunoLiegiBastonLiegi do you prefer to merge this now or wait until qibo-cloud-backens is released? Openqasm could be further upgraded in a separate PR.

@BrunoLiegiBastonLiegi
Copy link
Contributor Author

I don't know, the only additional thing this PR is providing is the support to the qasm gate command. So it depends, if that is something that is nice to have without waiting for the cloud backends we could merge this. Otherwise we could wait.

@scarrazza
Copy link
Member

Ok, lets wait until we test and release the cloud backends.

@scarrazza
Copy link
Member

Meanwhile, could you please fix tests?

@MatteoRobbiati MatteoRobbiati self-requested a review February 21, 2024 09:14
@BrunoLiegiBastonLiegi
Copy link
Contributor Author

Ok I added a reference in the qibo api reference docs about qibo-cloud-backends, linking to the official documentation (which also contains usage examples). I also added an optional cloud group in poetry.
Both this and qibo-cloud-backends PR should be ready, we just need to release qibo-cloud-backends-0.0.1 and then merge this I guess.

pyproject.toml Outdated Show resolved Hide resolved
@alecandido alecandido mentioned this pull request Feb 28, 2024
@alecandido
Copy link
Member

@BrunoLiegiBastonLiegi any known blocker for this?

I believe @MatteoRobbiati could be busy, so I'm adding @stavros11 for the review (and @scarrazza in cc).

@alecandido
Copy link
Member

✅ great to see you again!

@alecandido
Copy link
Member

I rebased on master, such that it can be cleanly merged (#1236 was merged in the meanwhile).

Whenever tests are passing, I'd merge this @BrunoLiegiBastonLiegi

@scarrazza scarrazza added this pull request to the merge queue Mar 1, 2024
Merged via the queue into master with commit 7bab351 Mar 1, 2024
21 checks passed
@alecandido alecandido mentioned this pull request Mar 1, 2024
2 tasks
@alecandido alecandido deleted the client_backends branch March 1, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants