entropicalabs / openqaoa

Multi-backend SDK for quantum optimisation
MIT License
116 stars 58 forks source link

QAOA benchmark #194

Closed raulconchello closed 1 year ago

raulconchello commented 1 year ago

Benchmark object for qaoa

For examples read notebook 14 (new), here is a simple example:

from openqaoa import QAOA, create_device, QAOABenchmark
from openqaoa.problems import QUBO

qaoa = QAOA()
qaoa.set_device(create_device(name='qiskit.shot_simulator', location='local'))
qaoa.compile(QUBO.random_instance(5))
benchmark = QAOABenchmark(qaoa)
benchmark.run(n_points_axis=2**4, ranges=[(0,1),(0,1)], plot=True)
codecov[bot] commented 1 year ago

Codecov Report

Merging #194 (55e3aa3) into dev_evaluate_circuit (ec54f47) will increase coverage by 0.01%. The diff coverage is n/a.

:exclamation: Current head 55e3aa3 differs from pull request most recent head 04da3df. Consider uploading reports for the commit 04da3df to get more accurate results

@@                   Coverage Diff                    @@
##           dev_evaluate_circuit     #194      +/-   ##
========================================================
+ Coverage                 89.02%   89.04%   +0.01%     
========================================================
  Files                        32       32              
  Lines                      5925     5935      +10     
========================================================
+ Hits                       5275     5285      +10     
  Misses                      650      650              

see 2 files with indirect coverage changes

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

raulconchello commented 1 year ago

@shahidee44, @vishal-ph Which import do you think is appropriate for this object?

now is: from openqaoa.algorithms.qaoa import QAOABenchmark

Q-lds commented 1 year ago

now is: from openqaoa.algorithms.qaoa import QAOABenchmark

I think it can easily be from openqaoa import QAOABenchmark

vishal-ph commented 1 year ago

@raulconchello, sorry if I missed the discussion, but why is this PR going into dev_evaluate_circuit?

vishal-ph commented 1 year ago

NOTE: run black formatter before merging