diff --git a/src/ising.jl b/src/ising.jl index fcdb63e..7042138 100644 --- a/src/ising.jl +++ b/src/ising.jl @@ -20,7 +20,7 @@ function unique_nodes(ising_tuples) end """ -$(TYPEDSIGNATURES) + ising_graph(instance, sgn::Number = 1.0, rank_override::Dict{Int,Int} = Dict{Int,Int}()) Create an Ising graph from interaction data. diff --git a/src/spectrum.jl b/src/spectrum.jl index 8efabfa..a0a1470 100644 --- a/src/spectrum.jl +++ b/src/spectrum.jl @@ -64,7 +64,7 @@ function matrix_to_integers(matrix::Vector{Vector{T}}) where {T} end """ -$(TYPEDSIGNATURES) + energy(σ::Vector, ig::IsingGraph) Calculates the energy of a state in an Ising graph. diff --git a/test/ising.jl b/test/ising.jl index 763e280..8dc3674 100644 --- a/test/ising.jl +++ b/test/ising.jl @@ -64,10 +64,14 @@ end @testset "Ising graph created with additional parameters" begin expected_biases = [-0.1, -0.5, 0.0] expected_couplings = Dict(Edge(1, 2) => 0.3, Edge(1, 3) => 2.0, Edge(2, 3) => -1.0) + expected_couplings = Dict(Edge(1, 2) => 0.3, Edge(1, 3) => 2.0, Edge(2, 3) => -1.0) expected_J_matrix = [ [0 0.3 2.0] [0 0 -1.0] [0 0 0] + [0 0.3 2.0] + [0 0 -1.0] + [0 0 0] ] ig = ising_graph( @@ -112,6 +116,7 @@ end @testset "Reading from Dict" begin instance_dict = Dict() ising = CSV.File(instance, types = [Int, Int, Float64], header = 0, comment = "#") + ising = CSV.File(instance, types = [Int, Int, Float64], header = 0, comment = "#") for (i, j, v) ∈ ising push!(instance_dict, (i, j) => v)