forked from euro-hpc-pl/SpinGlassEngine.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.jl
43 lines (39 loc) · 1.04 KB
/
example.jl
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
40
41
42
43
using Logging
using SpinGlassEngine
using MetaGraphs
using LightGraphs
disable_logging(LogLevel(1))
function solve_instance(instance_path, nrows, ncols; β, sweeps, bond_dim, max_states)
ig = ising_graph(instance_path)
fg = factor_graph(
ig,
cluster_assignment_rule=super_square_lattice((nrows, ncols, 8))
)
network = PEPSNetwork(
nrows,
ncols,
fg,
rotation(0),
β=β,
bond_dim=bond_dim,
sweeps=sweeps,
)
low_energy_spectrum(network, max_states, merge_branches(network, 1.0))
end
function solve_instance(instance_path, nrows, ncols, t; β, sweeps, bond_dim, max_states)
ig = ising_graph(instance_path)
fg = factor_graph(
ig,
cluster_assignment_rule=super_square_lattice((nrows, ncols, t))
)
network = FusedNetwork(
nrows,
ncols,
fg,
rotation(0),
β=β,
bond_dim=bond_dim,
sweeps=sweeps,
)
low_energy_spectrum(network, max_states, merge_branches(network, 1.0))
end