Skip to content

Commit

Permalink
Introduce new network interface
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter2206 committed Apr 14, 2021
1 parent dd782db commit 2529b6e
Show file tree
Hide file tree
Showing 11 changed files with 337 additions and 199 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.1.0"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
LabelledGraphs = "605abd48-4d17-4660-b914-d4df33194460"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Memoize = "c03570c3-d221-55d1-a50c-7939bbd78826"
Expand All @@ -18,7 +19,7 @@ DocStringExtensions = "0.8"
LightGraphs = "1.3"
Memoize = "0.4"
MetaGraphs = "0.6"
SpinGlassNetworks = "0.1"
SpinGlassNetworks = "0.2"
SpinGlassTensors = "0.1"
TensorCast = "0.3"
TensorOperations = "3.0.1"
Expand Down
10 changes: 5 additions & 5 deletions src/MPS_search.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function solve(ψ::AbstractMPS, keep::Int)
states', lprob, lpCut
end

function _apply_bias!::AbstractMPS, ig::MetaGraph, dβ::Number, i::Int)
function _apply_bias!::AbstractMPS, ig::LabelledGraph, dβ::Number, i::Int)
M = ψ[i]
d = size(M, 2)

Expand All @@ -84,7 +84,7 @@ function _apply_bias!(ψ::AbstractMPS, ig::MetaGraph, dβ::Number, i::Int)
ψ[i] = M
end

function _apply_exponent!::AbstractMPS, ig::MetaGraph, dβ::Number, i::Int, j::Int, last::Int)
function _apply_exponent!::AbstractMPS, ig::LabelledGraph, dβ::Number, i::Int, j::Int, last::Int)
M = ψ[j]
D = typeof(M).name.wrapper(I(physical_dim(ψ, i)))

Expand Down Expand Up @@ -133,7 +133,7 @@ end

_holes(l::Int, nbrs::Vector) = setdiff(l+1 : last(nbrs), nbrs)

function _apply_layer_of_gates(ig::MetaGraph, ρ::AbstractMPS, control::MPSControl, dβ::Number)
function _apply_layer_of_gates(ig::LabelledGraph, ρ::AbstractMPS, control::MPSControl, dβ::Number)
L = nv(ig)
Dcut = control.max_bond
tol = control.var_ϵ
Expand Down Expand Up @@ -168,7 +168,7 @@ function _apply_layer_of_gates(ig::MetaGraph, ρ::AbstractMPS, control::MPSContr
ρ
end

function SpinGlassTensors.MPS(ig::MetaGraph, control::MPSControl)
function SpinGlassTensors.MPS(ig::LabelledGraph, control::MPSControl)

Dcut = control.max_bond
tol = control.var_ϵ
Expand All @@ -187,7 +187,7 @@ function SpinGlassTensors.MPS(ig::MetaGraph, control::MPSControl)
ρ
end

function SpinGlassTensors.MPS(ig::MetaGraph, control::MPSControl, type::Symbol)
function SpinGlassTensors.MPS(ig::LabelledGraph, control::MPSControl, type::Symbol)
L = nv(ig)
Dcut = control.max_bond
tol = control.var_ϵ
Expand Down
Loading

0 comments on commit 2529b6e

Please sign in to comment.