Comments (9)
@jmlarson1, thank you for raising this issue!
This is indeed a bug as the support for Qiskit simulation leveraging the parameterized QAOA circuit appears to have been lost. Somehow, this has escaped our test coverage, which is unfortunate.
The short of it is that simply instantiating parameterized QAOA circuit and passing it to get_qaoa_objective should work.
We will aim to resolve this soon (though possibly after the holidays).
from qokit.
Many of us, including @Shagun-G are interested in having this functionality
from qokit.
@jmlarson1 @Shagun-G @mmenickelly:
I added a quick hot fix in #30 that should address your needs. Here is a quick test that the implementation is correct:
import numpy as np
from qokit.parameter_utils import get_best_known_parameters_for_LABS_wrt_overlap_for_p
from qokit.qaoa_objective_labs import get_qaoa_labs_objective
N = 7
p = 8
gamma, beta = get_best_known_parameters_for_LABS_wrt_overlap_for_p(N, p)
f1 = get_qaoa_labs_objective(N, p, parameterization="gamma beta", simulator="auto")
f2 = get_qaoa_labs_objective(N, p, parameterization="gamma beta", simulator="qiskit")
assert np.isclose(f1(gamma, beta), f2(gamma, beta))
from qokit.
Thank you. I need to try a different build because I get an error:
Traceback (most recent call last):
File "/home/jlarson/QOKit/ruslan_rocks.py", line 2, in <module>
from qokit.parameter_utils import get_best_known_parameters_for_LABS_wrt_overlap_for_p
File "/home/jlarson/QOKit/qokit/__init__.py", line 6, in <module>
from .qaoa_objective import get_qaoa_objective
File "/home/jlarson/QOKit/qokit/qaoa_objective.py", line 10, in <module>
import numba.cuda
File "/home/jlarson/.local/lib/python3.10/site-packages/numba/__init__.py", line 55, in <module>
_ensure_critical_deps()
File "/home/jlarson/.local/lib/python3.10/site-packages/numba/__init__.py", line 42, in _ensure_critical_deps
raise ImportError("Numba needs NumPy 1.24 or less")
ImportError: Numba needs NumPy 1.24 or less
from qokit.
I would suggest trying to re-install from source in a clean venv/conda environment.
from qokit.
@jmlarson1 was your issue resolved by #30?
from qokit.
Yes! The example works for me. Thank you.
Is there some obvious way to pass the desired number of shots to the get_qaoa_labs_objective
method? f1(gamma, beta, shots=1000)
would be nice, and would seem to match qokit/qaoa_circuit_portfolio.py
where one can
execute(circuit, backend, shots=n_trials)
.
But that doesn't work (and I don't even see that kwargs
are passed to get_qaoa_labs_objective
).
from qokit.
The simulator does not support emulating shot-based noise. Only exact expectation value is returned currently.
from qokit.
That is understandable. Is there a shot-based get_qaoa_labs_objective (without a simulator, perhaps)?
from qokit.
Related Issues (20)
- pip install git+ causes error in asset-dependent parameter utils HOT 1
- Default behavior for overlap objective is incorrect HOT 18
- Document the capabilities of the package HOT 1
- Documentation HOT 1
- Fix parameterization of LABS tests and parameterize MaxCut tests
- Unify `precomputed_diagonal_hamiltonian` and `precomputed_costs` HOT 7
- Avoid precomputing energies outside of the simulator
- Issues introduced in #31 and #24 HOT 1
- Flip order of beta and gamma in MaxCut circuit HOT 2
- Add (local) tests for MPI simulator
- pip install fails to build c simulator HOT 5
- Communication inside the MPI simulator may cause overflow error when the message is large HOT 1
- Objective function of a general QUBO problem HOT 9
- upload to test.pypi should not be triggered on PR HOT 1
- qiskit-ibmq-provider is not maintained anymore HOT 1
- The overlap calculation of calling `get_qaoa_maxcut_objective` is unclear HOT 4
- Fix typo of scaling rule in portfolio optimization HOT 2
- Unsure if the QOKit MaxCut examples are working -- `brute_force` method. HOT 1
- parameter `p` doesn't seem like it is used in the `get_qaoa_labs_objective` function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qokit.