Skip to content
Draft
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.19.4"
version = "0.19.5"
authors = ["Matthew Fishman <mfishman@flatironinstitute.org>, Joseph Tindall <jtindall@flatironinstitute.org> and contributors"]

[workspace]
Expand Down
6 changes: 6 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ makedocs(;
"Computing Properties" => "computing_properties.md",
"Solvers" => "solvers.md",
],
"Developer Reference" => [
"Interface Methods" => "interface_methods.md",
"Developer Methods" => "developer_methods.md",
"Experimental Methods" => "experimental_methods.md",
"Deprecated Methods" => "deprecated_methods.md",
],
"API Reference" => "reference.md",
]
)
Expand Down
100 changes: 100 additions & 0 deletions docs/src/deprecated_methods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Deprecated Methods

Suggestions of methods which could be deleted.

## ITensorNetwork Methods

#### ITensorNetwork Constructors

* Default constructor (`itensornetwork.jl`).
```julia
ITensorNetwork{V}()
```

* From a named graph, forwards to construction from `IndsNetwork` (`itensornetwork.jl`):
```julia
ITensorNetwork{V}(g::NamedGraph)
ITensorNetwork(eltype::Type, undef::UndefInitializer, graph::AbstractNamedGraph; kws...)
ITensorNetwork(f, graph::AbstractNamedGraph; kwargs...)
ITensorNetwork(graph::AbstractNamedGraph; kwargs...)
```

* From a simple graph, forwards to construction from `IndsNetwork` (`itensornetwork.jl`):
```julia
ITensorNetwork(eltype::Type, undef::UndefInitializer, graph::AbstractSimpleGraph; kws...)
ITensorNetwork(f, graph::AbstractSimpleGraph; kwargs...)
ITensorNetwork(graph::AbstractSimpleGraph; kwargs...)
```

* From a function over vertices or from a "value" (e.g. a string like `"Up"`,
an `Op`, an array, or a per-vertex dict/array) that is converted to a callable and used
to initialize each vertex tensor (`itensornetwork.jl`):
```julia
ITensorNetwork(value, is::IndsNetwork; kwargs...)
ITensorNetwork(elt::Type, f, is::IndsNetwork; link_space = trivial_space(is), kws...)
ITensorNetwork(itensor_constructor::Function, is::IndsNetwork; link_space = trivial_space(is), kwargs...)
```

* From a single `ITensor`. Wraps the tensor in a single-vertex network (`itensornetwork.jl`):
```julia
ITensorNetwork(t::ITensor)
```

#### Local Operations on ITensorNetworks

* Versions of `siteinds` taking a `vertex` argument. Each of these is just an alias for `uniqueinds`. Possibly the wrong design / implementation. (`abstractitensornetwork.jl`).
```julia
siteinds(tn::AbstractITensorNetwork, vertex) # abstractitensornetwork.jl:288
siteinds(tn::AbstractITensorNetwork, vertex::Int) # abstractitensornetwork.jl:292
```
Comment thread
emstoudenmire marked this conversation as resolved.


* Functions in `apply.jl` which are unused, even inside that file (`apply.jl`):
```julia
_gate_vertices(o::ITensor, ψ)
_gate_vertices(o::AbstractEdge, ψ)
_contract_gate(o::ITensor, ψv1, Λ, ψv2)
_contract_gate(o::AbstractEdge, ψv1, Λ, ψv2)
```

* Collection of tensors neighboring the given vertex (`abstractitensornetwork.jl`):
```julia
neighbor_tensors(tn::AbstractITensorNetwork, vertex)
```

* Iterate over the tensors at the given vertices, default all vertices (`abstractitensornetwork.jl`):
```julia
eachtensor(tn::AbstractITensorNetwork, vertices = vertices(tn))
```

## Global Operations on ITensorNetworks


## TreeTensorNetwork Constructors

* From `Op` and related types (`opsum_to_ttn.jl`):
```julia
ttn(o::Op, s::IndsNetwork; kws...)
ttn(o::Scaled{C, Op}, s::IndsNetwork; kws...)
ttn(o::Sum{Op}, s::IndsNetwork; kws...)
ttn(o::Prod{Op}, s::IndsNetwork; kws...)
ttn(o::Scaled{C, Prod{Op}}, s::IndsNetwork; kws...)
ttn(o::Sum{Scaled{C, Op}}, s::IndsNetwork; kws...)
```
Comment on lines +73 to +83
Copy link
Copy Markdown
Member

@mtfishman mtfishman Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'll have to think about the alternatives to these if we remove them. Maybe it would be something like ttn(opsum::OpSum, graph::NamedGraph, siteinds:Dict{V, <: Index}), i.e. you specify the graph and site indices? Though I guess we could make it more general, i.e. ITensorNetwork(opsum::OpSum, graph::NamedGraph, siteinds:Dict{V, <: Index}), and error if the graph isn't a tree.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was my bad to include the mpo ones here. I had put them in "interface" actually, just accidentally duplicated them here.

Were your comments above about a more general constructor that would take the place of the mpo ones?

The ones really intended to be here in Deprecated are the ones which take other Op-adjacent data like Scaled{C,Op}, Prod{Op}, etc. My guess was we might want those but later on through Lukas's system so maybe better not to have them here? They are little one-liners though so not causing any big issues. What do you think of these?

Copy link
Copy Markdown
Member

@mtfishman mtfishman Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I thought you were including all mpo and ttn constructors. That sounds reasonable to get rid of Scaled{C,Op}, Prod{Op}, etc. for now (non-OpSum ones).

I was indeed suggesting getting rid of ttn and mpo entirely and just focusing on a more general ITensorNetwork constructor that just restricts to trees with a runtime check.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, that would be a longer term change which assumes we are getting rid of the TTN type, and since the current DMRG/TDVP code still expects a TTN then we could replace mpo and ttn with using the TTN type directly, i.e. remove mpo and ttn functions in favor of just making a TTN constructor that accepts an OpSum.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the above would be a good plan. One way we could go would be to start replacing tree tensor network methods with ITensorNetwork ones (just restricted to trees with a runtime check) and then after some rounds of this see how much of a "footprint" is left by the actual TreeTensorNetwork type. It might not be that much after a handful of key changes.

My guess is probably the largest footprint is through parts of the code, like solvers, which rely on the gauging capabilities of tree tensor networks but also of course that's something that could be switched over to ITensorNetworks with a runtime tree check. Also I remember you had some thoughts about gauging and caches that sounded more deep.. we should discuss more.


## Miscellaneous Methods

* Methods in `partitioneditensornetwork.jl`.
```julia
linkinds(pitn::PartitionedGraph, edge::QuotientEdge)
```
To be revisited after Jack's work on NamedGraphs.

* Methods in `graphs.jl`.
Just one methods which constructs a `SimpleGraph` from ITensors (`graphs.jl`).
```julia
SimpleGraphs.SimpleGraph(itensors::Vector{ITensor})
```
Not used anywhere in library.

* Methods in `update_observer.jl`. Not used anywhere in library.
Loading
Loading