amazon-braket / amazon-braket-ocean-plugin-python

A Python plugin for using Ocean with Amazon Braket
https://amazon-braket-ocean-plugin-python.readthedocs.io/
Apache License 2.0
20 stars 11 forks source link

Cannot use sample_qubo_quantum_task of BraketSampler #63

Closed AoyuQC closed 2 years ago

AoyuQC commented 2 years ago

Describe the bug Cannot use the example from tutorial to test the sample_qubo_quantum_task function of BraketSampler. It will have error message: BinaryQuadraticModelStructureError: Problem graph incompatible with solver

To reproduce from braket.ocean_plugin import BraketSampler sampler = BraketSampler(s3_folder, "arn:aws:braket:::device/qpu/d-wave/Advantage_system4") Q = {(0, 0): -1, (4, 4): -1, (0, 4): 2} task = sampler.sample_qubo_quantum_task(Q, resultFormat="HISTOGRAM", shots=100) sampleset = BraketSampler.get_task_sample_set(task)

Expected behavior run without errors

Screenshots or logs

Screen Shot 2021-11-29 at 3 33 40 PM

System information A description of your system. Please provide:

Additional context Add any other context about the problem here.

math411 commented 2 years ago

In https://github.com/aws/amazon-braket-ocean-plugin-python/pull/64, more verbose logging was added. This particular issue was caused by the topology of the D-Wave specified in the code being used. The qubit set starts at an index of 30 in this case.

math411 commented 2 years ago

Closing this issue out.