Skip to content

Commit

Permalink
Update to ITensors v0.7, ITensorMPS v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Oct 23, 2024
1 parent 35d139c commit 7a1a959
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 88 deletions.
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ITensorNetworks"
uuid = "2919e153-833c-4bdc-8836-1ea460a35fc7"
authors = ["Matthew Fishman <[email protected]>, Joseph Tindall <[email protected]> and contributors"]
version = "0.11.21"
version = "0.11.22"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down Expand Up @@ -62,8 +62,8 @@ DocStringExtensions = "0.9"
EinExprs = "0.6.4"
Graphs = "1.8"
GraphsFlows = "0.1.1"
ITensorMPS = "0.2.2"
ITensors = "0.6.8"
ITensorMPS = "0.2.2, 0.3"
ITensors = "0.6.8, 0.7"
IsApprox = "0.1, 1, 2"
IterTools = "1.4.0"
KrylovKit = "0.6, 0.7, 0.8"
Expand Down
144 changes: 72 additions & 72 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/abstractitensornetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ end
# Link dimensions
#

function ITensors.maxlinkdim(tn::AbstractITensorNetwork)
function ITensorMPS.maxlinkdim(tn::AbstractITensorNetwork)
md = 1
for e in edges(tn)
md = max(md, linkdim(tn, e))
Expand Down
15 changes: 8 additions & 7 deletions src/inner.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ITensors: inner, scalar, loginner
using ITensors: inner, scalar
using ITensorMPS: ITensorMPS, loginner
using LinearAlgebra: norm, norm_sqr

default_contract_alg(tns::Tuple) = "bp"
Expand Down Expand Up @@ -53,7 +54,7 @@ function ITensors.inner(
return scalar(tn; sequence)
end

function ITensors.loginner(
function ITensorMPS.loginner(
ϕ::AbstractITensorNetwork,
ψ::AbstractITensorNetwork;
alg=default_contract_alg((ϕ, ψ)),
Expand All @@ -62,7 +63,7 @@ function ITensors.loginner(
return loginner(Algorithm(alg), ϕ, ψ; kwargs...)
end

function ITensors.loginner(
function ITensorMPS.loginner(
ϕ::AbstractITensorNetwork,
A::AbstractITensorNetwork,
ψ::AbstractITensorNetwork;
Expand All @@ -72,13 +73,13 @@ function ITensors.loginner(
return loginner(Algorithm(alg), ϕ, A, ψ; kwargs...)
end

function ITensors.loginner(
function ITensorMPS.loginner(
alg::Algorithm"exact", ϕ::AbstractITensorNetwork, ψ::AbstractITensorNetwork; kwargs...
)
return log(inner(alg, ϕ, ψ); kwargs...)
end

function ITensors.loginner(
function ITensorMPS.loginner(
alg::Algorithm"exact",
ϕ::AbstractITensorNetwork,
A::AbstractITensorNetwork,
Expand All @@ -88,7 +89,7 @@ function ITensors.loginner(
return log(inner(alg, ϕ, A, ψ); kwargs...)
end

function ITensors.loginner(
function ITensorMPS.loginner(
alg::Algorithm"bp",
ϕ::AbstractITensorNetwork,
ψ::AbstractITensorNetwork;
Expand All @@ -99,7 +100,7 @@ function ITensors.loginner(
return logscalar(alg, tn; kwargs...)
end

function ITensors.loginner(
function ITensorMPS.loginner(
alg::Algorithm"bp",
ϕ::AbstractITensorNetwork,
A::AbstractITensorNetwork,
Expand Down
3 changes: 2 additions & 1 deletion src/solvers/contract.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Graphs: nv, vertices
using ITensors: ITensors, linkinds, sim
using ITensors: ITensors, sim
using ITensorMPS: linkinds
using ITensors.NDTensors: Algorithm, @Algorithm_str, contract
using NamedGraphs: vertextype

Expand Down
8 changes: 4 additions & 4 deletions src/treetensornetworks/abstracttreetensornetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ using Graphs: has_vertex
using NamedGraphs.GraphsExtensions:
GraphsExtensions, edge_path, leaf_vertices, post_order_dfs_edges, post_order_dfs_vertices
using IsApprox: IsApprox, Approx
using ITensors: @Algorithm_str, directsum, hasinds, permute, plev
using ITensorMPS: linkind, loginner, lognorm, orthogonalize
using ITensors: ITensors, @Algorithm_str, directsum, hasinds, permute, plev
using ITensorMPS: ITensorMPS, linkind, loginner, lognorm, orthogonalize
using TupleTools: TupleTools

abstract type AbstractTreeTensorNetwork{V} <: AbstractITensorNetwork{V} end
Expand Down Expand Up @@ -273,13 +273,13 @@ end

Base.:+(tn::AbstractTTN) = tn

ITensors.add(tns::AbstractTTN...; kwargs...) = +(tns...; kwargs...)
ITensorMPS.add(tns::AbstractTTN...; kwargs...) = +(tns...; kwargs...)

function Base.:-(tn1::AbstractTTN, tn2::AbstractTTN; kwargs...)
return +(tn1, -tn2; kwargs...)
end

function ITensors.add(tn1::AbstractTTN, tn2::AbstractTTN; kwargs...)
function ITensorMPS.add(tn1::AbstractTTN, tn2::AbstractTTN; kwargs...)
return +(tn1, tn2; kwargs...)
end

Expand Down
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ITensorGaussianMPS = "2be41995-7c9f-4653-b682-bfa4e7cebb93"
ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2"
ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7"
ITensorUnicodePlots = "73163f41-4a9e-479f-8353-73bf94dbd758"
ITensorVisualizationBase = "cd2553d2-8bef-4d93-8a38-c62f17d5ad23"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down

0 comments on commit 7a1a959

Please sign in to comment.