From 0e420f4a5c6c6ea392ca1fd9b9cf0283442f3962 Mon Sep 17 00:00:00 2001 From: Bartek Date: Fri, 27 Oct 2023 09:12:30 +0000 Subject: [PATCH] clean up toml --- Project.toml | 7 ++++--- src/ising.jl | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Project.toml b/Project.toml index 5f14176..5f411ef 100644 --- a/Project.toml +++ b/Project.toml @@ -5,24 +5,25 @@ version = "0.2.3" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" LabelledGraphs = "605abd48-4d17-4660-b914-d4df33194460" LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MKL = "33e6dc65-8f57-5167-99aa-e5a354878fb2" MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5" -SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" NNlibCUDA = "a00861dc-f156-4864-bf3c-e6376f28a68d" -CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" +SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b" [compat] CSV = "0.8" DocStringExtensions = "0.8" LabelledGraphs = "0.3.2" LightGraphs = "1.3" +MKL = "0.4.2" MetaGraphs = "0.6" julia = "1.5, 1.6, 1.7" -MKL = "0.4.2" [extras] Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" diff --git a/src/ising.jl b/src/ising.jl index 9672617..50f0b6a 100644 --- a/src/ising.jl +++ b/src/ising.jl @@ -25,12 +25,12 @@ $(TYPEDSIGNATURES) Create an Ising graph from interaction data. -This function creates an Ising graph from interaction data provided in the form of an `inst` argument. +This function creates an Ising graph from interaction data provided in the form of an `inst` argument. The Ising graph represents a system of spins, where each spin is associated with a vertex, and interactions between spins are represented as edges with corresponding weights. # Arguments: - `::Type{T}`: The type of the edge weights, typically `Float64` or `Float32`. -- `inst::Instance`: Interaction data, which can be either a file path to a CSV file or a collection of triples `(i, j, J)` +- `inst::Instance`: Interaction data, which can be either a file path to a CSV file or a collection of triples `(i, j, J)` representing interactions between spins, where `i` and `j` are spin indices, and `J` is the interaction strength. - `scale::Real`: A scaling factor applied to interaction strengths (default is 1). - `rank_override::Dict`: A dictionary specifying the rank (number of states) for each vertex. If not provided, a default rank of 2 is used for all vertices. @@ -38,8 +38,8 @@ representing interactions between spins, where `i` and `j` are spin indices, and # Returns: - `ig::IsingGraph{T}`: The Ising graph representing the spin system. -The function reads interaction data and constructs an Ising graph `ig`. -It assigns interaction strengths to edges between spins and optionally scales them by the `scale` factor. +The function reads interaction data and constructs an Ising graph `ig`. +It assigns interaction strengths to edges between spins and optionally scales them by the `scale` factor. The `rank_override` dictionary can be used to specify the rank (number of states) for individual vertices, allowing customization of the Ising model. Convention: H = scale * sum_{i, j} (J_{ij} * s_i * s_j + J_{ii} * s_i) """ @@ -81,7 +81,7 @@ $(TYPEDSIGNATURES) Return the coupling strengths between vertices of an Ising graph. -This function computes and returns the coupling strengths (interaction energies) between pairs of vertices in an Ising graph `ig`. +This function computes and returns the coupling strengths (interaction energies) between pairs of vertices in an Ising graph `ig`. The coupling strengths are represented as a matrix, where each element `(i, j)` corresponds to the interaction energy between vertex `i` and vertex `j`. # Arguments: @@ -108,9 +108,9 @@ $(TYPEDSIGNATURES) Return the dense adjacency matrix between clusters of vertices in an Ising graph. -This function computes and returns the dense adjacency matrix `J` between clusters of vertices represented by two -Ising graphs, `cl1` and `cl2`, within the context of the larger Ising graph `ig`. -The adjacency matrix represents the interaction strengths between clusters of vertices, +This function computes and returns the dense adjacency matrix `J` between clusters of vertices represented by two +Ising graphs, `cl1` and `cl2`, within the context of the larger Ising graph `ig`. +The adjacency matrix represents the interaction strengths between clusters of vertices, where each element `(i, j)` corresponds to the interaction strength between cluster `i` in `cl1` and cluster `j` in `cl2`. # Arguments: @@ -122,7 +122,7 @@ where each element `(i, j)` corresponds to the interaction strength between clus - `outer_edges::Vector{LabelledEdge}`: A vector of labeled edges representing the interactions between clusters. - `J::Matrix{T}`: A dense adjacency matrix representing interaction strengths between clusters. -The function first identifies the outer edges that connect vertices between the two clusters in the context of the larger Ising graph `ig`. +The function first identifies the outer edges that connect vertices between the two clusters in the context of the larger Ising graph `ig`. It then computes the interaction strengths associated with these outer edges and populates the dense adjacency matrix `J` accordingly. """ function inter_cluster_edges(ig::IsingGraph{T}, cl1::IsingGraph{T}, cl2::IsingGraph{T}) where T @@ -141,8 +141,8 @@ $(TYPEDSIGNATURES) Used only in MPS_search, would be obsolete if MPS_search uses QMps. Remove non-existing spins from an Ising graph. -This function removes non-existing spins from the given Ising graph `ig`. -Non-existing spins are those that have zero degree (no connections to other spins) and also have an external +This function removes non-existing spins from the given Ising graph `ig`. +Non-existing spins are those that have zero degree (no connections to other spins) and also have an external magnetic field (`h`) that is not approximately equal to zero within the specified tolerance `atol`. # Arguments: