dimod.Response.samples_matrix

Response.samples_matrix

numpy.matrix – Samples as a NumPy matrix of data type int8.

Examples

This example shows the samples of dimod package’s ExactSolver reference sampler formatted as a NumPy matrix.

>>> import dimod
>>> response = dimod.ExactSolver().sample_ising({'a': -0.5, 'b': 1.0}, {('a', 'b'): -1})
>>> response.samples_matrix
matrix([[-1, -1],
        [ 1, -1],
        [ 1,  1],
        [-1,  1]])