entropicalabs / openqaoa

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

Aws jobs #177

Closed Q-lds closed 1 year ago

Q-lds commented 1 year ago

The basic usage is outlined in the test file: test_aws_managed_jobs.py

input_data_path = os.path.join(
    os.environ["AMZN_BRAKET_INPUT_DIR"], "input_data/"
)

# Create the qubo and the qaoa
q = QAOA()
q.set_device(create_device('aws', 'arn:aws:braket:::device/quantum-simulator/amazon/sv1'))
q.compile(self.vc)
q.dump(file_name='openqaoa_params.json', file_path=input_data_path, prepend_id=False, overwrite=True)

job = LocalQuantumJob.create(
    device="arn:aws:braket:::device/quantum-simulator/amazon/sv1",
    source_module="./tests/jobs_test_input/aws_braket_source_module/openqaoa_qaoa_script.py",
    image_uri="amazon-braket-oq-dev",
    input_data={"input_data": input_data_path},
)
codecov[bot] commented 1 year ago

Codecov Report

Merging #177 (f18926e) into dev (389d57f) will decrease coverage by 0.75%. The diff coverage is 54.91%.

@@            Coverage Diff             @@
##              dev     #177      +/-   ##
==========================================
- Coverage   90.11%   89.36%   -0.75%     
==========================================
  Files          30       31       +1     
  Lines        5685     5802     +117     
==========================================
+ Hits         5123     5185      +62     
- Misses        562      617      +55     
Impacted Files Coverage Δ
tests/test_aws_managed_jobs.py 45.36% <45.36%> (ø)
tests/test_utilities.py 99.40% <80.00%> (-0.60%) :arrow_down:
tests/test_workflows.py 99.49% <100.00%> (+<0.01%) :arrow_up:

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