Skip to content

Commit d0e1594

Browse files
authored
fix readme (#8)
1 parent 3dc6948 commit d0e1594

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ julia> solve(problem, "counting max2")
7676

7777
Here, `solve` function returns you a 0-dimensional array.
7878
For open graphs, this output tensor can have higher dimensions. Each entry corresponds to a different boundary condition.
79+
You can speed up the Tropical number computation when computing "size max" on CPU by using the `TropicalGEMM`
80+
81+
```julia
82+
julia> using TropicalGEMM
83+
```
7984

8085
#### 2. compute the independence polynomial
8186

src/GraphTensorNetworks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using OMEinsumContractionOrders: SlicedEinsum
44
using Core: Argument
55
using TropicalNumbers
66
using OMEinsum
7-
using OMEinsum: timespace_complexity, collect_ixs
7+
using OMEinsum: timespace_complexity, getixsv
88
using Graphs
99

1010
export timespace_complexity, @ein_str

src/configurations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ end
100100
for GP in [:Independence, :Matching, :MaximalIndependence, :Coloring]
101101
@eval symbols(gp::$GP) = labels(gp.code)
102102
end
103-
symbols(gp::MaxCut) = collect_ixs(gp.code)
103+
symbols(gp::MaxCut) = getixsv(gp.code)

src/graph_polynomials.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ end
107107
############### Problem specific implementations ################
108108
### independent set ###
109109
function generate_tensors(fx, gp::Independence)
110-
ixs = collect_ixs(gp.code)
110+
ixs = getixsv(gp.code)
111111
n = length(unique!(vcat(ixs...)))
112112
T = typeof(fx(ixs[1][1]))
113113
return map(enumerate(ixs)) do (i, ix)
@@ -131,7 +131,7 @@ misv(val::T) where T = [one(T), val]
131131

132132
### coloring ###
133133
function generate_tensors(fx, c::Coloring{K}) where K
134-
ixs = collect_ixs(c.code)
134+
ixs = getixsv(c.code)
135135
T = eltype(fx(ixs[1][1]))
136136
return map(ixs) do ix
137137
# if the tensor rank is 1, create a vertex tensor.
@@ -153,7 +153,7 @@ coloringv(vals::Vector{T}) where T = vals
153153

154154
### matching ###
155155
function generate_tensors(fx, m::Matching)
156-
ixs = collect_ixs(m.code)
156+
ixs = getixsv(m.code)
157157
T = typeof(fx(ixs[1][1]))
158158
n = length(unique!(vcat(ixs...))) # number of vertices
159159
tensors = []
@@ -180,7 +180,7 @@ end
180180

181181
### maximal independent set ###
182182
function generate_tensors(fx, mi::MaximalIndependence)
183-
ixs = collect_ixs(mi.code)
183+
ixs = getixsv(mi.code)
184184
T = eltype(fx(ixs[1][end]))
185185
return map(ixs) do ix
186186
neighbortensor(fx(ix[end]), length(ix))
@@ -197,7 +197,7 @@ end
197197

198198
### max cut/spin glass problem ###
199199
function generate_tensors(fx, gp::MaxCut)
200-
ixs = collect_ixs(gp.code)
200+
ixs = getixsv(gp.code)
201201
return map(enumerate(ixs)) do (i, ix)
202202
maxcutb(fx(ix))
203203
end

src/networks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Return a vector of unique labels in an Einsum token.
9696
"""
9797
function labels(code::EinTypes)
9898
res = []
99-
for ix in collect_ixs(code)
99+
for ix in getixsv(code)
100100
for l in ix
101101
if l res
102102
push!(res, l)

0 commit comments

Comments
 (0)