Introduction
A Potts Hamiltonian is a graphical representation that allows for a convenient and intuitive way to describe the structure of a network.
The concept of a Potts Hamiltonian within SpinGlassNetworks.jl
introduces a mechanism for organizing spins into desired clustered geometries, facilitating a structured approach to modeling complex spin systems.
SpinGlassNetworks.potts_hamiltonian
— Functionpotts_hamiltonian(
ig::LabelledGraphs.LabelledGraph{MetaGraphs.MetaGraph{Int64, T}} where T,
num_states_cl::Int64;
spectrum,
cluster_assignment_rule
)
Create a Potts Hamiltonian.
This function constructs a Potts Hamiltonian from an Ising graph by introducing a natural order in Potts Hamiltonian coordinates.
Arguments:
ig::IsingGraph
: The Ising graph representing the spin system.num_states_cl::Int
: The number of states per cluster taken into account when calculating the spectrum. In every cluster the number of states is constant.spectrum::Function
: A function for calculating the spectrum of the Potts Hamiltonian. It can befull_spectrum
orbrute_force
.cluster_assignment_rule::Dict{Int, L}
: A dictionary specifying the assignment rule that maps Ising graph vertices to clusters. It can besuper_square_lattice
,pegasus_lattice
orzephyr_lattice
.
Returns:
potts_h::LabelledGraph{S, T}
: The Potts Hamiltonian represented as a labelled graph.
The potts_hamiltonian
function takes an Ising graph (ig
) as input and constructs a Potts Hamiltonian by introducing a natural order in Potts Hamiltonian coordinates. It allows you to specify the number of states per cluster, a spectrum calculation function, and a cluster assignment rule, which maps Ising graph vertices to clusters.
potts_hamiltonian(
ig::LabelledGraphs.LabelledGraph{MetaGraphs.MetaGraph{Int64, T}} where T,
num_states_cl::Dict{T, Int64};
spectrum,
cluster_assignment_rule
)
Create a Potts Hamiltonian.
This function constructs a Potts Hamiltonian from an Ising graph by introducing a natural order in Potts Hamiltonian coordinates.
Arguments:
ig::IsingGraph
: The Ising graph representing the spin system.num_states_cl::Dict{T, Int}
: A dictionary specifying the number of states per cluster for different clusters. Number of states are considered when calculating the spectrum.spectrum::Function
: A function for calculating the spectrum of the Potts Hamiltonian. It can befull_spectrum
orbrute_force
.cluster_assignment_rule::Dict{Int, T}
: A dictionary specifying the assignment rule that maps Ising graph vertices to clusters. It can besuper_square_lattice
,pegasus_lattice
orzephyr_lattice
.
Returns:
potts_h::LabelledGraph{MetaDiGraph}
: The Potts Hamiltonian represented as a labelled graph.
The potts_hamiltonian
function takes an Ising graph (ig
) as input and constructs a Potts Hamiltonian by introducing a natural order in Potts Hamiltonian coordinates. It allows you to specify the number of states per cluster which can vary for different clusters, a spectrum calculation function, and a cluster assignment rule, which maps Ising graph vertices to clusters.
potts_hamiltonian(
ig::LabelledGraphs.LabelledGraph{MetaGraphs.MetaGraph{Int64, T}} where T;
spectrum,
cluster_assignment_rule
)
Create a Potts Hamiltonian with optional cluster sizes.
This function constructs a Potts Hamiltonian from an Ising graph by introducing a natural order in Potts Hamiltonian coordinates.
Arguments:
ig::IsingGraph
: The Ising graph representing the spin system.spectrum::Function
: A function for calculating the spectrum of the Potts Hamiltonian. It can befull_spectrum
orbrute_force
. Default isfull_spectrum
.cluster_assignment_rule::Dict{Int, T}
: A dictionary specifying the assignment rule that maps Ising graph vertices to clusters. It can besuper_square_lattice
,pegasus_lattice
orzephyr_lattice
.
Returns:
potts_h::LabelledGraph{MetaDiGraph}
: The Potts Hamiltonian represented as a labelled graph.
The potts_hamiltonian
function takes an Ising graph (ig
) as input and constructs a Potts Hamiltonian by introducing a natural order in Potts Hamiltonian coordinates. You can optionally specify a spectrum calculation function and a cluster assignment rule, which maps Ising graph vertices to clusters. This version of potts_hamiltonian
function does not truncate states in the cluster while calculating the spectrum. If you want to specify custom cluster sizes, use the alternative version of this function by passing a Dict{T, Int}
containing the number of states per cluster as num_states_cl
.
Simple example
using SpinGlassNetworks
# Load instance
instance = "$(@__DIR__)/../../src/instances/square_diagonal/5x5/diagonal.txt"
ig = ising_graph(instance)
# Create Potts Hamiltonian
potts_h = potts_hamiltonian(
ig,
cluster_assignment_rule = super_square_lattice((5,5,4))
)
LabelledGraphs.LabelledGraph{MetaGraphs.MetaDiGraph{Int64, Float64}, Tuple{Int64, Int64}}([(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5) … (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (5, 1), (5, 2), (5, 3), (5, 4), (5, 5)], {25, 72} directed Int64 metagraph with Float64 weights defined by :weight (default weight 1.0), Dict((4, 5) => 20, (1, 2) => 2, (3, 1) => 11, (2, 5) => 10, (1, 3) => 3, (1, 4) => 4, (5, 5) => 25, (3, 2) => 12, (3, 3) => 13, (4, 1) => 16…))