Skip to content

Commit

Permalink
hide _ methods, posponing Dict in ising_graph
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekGardas committed Nov 20, 2020
1 parent 685650b commit d25ec87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
6 changes: 2 additions & 4 deletions src/ising.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ end
"""
Create a graph that represents the Ising Hamiltonian.
"""
function ising_graph(instance::Union{String, Dict}, L::Int, β::Number=1)
function ising_graph(instance::String, L::Int, β::Number=1)

# load the Ising instance
if typeof(instance) == String
ising = CSV.File(instance, types=[Int, Int, Float64], comment = "#")
end
ising = CSV.File(instance, types=[Int, Int, Float64], comment = "#")
ig = MetaGraph(L, 0.0)

set_prop!(ig, :description, "The Ising model.")
Expand Down
5 changes: 0 additions & 5 deletions src/search.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ export MPS_from_gates, unique_neighbors
export MPSControl
export spectrum

export _apply_bias!
export _apply_exponent!
export _apply_projector!
export _apply_nothing!

struct MPSControl
max_bond::Int
var_ϵ::Number
Expand Down
8 changes: 4 additions & 4 deletions test/search.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mps_param = MPSControl(Dcut, var_tol, max_sweeps)
@test sum(T) 1

for i 1:N
_apply_bias!(χ, ig, β, i)
SpinGlassPEPS._apply_bias!(χ, ig, β, i)

h = get_prop(ig, i, :h)
for σ states
Expand All @@ -47,9 +47,9 @@ mps_param = MPSControl(Dcut, var_tol, max_sweeps)

if !isempty(nbrs)

_apply_projector!(χ, i)
SpinGlassPEPS._apply_projector!(χ, i)
for j nbrs
_apply_exponent!(χ, ig, β, i, j)
SpinGlassPEPS._apply_exponent!(χ, ig, β, i, j)

J = get_prop(ig, i, j, :J)
for σ states
Expand All @@ -59,7 +59,7 @@ mps_param = MPSControl(Dcut, var_tol, max_sweeps)

for l i+1:maximum(nbrs)
if l nbrs
_apply_nothing!(χ, l)
SpinGlassPEPS._apply_nothing!(χ, l)
end
end
end
Expand Down

0 comments on commit d25ec87

Please sign in to comment.