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

pip install fails to build c simulator #41

Open
ZichangHe opened this issue Feb 9, 2024 · 6 comments
Open

pip install fails to build c simulator #41

ZichangHe opened this issue Feb 9, 2024 · 6 comments
Assignees

Comments

@ZichangHe
Copy link
Contributor

Running pip install . fails to build c simulator on OmniQ.
As an additional fix, Github actions should check that c simulator is built correctly

@alex124585 alex124585 self-assigned this Feb 9, 2024
@rsln-s
Copy link
Contributor

rsln-s commented Feb 9, 2024

As an additional fix, Github actions should check that c simulator is built correctly

Specifically, we should have two tests that are triggered in GitHub Actions:

  1. Check that the simulator is one of the available ones:
from qokit.fur import get_available_simulator_names
assert 'c' in get_available_simulator_names('x')
assert 'c' in get_available_simulator_names('xyring')
assert 'c' in get_available_simulator_names('xycomplete')
  1. Check that the objective evaluation is fast (please note that below is pseudocode):
import dumpy as np
from qokit import get_qaoa_labs_objective

theta = np.random.uniform(0,1,280)
f = get_qaoa_labs_objective(20, 140)
# timer start
f(theta)
# timer end
assert time_elapsed < 5 # seconds

Make sure that these tests are decorated properly to be only run in Github actions

@ZichangHe
Copy link
Contributor Author

@alex124585, may I ask if there's been any progress on this?

@alex124585
Copy link
Contributor

As an additional fix, Github actions should check that c simulator is built correctly

Specifically, we should have two tests that are triggered in GitHub Actions:

  1. Check that the simulator is one of the available ones:
from qokit.fur import get_available_simulator_names
assert 'c' in get_available_simulator_names('x')
assert 'c' in get_available_simulator_names('xyring')
assert 'c' in get_available_simulator_names('xycomplete')
  1. Check that the objective evaluation is fast (please note that below is pseudocode):
import dumpy as np
from qokit import get_qaoa_labs_objective

theta = np.random.uniform(0,1,280)
f = get_qaoa_labs_objective(20, 140)
# timer start
f(theta)
# timer end
assert time_elapsed < 5 # seconds

Make sure that these tests are decorated properly to be only run in Github actions

I believe import dumpy as np should be import numpy as np

@alex124585
Copy link
Contributor

after run pip install . in omniq I am getting >>> get_available_simulator_names()
['c', 'python']

@rsln-s
Copy link
Contributor

rsln-s commented Mar 1, 2024

Huh! Can you please add the test to confirm this is also the case in GitHub actions?

@rsln-s
Copy link
Contributor

rsln-s commented Jun 19, 2024

I just did an install in a clean OmniQ instance and the simulator was not built correctly. Reopening this issue.

git clone https://github.com/jpmorganchase/QOKit.git
cd QOKit/
pip install -e .
from qokit.fur import get_available_simulator_names
print(get_available_simulator_names("x"))

gives ['gpu', 'python']

@rsln-s rsln-s reopened this Jun 19, 2024
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

No branches or pull requests

3 participants