Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ITensorNetworks"
uuid = "2919e153-833c-4bdc-8836-1ea460a35fc7"
version = "0.18.1"
version = "0.19.0"
authors = ["Matthew Fishman <mfishman@flatironinstitute.org>, Joseph Tindall <jtindall@flatironinstitute.org> and contributors"]

[workspace]
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path = ".."
Documenter = "1.10"
Graphs = "1"
ITensorFormatter = "0.2.27"
ITensorNetworks = "0.18"
ITensorNetworks = "0.19"
ITensors = "0.9"
Literate = "2.20.1"
NamedGraphs = "0.8.2"
Expand Down
24 changes: 18 additions & 6 deletions docs/src/computing_properties.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
# Computing Properties

```@setup main
using Graphs: vertices
using ITensorNetworks: expect, inner, loginner, normalize, random_ttn, siteinds
using Graphs: edges, vertices
using ITensorNetworks: ITensorNetwork, expect, inner, loginner, normalize, siteinds, ttn
using ITensors: Index, random_itensor
using LinearAlgebra: norm
using NamedGraphs.GraphsExtensions: incident_edges
using NamedGraphs.NamedGraphGenerators: named_grid

function random_state(g, s; link_space)
l = Dict(e => Index(link_space, "Link") for e in edges(g))
l = merge(l, Dict(reverse(e) => l[e] for e in edges(g)))
ts = Dict(
v => random_itensor(only(s[v]), (l[e] for e in incident_edges(g, v))...)
for v in vertices(g)
)
return ITensorNetwork(ts)
end

g = named_grid((4,))
s = siteinds("S=1/2", g)
phi = normalize(random_ttn(s; link_space = 2))
psi = normalize(random_ttn(s; link_space = 2))
x = normalize(random_ttn(s; link_space = 2))
y = normalize(random_ttn(s; link_space = 2))
phi = normalize(ttn(random_state(g, s; link_space = 2)))
psi = normalize(ttn(random_state(g, s; link_space = 2)))
x = normalize(ttn(random_state(g, s; link_space = 2)))
y = normalize(ttn(random_state(g, s; link_space = 2)))
v = first(vertices(psi))
```

Expand Down
5 changes: 2 additions & 3 deletions docs/src/reference.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# API Reference

Complete listing of all documented public functions and types in ITensorNetworks.jl,
ITensorNetworks.ModelNetworks, and ITensorNetworks.ModelHamiltonians.
Complete listing of all documented public functions and types in ITensorNetworks.jl.

```@autodocs
Modules = [ITensorNetworks, ITensorNetworks.ModelNetworks, ITensorNetworks.ModelHamiltonians]
Modules = [ITensorNetworks]
```
18 changes: 15 additions & 3 deletions docs/src/solvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,22 @@ variational sweep algorithm.
[`dmrg`](@ref ITensorNetworks.dmrg) is an alias for `eigsolve`.

```@example main
using ITensorNetworks: dmrg, dst, edges, normalize, random_ttn, siteinds, src, ttn
using ITensors: OpSum
using Graphs: vertices
using ITensorNetworks: ITensorNetwork, dmrg, dst, edges, normalize, siteinds, src, ttn
using ITensors: Index, OpSum, random_itensor
using NamedGraphs.GraphsExtensions: incident_edges
using NamedGraphs.NamedGraphGenerators: named_comb_tree

function random_state(g, s; link_space)
l = Dict(e => Index(link_space, "Link") for e in edges(g))
l = merge(l, Dict(reverse(e) => l[e] for e in edges(g)))
ts = Dict(
v => random_itensor(only(s[v]), (l[e] for e in incident_edges(g, v))...)
for v in vertices(g)
)
return ITensorNetwork(ts)
end

# Build a Heisenberg Hamiltonian on a comb tree
g = named_comb_tree((3, 2))
s = siteinds("S=1/2", g)
Expand All @@ -33,7 +45,7 @@ H = let h = OpSum()
end

# Random initial state (normalise first!)
psi0 = normalize(random_ttn(s; link_space = 2))
psi0 = normalize(ttn(random_state(g, s; link_space = 2)))

# Run DMRG
energy, psi = dmrg(H, psi0;
Expand Down
8 changes: 1 addition & 7 deletions docs/src/tree_tensor_networks.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ and provides a convenient interface for 1D calculations.
```@example main
using Graphs: vertices
using ITensorNetworks: ITensorNetwork, TreeTensorNetwork, mps, ortho_region, orthogonalize,
random_mps, random_ttn, siteinds, ttn
siteinds, ttn
using ITensors: ITensors
using LinearAlgebra: norm
using NamedGraphs.NamedGraphGenerators: named_comb_tree
Expand All @@ -33,20 +33,14 @@ sites = siteinds("S=1/2", g)
psi = ttn(sites) # zero-initialised
psi = ttn(v -> "Up", sites) # product state

# Random TTN
psi = random_ttn(sites; link_space = 2)

# 1D MPS
s1d = siteinds("S=1/2", 6)
mps_state = mps(v -> "Up", s1d) # product MPS
mps_state = random_mps(s1d; link_space = 2)
```

```@docs; canonical=false
ITensorNetworks.ttn
ITensorNetworks.mps
ITensorNetworks.random_ttn
ITensorNetworks.random_mps
```

### The `TreeTensorNetwork` type and conversion
Expand Down
2 changes: 1 addition & 1 deletion examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7"
path = ".."

[compat]
ITensorNetworks = "0.18"
ITensorNetworks = "0.19"
3 changes: 0 additions & 3 deletions src/ITensorNetworks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ include("contraction_sequences.jl")
include("tebd.jl")
include("itensornetwork.jl")
include("contract.jl")
include("specialitensornetworks.jl")
include("partitioneditensornetwork.jl")
include("edge_sequences.jl")
include("caches/abstractbeliefpropagationcache.jl")
Expand Down Expand Up @@ -63,7 +62,5 @@ include("normalize.jl")
include("expect.jl")
include("environment.jl")
include("exports.jl")
include("lib/ModelHamiltonians/src/ModelHamiltonians.jl")
include("lib/ModelNetworks/src/ModelNetworks.jl")

end
2 changes: 1 addition & 1 deletion src/caches/abstractbeliefpropagationcache.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Adapt: Adapt, adapt, adapt_structure
using Graphs: Graphs, IsDirected
using ITensors: dir
using ITensors: delta, dir
using LinearAlgebra: diag, dot
using NDTensors: NDTensors
using NamedGraphs.PartitionedGraphs: PartitionedGraph, PartitionedGraphs, QuotientVertex,
Expand Down
17 changes: 0 additions & 17 deletions src/expect.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,6 @@ vertex of `ψ`.

A `Dictionary` mapping each vertex of `ψ` to its expectation value.

# Example

```jldoctest
julia> using NamedGraphs.NamedGraphGenerators: named_grid

julia> g = named_grid((4,));

julia> s = siteinds("S=1/2", g);

julia> psi = random_ttn(s; link_space = 2);

julia> sz = expect(psi, "Sz");

julia> sz_exact = expect(psi, "Sz"; alg = "exact");

```

See also: [`expect(ψ, op::String, vertices)`](@ref),
[`expect(operator, state::AbstractTreeTensorNetwork)`](@ref).
"""
Expand Down
2 changes: 1 addition & 1 deletion src/formnetworks/bilinearformnetwork.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Adapt: adapt
using ITensors.NDTensors: datatype, denseblocks
using ITensors: ITensor, Op, prime, sim
using ITensors: ITensor, Op, delta, prime, sim
using NamedGraphs.GraphsExtensions: disjoint_union

default_dual_site_index_map = prime
Expand Down
130 changes: 0 additions & 130 deletions src/lib/ModelHamiltonians/src/ModelHamiltonians.jl

This file was deleted.

Loading
Loading