Branch and bound search

Here you find the main function of the package, which is an actual solver.

SpinGlassPEPS.SpinGlassEngine.low_energy_spectrum — Function
low_energy_spectrum(
    ctr::MpsContractor{T, R, S},
    sparams::SearchParameters;
    ...
) -> Tuple{Solution, Dict{Any, Any}}
low_energy_spectrum(
    ctr::MpsContractor{T, R, S},
    sparams::SearchParameters,
    merge_strategy;
    ...
) -> Tuple{Solution, Dict{Any, Any}}
low_energy_spectrum(
    ctr::MpsContractor{T, R, S},
    sparams::SearchParameters,
    merge_strategy,
    symmetry::Symbol;
    no_cache,
    show_progress,
    schmidt_spectrum,
    retain_mps
) -> Tuple{Solution, Dict{Any, Any}}

Compute the low-energy spectrum on a quasi-2D graph using branch-and-bound search.

Merge matching configurations during branch-and-bound search going line by line. Information about excited states (droplets) is collected during merging, which allows reconstructing the low-energy spectrum. It takes as input a ctr object representing the PEPS network and the parameters for controlling its contraction, sparams specifying search parameters, merge_strategy for merging branches, and symmetry indicating any symmetry constraints. Optionally, you can disable caching using the no_cache flag. Probabilities are kept as log. Results are stored in Solution structure.

Arguments

  • ctr::AbstractContractor: The contractor object representing the PEPS network, which should be a subtype of AbstractContractor.
  • sparams::SearchParameters: Parameters for controlling the search, including the maximum number of states and a cutoff probability.
  • merge_strategy=no_merge: (Optional) Merge strategy for branches. Defaults to no_merge.
  • symmetry::Symbol=:noZ2: (Optional) Symmetry constraint. Defaults to :noZ2. If Z2 symmetry is present in your system, use :Z2.
  • no_cache=false: (Optional) If true, disables caching. Defaults to false.
  • show_progress=true: (Optional) Display the preprocessing and search progress bars. Set to false when solving concurrently — see sweep_transformations — since interleaved bars are unreadable.
  • schmidt_spectrum=false: (Optional) Compute the per-row Schmidt spectra returned as the second value. Off by default: it costs an untruncated CPU SVD per site per row and callers overwhelmingly discard the result. Note this is a change from 1.x, where the spectra were always computed.
  • retain_mps=false: (Optional) Snapshot each row's bottom boundary MPS (on the host) into the contractor's warm-start slot as it is built, so that a following set_beta! can variationally compress from it rather than rebuilding from scratch. See beta_ladder.

To record how much weight the boundary-MPS truncations discarded during the solve, install a TruncationLog in the calling task's scope; see sweep_transformations, which does this per transformation.

Returns

A tuple (sol, s) containing:

  • sol::Solution: A Solution object representing the computed low-energy spectrum.
  • s::Dict: A dictionary containing Schmidt spectra for each row of the PEPS network, empty unless schmidt_spectrum=true.
source
SpinGlassPEPS.SpinGlassEngine.merge_branches — Function
merge_branches(ctr; merge_prob=:none, droplets_encoding=NoDroplets(), ...)

Return a function that merges solution branches with the selected probability strategy and optional droplet encoding. The deprecated merge_type and update_droplets keywords remain supported for published 1.x examples.

source
SpinGlassPEPS.SpinGlassEngine.merge_branches_blur — Function
merge_branches_blur(
    ctr::MpsContractor{T},
    hamming_cutoff::Int64
) -> SpinGlassPEPS.SpinGlassEngine.var"#_merge_blur#merge_branches_blur##0"{MpsContractor{T, R, S, N}, Int64, Symbol, NoDroplets} where {T<:SpinGlassPEPS.SpinGlassEngine.AbstractStrategy, R<:SpinGlassPEPS.SpinGlassEngine.AbstractGauge, S<:Real, N<:PEPSNetwork}
merge_branches_blur(
    ctr::MpsContractor{T},
    hamming_cutoff::Int64,
    merge_prob::Symbol
) -> SpinGlassPEPS.SpinGlassEngine.var"#_merge_blur#merge_branches_blur##0"{MpsContractor{T, R, S, N}, Int64, Symbol, NoDroplets} where {T<:SpinGlassPEPS.SpinGlassEngine.AbstractStrategy, R<:SpinGlassPEPS.SpinGlassEngine.AbstractGauge, S<:Real, N<:PEPSNetwork}
merge_branches_blur(
    ctr::MpsContractor{T},
    hamming_cutoff::Int64,
    merge_prob::Symbol,
    droplets_encoding
) -> SpinGlassPEPS.SpinGlassEngine.var"#_merge_blur#merge_branches_blur##0"{MpsContractor{T, R, S, N}, Int64, Symbol} where {T<:SpinGlassPEPS.SpinGlassEngine.AbstractStrategy, R<:SpinGlassPEPS.SpinGlassEngine.AbstractGauge, S<:Real, N<:PEPSNetwork}

Generate a function for merging branches in a Gibbs network with a Hamming distance blur.

Arguments

  • ctr::MpsContractor{T}: The contractor representing the contracted Gibbs network.
  • hamming_cutoff::Int: The Hamming distance cutoff for blur.
  • merge_prob::Symbol=:none: The merging strategy, defaults to :none.
  • droplets_encoding=NoDroplets(): Droplet update method, defaults to NoDroplets().

Returns

A function _merge_blur that can be used to merge branches with Hamming distance blur in a solution.

Description

This function generates a function for merging branches in a Gibbs network with Hamming distance blur. The resulting function takes a partial solution as an input and performs the merging process, considering Hamming distance constraints. It returns a new solution with the merged branches. The Hamming distance blur helps in selecting diverse states during the merging process. States with Hamming distances greater than or equal to the specified cutoff are considered distinct.

source

Results of the branch and bound search are stored in a Solution structure.

SpinGlassPEPS.SpinGlassEngine.Solution — Type

A struct representing a solution obtained from a low-energy spectrum search.

Fields

  • energies::Vector{<:Real}: A vector containing the energies of the discovered states.
  • states::Vector{Vector{Int}}: A vector of state configurations corresponding to the energies.
  • probabilities::Vector{<:Real}: The probabilities associated with each discovered state.
  • degeneracy::Vector{Int}: The degeneracy of each energy level.
  • largest_discarded_probability::Real: The largest probability of the largest discarded state.
  • droplets::Vector{Droplets}: A vector of droplets associated with each state.
  • spins::Vector{Vector{Int}}: The spin configurations corresponding to each state.

The Solution struct holds information about the results of a low-energy spectrum search, including the energy levels, state configurations, probabilities, degeneracy, and additional details such as droplets and spin configurations. Users can access this information to analyze and interpret the search results.

source

Droplet search

SpinGlassPEPS.jl provides the capability to find not only low-energy states but also droplet excitations. To search for droplets, the SingleLayerDroplets option must be selected in the merge_branches function.

Droplets are identified during the optional merge_branches step, which can be invoked within the low_energy_spectrum function that runs the branch-and-bound algorithm. This search focuses on finding diverse excitations within a specific energy range above the ground state. An excitation is accepted only if its Hamming distance from any previously identified excitation exceeds a predefined threshold.

This behavior is controlled by two key parameters:

  • energy_cutoff: Defines the maximum allowed energy above the ground state for considering an excitation.
  • hamming_cutoff: Sets the minimum Hamming distance required between excitations for them to be classified as distinct.

By adjusting these parameters, users can search for different excitations while ensuring that only sufficiently distinct ones are included.

SpinGlassPEPS.SpinGlassEngine.SingleLayerDroplets — Type

A data structure representing the properties and criteria for identifying single-layer droplets in the context of the SpinGlassPEPS package.

A SingleLayerDroplets object is used to specify the maximum energy, minimum size, and metric for single-layer droplets in the SpinGlassPEPS.

Fields

  • max_energy::Real: The maximum allowed excitation energy above the ground state. It is typically a real number.
  • min_size::Int: The minimum Hamming distance required between excitations for them to be considered distinct.
  • metric::Symbol: The metric used to evaluate the significance of a single-layer droplet. Default is :no_metric. :hamming treats Hamming distances as a metric.
  • mode::Symbol: :Ising assumes Ising-type representation of the problem. :RMF assumes a Random Markov Field type model. Default is :Ising.

Constructors

  • SingleLayerDroplets(max_energy::Real = 1.0, min_size::Int = 1, metric::Symbol = :no_metric, mode = :Ising): Creates a new SingleLayerDroplets object with the specified maximum energy, minimum size, metric and mode.
source