Deprecating the use of a list for h in sample_ising (altogether or just for DWaveSampler?) Con: may still be value in allowing it from memory efficiency perspective.
Propagate a warning
Raise an exception. This would be more consistent with the behavior when h is a dict, and it matches the docstring of the original behavior.
Original docstring:
*h* --- List or tuple of the linear Ising coefficients. The
:math:`h` value of a non-working qubit must be zero or an
exception will be raised. Inactive qubits are disabled during
annealing and cannot distinguish their states.
For example, using a structured sampler where qubit 0 is not available, the following silently drops the variable and produces an empty sampleset:
whereas using a dict for h that includes an invalid qubit (or as part of J) will raise an error:
Documentation for the base class method is: https://github.com/dwavesystems/dimod/blob/25065ad8d30154098f55d827022b815421822864/dimod/core/sampler.py#L200-L205
Possibilities for addressing this include:
h
insample_ising
(altogether or just forDWaveSampler
?) Con: may still be value in allowing it from memory efficiency perspective.h
is a dict, and it matches the docstring of the original behavior.Original docstring:
Relevant code in
DWaveSampler
: https://github.com/dwavesystems/dwave-system/blob/bedfe5143a8579348be07e4ef5e8fe0646ce81ff/dwave/system/samplers/dwave_sampler.py#L365-L375