<jupyter_start><jupyter_text>run simulator<jupyter_code>'''
run under local simulator with solver ExactSovler
'''
from dimod.reference.samplers import ExactSolver
sampler = ExactSolver()
response = sampler.sample(bqm)
print(response)
from dwave.cloud import Client
client = Client.from_config(
    token='')
client.get_solvers()
'''
pure QA with limited scale
'''
from dwave.system import DWaveSampler, EmbeddingComposite
sampler = EmbeddingComposite(DWaveSampler())
sampleset = sampler.sample(bqm, num_reads=100)
print(sampleset)   # doctest: +SKIP
'''
https://docs.ocean.dwavesys.com/en/stable/docs_hybrid/intro/using.html
'''
from hybrid.reference.kerberos import KerberosSampler
solution = KerberosSampler().sample(bqm, max_iter=20, convergence=3)
solution.first.energy
s = solution.first.sample
p = np.zeros(N)
for k in range(N):
    key = 'x'+str(k+1)
    p[k] = 2*s[key] - 1
Sn = np.dot(p, v)**2
print(Sn)<jupyter_output>0.0017286211270748785
{'fraction_non_alphanumeric': 0.1327713382507903, 'fraction_numerical': 0.03161222339304531, 'mean_word_length': 6.142857142857143, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '537197', 'license': 'Apache-2.0', 'n_tokens_mistral': 382, 'n_tokens_neox': 350, 'n_words': 71, 'path': 'QA.ipynb', 'repo_name': 'lvboodvl/dwave_test', 'size': '949'}