Open ZichangHe opened 9 months ago
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:
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')
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)
f(theta)
assert time_elapsed < 5 # seconds
Make sure that these tests are decorated properly to be only run in Github actions
@alex124585, may I ask if there's been any progress on this?
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:
- 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')
- 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
after run pip install . in omniq I am getting >>> get_available_simulator_names() ['c', 'python']
Huh! Can you please add the test to confirm this is also the case in GitHub actions?
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']
Running
pip install .
fails to build c simulator on OmniQ. As an additional fix, Github actions should check that c simulator is built correctly