Skip to content

Commit bda6758

Browse files
committed
fix issue #12
1 parent af19ea2 commit bda6758

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ Yao = "5872b779-8223-5990-8dd0-5abbb0748c8c"
2222

2323
[compat]
2424
Compose = "0.9"
25+
HDF5 = "0.15"
26+
LightGraphs = "1.3"
2527
LuxurySparse = "0.6"
2628
NiLang = "0.8"
27-
LightGraphs = "1.3"
28-
HDF5 = "0.15"
2929
Requires = "1"
30-
SimpleTensorNetworks = "0.1"
30+
SimpleTensorNetworks = "0.2"
3131
TropicalNumbers = "0.2.1"
3232
TropicalYao = "0.1"
3333
Viznet = "0.3"

notebooks/randomgraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### A Pluto.jl notebook ###
2-
# v0.12.18
2+
# v0.12.21
33

44
using Markdown
55
using InteractiveUtils

project/counting_ising_and_2sat.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ function load_and_contract(::Type{T}, n::Int; seed::Int, usecuda=false, datafile
2121
LabeledTensor(CountingTropical{T}.(arr, degen), labels[:,i])
2222
end
2323
# circle layout
24-
metas = [TensorMeta((0.5+0.5*cos(i/n*2π), 0.5+0.5*sin(i/n*2π)), string(i)) for i=1:n]
25-
tn = TensorNetwork(tensors, metas=metas)
24+
tn = TensorNetwork(tensors)
2625
if usecuda
2726
tn = TropicalTensors.togpu(tn)
2827
end
@@ -36,7 +35,7 @@ function run(::Type{T}, n::Int; dataset) where T
3635
datafile = dataset*".hdf5"
3736
loadeddata = HDF5.h5open(TropicalTensors.project_relative_path("data", datafile), "r")
3837
println("number of seeds = $(length(read(loadeddata["n$n"])))")
39-
t = @elapsed res = load_and_contract(T, n; seed=10, usecuda=true, datafile=dataset*".hdf5")
38+
t = @elapsed res = load_and_contract(T, n; seed=1, usecuda=true, datafile=dataset*".hdf5")
4039
for seed = 1:100
4140
try
4241
t = @elapsed res = load_and_contract(T, n; seed=seed, usecuda=true, datafile=datafile)

project/dataload.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ function build_tree(order)
3131
ids[tb+1] = nothing
3232
end
3333
ids[1]
34-
end
34+
end

src/TropicalTensors.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ using SimpleTensorNetworks
88

99
export Tropical, CountingTropical
1010
export Reversible
11-
export TensorNetwork, LabeledTensor, contract, tensorcontract
11+
export TensorNetwork, LabeledTensor, contract, tensorcontract, ContractionTree
1212

1313
project_relative_path(xs...) = normpath(joinpath(dirname(dirname(pathof(@__MODULE__))), xs...))
1414

src/cuda.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function _init_reg(::Type{T}, lt::MaskedSquareLattice, ::Val{:true}) where T
2121
end
2222

2323
function togpu(tn::TensorNetwork)
24-
TensorNetwork(togpu.(tn.tensors); metas=tn.metas)
24+
TensorNetwork(togpu.(tn.tensors))
2525
end
2626

2727
function togpu(t::LabeledTensor)
2828
LabeledTensor(CuArray(t.array), t.labels)
29-
end
29+
end

src/potts.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Solving the Potts model on a SquareLattice
2+
using SimpleTensorNetworks: ContractionTree
23

34
export potts_bondtensor, δ, solve_potts
45

0 commit comments

Comments
 (0)