Skip to content

Commit 441f631

Browse files
committed
fix tests
1 parent ba36b6c commit 441f631

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ProblemReductionsExt = "ProblemReductions"
1616
[compat]
1717
Graphs = "1.6"
1818
LuxorGraphPlot = "0.5"
19-
ProblemReductions = "0.2, 0.3"
19+
ProblemReductions = "0.3"
2020
julia = "1"
2121

2222
[extras]

ext/ProblemReductionsExt.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ end
8787

8888
function ProblemReductions.extract_solution(res::SpinGlassToIndependentSet, sol)
8989
res = map_config_back(res.mapres, sol)
90-
return 1 .- 2 .* Int.(res)
90+
return Int.(res)
9191
end
9292

9393
###### Spinglass problem on grid to MIS on KSG ######
@@ -113,6 +113,6 @@ end
113113

114114
function ProblemReductions.extract_solution(res::SquareSpinGlassToIndependentSet, sol)
115115
res = map_config_back(res.mapres, sol)
116-
return 1 .- 2 .* Int.(res)
116+
return Int.(res)
117117
end
118118
end

test/dragondrop.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ using Random
1919
@test r1.n - qubo.mis_overhead r2.n
2020
@test r1.n % 1 r2.n % 1
2121
c1 = map_config_back(qubo, r1.c.data)
22-
@test GenericTensorNetworks.energy(sg, 1 .- 2 .* Int.(c1)) GenericTensorNetworks.energy(sg, 1 .- 2 .* Int.(r2.c.data))
22+
@test GenericTensorNetworks.energy(sg, Int.(c1)) GenericTensorNetworks.energy(sg, Int.(r2.c.data))
2323
#display(MappingGrid(UnitDiskMapping.CopyLine[], 0, qubo))
2424
end
2525

@@ -94,5 +94,5 @@ end
9494
@test r1.n - qubo.mis_overhead r2.n
9595
c1 = map_config_back(qubo, collect(Int,r1.c.data))
9696
c2 = collect(r2.c.data)
97-
@test GenericTensorNetworks.energy(sg, 1 .- 2 .* Int.(c1)) GenericTensorNetworks.energy(sg, 1 .- 2 .* Int.(c2))
97+
@test GenericTensorNetworks.energy(sg, Int.(c1)) GenericTensorNetworks.energy(sg, Int.(c2))
9898
end

0 commit comments

Comments
 (0)