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

Variational Quantum Regression using the Parameter Shift Rule #654

Merged
merged 21 commits into from Oct 11, 2022

Conversation

MatteoRobbiati
Copy link
Contributor

In this example a Variational Quantum Circuit based on the re-uploading strategy is used to tackle a simple 1-dimensional regression problem: (to fit $y= \sin 2x$ ).

This context is exploited for introducing the Parameter Shift Rule, which is useful for evaluating the gradients of a circuit in a quantum-hardware compatible way.

A demo markdown is included.

@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (9f637e1) compared to base (4e34996).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #654   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           80        80           
  Lines        10455     10455           
=========================================
  Hits         10455     10455           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

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

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@scarrazza scarrazza left a comment

Choose a reason for hiding this comment

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

@MatteoRobbiati thank you very much for this contribution. It is in a really good shape.

I am just wondering if we should place the VQRegressor in a QML / variational module for Qibo and provide the optimizer as a standalone optimizer. @stavros11 what is your opinion about that?

@scarrazza
Copy link
Member

@MatteoRobbiati could you please complete this PR by:

@MatteoRobbiati
Copy link
Contributor Author

@scarrazza Modifications done, thank you for the comment.

@@ -0,0 +1 @@
../../../../../examples/vqregressor/README.md
Copy link
Member

Choose a reason for hiding this comment

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

This file has a typo.

Copy link
Member

@scarrazza scarrazza left a comment

Choose a reason for hiding this comment

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

Thank you, but please test sphinx manually every time you perform a change, otherwise you don't really now if things are working well. In fact, at the current state, the tutorial is not appearing in the website due to the typo.

@MatteoRobbiati
Copy link
Contributor Author

@scarrazza thanks for the advice. I've fixed it and modified the README so that the formulas can be read in documentation.

@scarrazza scarrazza merged commit 8cee963 into master Oct 11, 2022
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.

None yet

2 participants