Skip to content

DWaveCliqueSampler occasionally produces an out-of-range qubit coupling #591

@randomir

Description

@randomir

A per-group-coupling-range test occasionally fails with:

======================================================================
ERROR: test_per_qubit_coupling_range_3_Zephyr (tests.qpu.test_dwavecliquesampler.TestDWaveCliqueSampler.test_per_qubit_coupling_range_3_Zephyr)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/distiller/project/env/lib/python3.13/site-packages/parameterized/parameterized.py", line 530, in standalone_func
    return func(*(a + p.args), **p.kwargs)
  File "/Users/distiller/project/tests/qpu/test_dwavecliquesampler.py", line 92, in test_per_qubit_coupling_range
    sampler.sample(bqm, chain_strength=chain_strength).resolve()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dimod/sampleset.py", line 1490, in resolve
    samples = self._result_hook(self._future)
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dimod/sampleset.py", line 1374, in hook
    sampleset.resolve()
    ~~~~~~~~~~~~~~~~~^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dimod/sampleset.py", line 1490, in resolve
    samples = self._result_hook(self._future)
  File "/Users/distiller/project/dwave/system/composites/embedding.py", line 314, in async_unembed
    response.resolve()
    ~~~~~~~~~~~~~~~~^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dimod/sampleset.py", line 1490, in resolve
    samples = self._result_hook(self._future)
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dimod/decorators.py", line 86, in <lambda>
    return SampleSet.from_future(next(iterator), lambda _: next(iterator))
                                                           ~~~~^^^^^^^^^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dwave/preprocessing/composites/scale.py", line 138, in sample
    sampleset.record.energy *= 1 / scalar
    ^^^^^^^^^^^^^^^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dimod/sampleset.py", line 1126, in record
    self.resolve()
    ~~~~~~~~~~~~^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dimod/sampleset.py", line 1491, in resolve
    self.__init__(samples.record, samples.variables, samples.info, samples.vartype)
                  ^^^^^^^^^^^^^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dimod/sampleset.py", line 1126, in record
    self.resolve()
    ~~~~~~~~~~~~^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dimod/sampleset.py", line 1490, in resolve
    samples = self._result_hook(self._future)
  File "/Users/distiller/project/dwave/system/samplers/dwave_sampler.py", line 492, in _hook
    raise exc
  File "/Users/distiller/project/dwave/system/samplers/dwave_sampler.py", line 479, in _hook
    return resolve(computation)
  File "/Users/distiller/project/dwave/system/samplers/dwave_sampler.py", line 469, in resolve
    sampleset.resolve()
    ~~~~~~~~~~~~~~~~~^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dimod/sampleset.py", line 1490, in resolve
    samples = self._result_hook(self._future)
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dwave/cloud/computation.py", line 835, in <lambda>
    sampleset = dimod.SampleSet.from_future(self, lambda f: f.wait_sampleset())
                                                            ~~~~~~~~~~~~~~~~^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dwave/cloud/computation.py", line 773, in wait_sampleset
    self._load_result()
    ~~~~~~~~~~~~~~~~~^^
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dwave/cloud/computation.py", line 909, in _load_result
    raise self._exception
  File "/Users/distiller/project/env/lib/python3.13/site-packages/dwave/cloud/client/base.py", line 1347, in _handle_problem_status
    raise SolverFailureError(errmsg)
dwave.cloud.exceptions.SolverFailureError: Total coupling -13.000 for qubit 2793 to qubits 1730,1741,1754,1765,1778,1789,1802,1813,2792,2804 is out of range (-13.000 10.000).

Coupling values in this case are (on solver Advantage2_system1.5):

[np.float64(-1.7660377358490567), np.float64(-1.7660377358490567), np.float64(-1.7660377358490567), np.float64(-1.7660377358490567), np.float64(-1.7660377358490567), np.float64(-1.7660377358490567), np.float64(-1.7660377358490567), np.float64(-0.44150943396226416), np.float64(-0.1962264150943396)]

with the total sum of:

-13.000000000000002

So the lower bound of per_group_coupling_range (-13) is indeed exceeded, but due to float64 precision limits.

Arguably, this edge case should be handled on SAPI side, as the quoted precision is only 3 digits (-13.000).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions