Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Create 03_evaluating_performance.ipynb #28

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

areeq-hasan
Copy link
Contributor

Summary

In this notebook, we evaluate the performance of QRAO by determining how closely it approximates the exact solution to MaxCut for 100 random 3-regular graphs. We also compare the performance of QRAO used with two different rounding schemes. In the process, we reproduce the main results of the paper (i.e. Fig. 1).

Details and comments

Running the magic rounding QRAO for a 40-node graph instance takes a while on my machine, so I've set the quantum instance that performs magic rounding to only do 1 shot. We can adjust this easily if necessary. Adding a section to the notebook that analyzes magic rounding QRAO performance (both approximation ratio and execution time) as a function of the number of shots of the rounding quantum instance could be also be interesting.

@garrison garrison added the needs: changelog Should be (but has not yet been) noted in the release notes label May 31, 2022
@garrison
Copy link
Member

garrison commented Jun 2, 2022

Preview here

@garrison garrison added the documentation Improvements or additions to documentation label Jun 4, 2022
@garrison
Copy link
Member

garrison commented Jun 7, 2022

This looks pretty good already.

After reviewing the Diátaxis framework's distinction between tutorials and how-to guides, I actually now think this should be placed in the how-tos directory. (I was unsure where it belonged before reading this.)

The other important thing to get a handle on is the performance, so that we can continue to regularly run all notebooks as integration tests (using treon). I'm beginning to investigate this.

garrison added a commit that referenced this pull request Jun 13, 2022
I wanted to change this label, since we will soon have a how-to
guide that depends on cplex (#28), in addition to the existing
tutorial.

I first considered calling it `notebooks`, but it doesn't actually
install any notebooks.  I then settled on `notebook-dependencies`,
which is a bit longer but (I feel) is more clear.
garrison added a commit that referenced this pull request Jun 13, 2022
I wanted to change this label, since we will soon have a how-to
guide that depends on cplex (#28), in addition to the existing
tutorial.

I first considered calling it `notebooks`, but it doesn't actually
install any notebooks.  I then settled on `notebook-dependencies`,
which is a bit longer but (I feel) is more clear.
garrison added a commit to mtreinish/prototype-qrao that referenced this pull request Jun 13, 2022
I wanted to change this label, since we will soon have a how-to
guide that depends on cplex (qiskit-community#28), in addition to the existing
tutorial.

I first considered calling it `notebooks`, but it doesn't actually
install any notebooks.  I then settled on `notebook-dependencies`,
which is a bit longer but (I feel) is more clear.
garrison added a commit that referenced this pull request Jun 14, 2022
* Update requirements to not include notebook only dependencies

This commit updates the requirements list to only include required
packages for using qrao as a library. The requirements list get
installed unconditionally as part of installing the library meaning that
every user who tries to use qrao will get them installed too. Having
heavy and closed source dependencies like cplex in the list is
problematic for library users in particular because it makes it
difficult for any downstream consumers to depend on the package since it
will always pull those in. To avoid this issue this commit moves the
tutorial specific requirements into an optional extra requirement. This
then separates the concerns of library users and tutorial users. If you
run tutorials you can just run 'pip install prototyp-qrao[tutorials]'
which will install the library with the tutorials extras. At the same
time these dependencies are added to the requirements-dev.txt list too
so that tutorial dependencies are installed during documentation builds
too.

* Rename the `tutorial` extra requirement to `notebook-dependencies`

I wanted to change this label, since we will soon have a how-to
guide that depends on cplex (#28), in addition to the existing
tutorial.

I first considered calling it `notebooks`, but it doesn't actually
install any notebooks.  I then settled on `notebook-dependencies`,
which is a bit longer but (I feel) is more clear.

* Update documentation for how to obtain notebook requirements

* Fix typo: `extra_require` should be `extras_require`

https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies

Co-authored-by: Jim Garrison <garrison@ibm.com>
@garrison
Copy link
Member

garrison commented Jun 24, 2022

I mentioned in #21:

We will probably begin by parameterizing the various basis rotations, so that a single circuit can be sent to the primitives, along with various parameter sets.

One might reasonably hypothesize that repeatedly constructing the circuits takes more time than actually running them on the simulator. If so, then parametrizing the circuits might allow us to get many more shots than 1 (as this notebook uses currently) without much additional cost, as we would only have to generate the circuit once, regardless of number of shots. It would be interesting to evaluate whether my hypothesis is indeed correct (i.e., the relevant time spent generating the circuits vs. simulating them).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation needs: changelog Should be (but has not yet been) noted in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants