import dimod
import numpy as np
import dwave.system

A = np.array([[0,1,2,3,4,1],
              [2,1,4,1,0,2],
              [1,1,1,1,0,3],
              [1,5,2,3,4,1]])
m, n = A.shape
vartype = dimod.Vartype.BINARY
c = np.array([1,2,1,3,1,4])
b = np.array([1, 3, 2, 6])

# Set up linear and quadratic coefficients
L = c.T - 2 * np.matmul(b.T,A)
Q = np.matmul(A.T,A)
offset = b.T.dot(b)


bqm = dimod.as_bqm(L, Q, offset, vartype)

sampler = dwave.system.DWaveCliqueSampler()

sampleset = sampler.sample(bqm,num_reads = 2000)

sampleset.to_pandas_dataframe()

