Skip to content

Commit 2ebb1bf

Browse files
authored
fix graph polynomial (#38)
1 parent 7220286 commit 2ebb1bf

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GenericTensorNetworks"
22
uuid = "3521c873-ad32-4bb4-b63d-f4f178f42b49"
33
authors = ["GiggleLiu <cacate0129@gmail.com> and contributors"]
4-
version = "1.0.0"
4+
version = "1.0.1"
55

66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

docs/src/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The solvable problems include [Independent set problem](@ref), [Maximal independ
1515

1616
## Background knowledge
1717

18-
Please check our paper ["Computing properties of independent sets by generic programming tensor networks"]().
18+
Please check our paper ["Computing properties of independent sets by generic programming tensor networks"]()(paper to be released soon).
1919
If you find our paper or software useful in your work, we would be grateful if you could cite our work. The [CITATION.bib](https://github.com/QuEraComputing/GenericTensorNetworks.jl/blob/master/CITATION.bib) file in the root of this repository lists the relevant papers.
2020

2121
## Quick start

src/graph_polynomials.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function _polynomial_single(gp::GraphProblem, ::Type{T}; usecuda, maxorder) wher
5757
xs = 0:maxorder
5858
ys = [Array(contractx(gp, T(x); usecuda=usecuda)) for x in xs] # download to CPU
5959
res = fill(T[], size(ys[1])) # contraction result can be a tensor
60-
for ci in length(ys[1])
60+
for ci in 1:length(ys[1])
6161
A = zeros(T, maxorder+1, maxorder+1)
6262
for j=1:maxorder+1, i=1:maxorder+1
6363
A[j,i] = T(xs[j])^(i-1)

test/graph_polynomials.jl

+10
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,14 @@ end
3535
p6 = graph_polynomial(gp, Val(:polynomial))[]
3636
p7 = graph_polynomial(gp, Val(:finitefield))[]
3737
@test p6 p7
38+
end
39+
40+
@testset "open indices" begin
41+
g = SimpleGraph(3)
42+
for (i,j) in [(1,2), (2,3)]
43+
add_edge!(g, i, j)
44+
end
45+
m1 = solve(IndependentSet(g; openvertices=(1,3)), GraphPolynomial())
46+
m2 = solve(IndependentSet(g; openvertices=(1,3)), GraphPolynomial(;method=:polynomial))
47+
@test m1 == m2
3848
end

0 commit comments

Comments
 (0)