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

Update Qibo demo snippet on v0.34 changelog #2212

Closed
wants to merge 2 commits into from

Conversation

Misty-W
Copy link
Contributor

@Misty-W Misty-W commented Feb 27, 2024

Description

Now that Qibo is integrated with Mitiq, we don't need to use convert_to_mitiq for Qibo circuits.


License

  • I license this contribution under the terms of the GNU GPL, version 3 and grant Unitary Fund the right to provide additional permissions as described in section 7 of the GNU GPL, version 3.

Before opening the PR, please ensure you have completed the following where appropriate.

@Misty-W Misty-W requested a review from natestemen February 27, 2024 21:45
Copy link
Member

@natestemen natestemen left a comment

Choose a reason for hiding this comment

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

Thanks for removing this! I'm still getting an error1 when trying to run this example:

TypeError: unsupported operand type(s) for /: 'QuantumState' and 'int'

Is it running on your side? If it's not, it looks like we will need to use a different executor.

Footnotes

  1. We need to import gates from qibo as well as import mitiq to make sure it runs, but then after those issues, we still get the type error :/.

@natestemen natestemen added bug Something isn't working documentation Improvements or additions to documentation labels Feb 27, 2024
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.28%. Comparing base (e9b750d) to head (74302fc).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2212   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files          90       90           
  Lines        4259     4259           
=======================================
  Hits         4186     4186           
  Misses         73       73           

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

@Misty-W
Copy link
Contributor Author

Misty-W commented Feb 27, 2024

I'm looking at this and realize now there are more problems- the circuit is trivial, no noise applied, and I'm not sure where the executor error is coming from.

@Misty-W Misty-W marked this pull request as draft February 27, 2024 22:09
@cosenal
Copy link
Contributor

cosenal commented Apr 18, 2024

Closing this as v0.34 has been released already, and it looks like a working version of the Qibo snippet made it into the changelog.

@cosenal cosenal closed this Apr 18, 2024
@cosenal cosenal deleted the mw-update-v034-changelog branch April 18, 2024 15:35
@natestemen
Copy link
Member

The code snippet in the changelog is still broken (I don't think it ever worked). Whether it's worth fixing, I'm not sure, but I don't love the fact that we have code in the changelog (which, IMO, is a suggestion for users to run) which does not run.

@Misty-W do you still want to update this?

@Misty-W
Copy link
Contributor Author

Misty-W commented Apr 18, 2024

The code snippet in the changelog is still broken (I don't think it ever worked). Whether it's worth fixing, I'm not sure, but I don't love the fact that we have code in the changelog (which, IMO, is a suggestion for users to run) which does not run.

@Misty-W do you still want to update this?

I’ll remove it.

@cosenal
Copy link
Contributor

cosenal commented Apr 21, 2024

Sorry, I closed this PR because I thought the snippet from the changelog had been fixed already.

Anyway, I looked at the code of the snippet. It doesn't make sense to me even before executing it, and that's neither in the original form, nor in the form of this PR.

In the original form, we are converting the circuit from Qibo to Cirq, and then using a circuit.execute() executor function, which implies that Cirq has an execute function, but it doesn't look like that's the case.

On the other hand, in the form of this PR, we are trivially using the Qibo execute() function, which does exist, but doesn't even have the signature required, i.e., it returns an object that is not Mitiq's QuantumResult.

In both cases, I don't see why this should work in the simple form of the snippet, unless we write a non-trivial executor, similar to the one in the «Error mitigation with Qibo» example.

@natestemen
Copy link
Member

In both cases, I don't see why this should work in the simple form of the snippet

My guess is that it went untested in #2191. Maybe a good practice to help eliminate this in the future is require 2 reviewers for release notes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants