getting variables' value in SAPI
I am working on Matlab and trying to use D-wave API. first, I try to understand D-wave API and I simulate some models with python. I used the D-wave hybrid solver and printed the JSON result. it does not contain variables' values and I am confused. it just sends energy-level. sample output :
{'id': 'e3e9640b-1983-4efe-997e-c00ded2a0bd0',
'data': {'format': 'ref', 'data': '188caabf-bc70-48c4-9851-659463031ad2'},
'params': {'time_limit': 5},
'metadata': {'submitted_by': 'DEV-****************************************',
'solver': 'hybrid_binary_quadratic_model_version2',
'type': 'bqm',
'submitted_on': '2022-11-17T13:28:30.724893Z',
'solved_on': '2022-11-17T13:28:38.034581Z',
'status': 'COMPLETED',
'messages': [],
'label': 'REST Submission to hybrid BQM solver'},
'answer': {'format': 'bq',
'data': {'type': 'SampleSet',
'version': {'sampleset_schema': '3.1.0'},
'num_variables': 4,
'num_rows': 1,
'sample_data': {'type': 'array',
'data': [[2]],
'data_type': 'uint32',
'shape': [1, 1],
'use_bytes': False},
'sample_type': 'int8',
'sample_packed': True,
'vectors': {'energy': {'type': 'array',
'data': [-10.0],
'data_type': 'float64',
'shape': [1],
'use_bytes': False},
'num_occurrences': {'type': 'array',
'data': [1],
'data_type': 'int64',
'shape': [1],
'use_bytes': False}},
'variable_labels': ['x', 'y', 'z', 'j'],
'variable_type': 'BINARY',
'info': {'qpu_access_time': 223865,
'charge_time': 4999371,
'run_time': 4999371}}}}
Comments
for more detail, i use SAPI according to this document :
https://docs.dwavesys.com/docs/latest/rest_api_full_examples.html
Please sign in to leave a comment.