-
Notifications
You must be signed in to change notification settings - Fork 0
/
complete_graph_15.py
39 lines (33 loc) · 2.55 KB
/
complete_graph_15.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import pandas as pd
from dwave.system import DWaveSampler, AutoEmbeddingComposite
import dwave.inspector
sampler = AutoEmbeddingComposite(DWaveSampler(solver={'topology__type': 'pegasus'}))
h = {'s1': 223/2, 's2': 111, 's3': 221/2, 's4': 110, 's5': 219/2, 's6': 109, 's7': 217/2, 's8': 108, 's9': 215/2, 's10': 107,
's11': 213/2, 's12': 106, 's13': 211/2, 's14': 105, 's15': 112}
J = {('s1', 's2'): 8, ('s1', 's3'): 8, ('s1', 's4'): 8, ('s1', 's5'): 8, ('s1', 's6'): 8, ('s1', 's7'): 8, ('s1', 's8'): 8,
('s1', 's9'): 8, ('s1', 's10'): 8, ('s1', 's11'): 8, ('s1', 's12'): 8, ('s1', 's13'): 8, ('s1', 's14'): 8, ('s1', 's15'): 8,
('s2', 's3'): 8, ('s2', 's4'): 8, ('s2', 's5'): 8, ('s2', 's6'): 8, ('s2', 's7'): 8, ('s2', 's8'): 8, ('s2', 's9'): 8,
('s2', 's10'): 8, ('s2', 's11'): 8, ('s2', 's12'): 8, ('s2', 's13'): 8, ('s2', 's14'): 8, ('s2', 's15'): 8,
('s3', 's4'): 8, ('s3', 's5'): 8, ('s3', 's6'): 8, ('s3', 's7'): 8, ('s3', 's8'): 8, ('s3', 's9'): 8, ('s3', 's10'): 8,
('s3', 's11'): 8, ('s3', 's12'): 8, ('s3', 's13'): 8, ('s3', 's14'): 8, ('s3', 's15'): 8,
('s4', 's5'): 8, ('s4', 's6'): 8, ('s4', 's7'): 8, ('s4', 's8'): 8, ('s4', 's9'): 8, ('s4', 's10'): 8, ('s4', 's11'): 8,
('s4', 's12'): 8, ('s4', 's13'): 8, ('s4', 's14'): 8, ('s4', 's15'): 8,
('s5', 's6'): 8, ('s5', 's7'): 8, ('s5', 's8'): 8, ('s5', 's9'): 8, ('s5', 's10'): 8, ('s5', 's11'): 8, ('s5', 's12'): 8,
('s5', 's13'): 8, ('s5', 's14'): 8, ('s5', 's15'): 8,
('s6', 's7'): 8, ('s6', 's8'): 8, ('s6', 's9'): 8, ('s6', 's10'): 8, ('s6', 's11'): 8, ('s6', 's12'): 8, ('s6', 's13'): 8,
('s6', 's14'): 8, ('s6', 's15'): 8,
('s7', 's8'): 8, ('s7', 's9'): 8, ('s7', 's10'): 8, ('s7', 's11'): 8, ('s7', 's12'): 8, ('s7', 's13'): 8, ('s7', 's14'): 8,
('s7', 's15'): 8,
('s8', 's9'): 8, ('s8', 's10'): 8, ('s8', 's11'): 8, ('s8', 's12'): 8, ('s8', 's13'): 8, ('s8', 's14'): 8, ('s8', 's15'): 8,
('s9', 's10'): 8, ('s9', 's11'): 8, ('s9', 's12'): 8, ('s9', 's13'): 8, ('s9', 's14'): 8, ('s9', 's15'): 8,
('s10', 's11'): 8, ('s10', 's12'): 8, ('s10', 's13'): 8, ('s10', 's14'): 8, ('s10', 's15'): 8,
('s11', 's12'): 8, ('s11', 's13'): 8, ('s11', 's14'): 8, ('s11', 's15'): 8,
('s12', 's13'): 8, ('s12', 's14'): 8, ('s12', 's15'): 8,
('s13', 's14'): 8, ('s13', 's15'): 8,
('s14', 's15'): 8,}
sampleset = sampler.sample_ising(h, J, num_reads=5000, label='complete graph - 15 qubits')
data = sampleset.to_pandas_dataframe()
data.to_excel('sampleset_15.xlsx', index=False)
print(sampleset)
print(sampleset.info)
dwave.inspector.show(sampleset)