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

Add Docplex tutorials #90

Merged
merged 15 commits into from
Oct 28, 2022
Merged

Conversation

MaldoAlberto
Copy link
Contributor

Description

-Three examples of how encoding an optimization problem in openQAOA using a docplex model.

  • Tutorial 10 Basic example

  • Tutorial 11 Portfolio Optimization

  • Tutorial 12 Bin Packing problem
    -using the class FromDocplex2IsingModel

  • Tutorial about QAOA using OpenQAOA

  • Fixes # (issue)

Checklist

  • I have performed a self-review of my code.
  • I have commented my code and used numpy-style docstrings
  • I have made corresponding updates to the documentation.
  • My changes generate no new warnings
  • I have added/updated tests to make sure bugfix/feature works.
  • New and existing unit tests pass locally with my changes.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Name the new unit-tests that you have added along with this change.

alejomonbar and others added 3 commits August 5, 2022 14:50
Three examples of how encoding a optimization problem in openQAOA using a docplex model.

- Basic example
- Portfolio Optimization
- Bin Packing problem
@codecov
Copy link

codecov bot commented Sep 27, 2022

Codecov Report

Merging #90 (9d39043) into dev (431b683) will decrease coverage by 5.42%.
The diff coverage is 67.74%.

@@            Coverage Diff             @@
##              dev      #90      +/-   ##
==========================================
- Coverage   92.84%   87.41%   -5.43%     
==========================================
  Files          60       67       +7     
  Lines        7629     8910    +1281     
==========================================
+ Hits         7083     7789     +706     
- Misses        546     1121     +575     
Impacted Files Coverage Δ
openqaoa/backends/qpus/qaoa_qiskit_qpu.py 21.68% <0.00%> (-0.27%) ⬇️
openqaoa/backends/simulators/qaoa_qiskit_sim.py 100.00% <ø> (ø)
openqaoa/qaoa_parameters/gatemap.py 88.02% <0.00%> (ø)
openqaoa/qaoa_parameters/operators.py 100.00% <ø> (ø)
openqaoa/workflows/optimizer.py 83.15% <ø> (-0.18%) ⬇️
setup.py 100.00% <ø> (ø)
tests/test_results.py 100.00% <ø> (ø)
tests/test_qpu_braket.py 10.82% <10.82%> (ø)
openqaoa/backends/qpus/qaoa_braket_qpu.py 22.09% <22.09%> (ø)
openqaoa/devices.py 48.57% <23.33%> (-46.50%) ⬇️
... and 48 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Q-lds Q-lds self-requested a review September 30, 2022 04:38
@Q-lds Q-lds added the documentation Improvements or additions to documentation label Sep 30, 2022
@Q-lds
Copy link
Member

Q-lds commented Sep 30, 2022

@MaldoAlberto , apologies for the delay!

Could you please add the notebooks to the test file openqaoa/tests/test_notebooks.py?

For example,

# @pytest.mark.notebook
def test_10_docplex_example():
    notebook_test_function("./examples/10_docplex_example.ipynb")

Thanks!

@MaldoAlberto
Copy link
Contributor Author

@Q-lds I added the changes that you indicated me 😄

@Q-lds
Copy link
Member

Q-lds commented Oct 27, 2022

@vishal-ph, here we have two open questions:

  • where do we put the dependencies of the community notebooks? [maybe an extra pip install flag so that they are installed only when truly needed?]

  • shall we move the notebooks to examples/community_tutorials/? [I'd say yes, but we can move them in a future PR. Otherwise, we need to fix the names right now and ask Alberto to move them. I'd say we can move them ourselves, as it will be easier than writing it here!]

@Q-lds Q-lds marked this pull request as draft October 27, 2022 15:10
@Q-lds Q-lds marked this pull request as ready for review October 27, 2022 15:10
@Q-lds Q-lds self-assigned this Oct 28, 2022
@Q-lds Q-lds merged commit bb1b48e into entropicalabs:dev Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants