Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
eef7d0f
Delete and move some files to make space for new code
emstoudenmire Apr 1, 2025
b15d045
Add redesigned solver codes
emstoudenmire Apr 2, 2025
3edcc3d
Update solvers codes to latest versions
emstoudenmire Jul 1, 2025
8930d80
Remove previous solver includes
emstoudenmire Jul 1, 2025
9235349
Add ConstructionBase dependency
emstoudenmire Jul 1, 2025
d70bf03
Adapt new solver codes into ITensorNetworks module
emstoudenmire Jul 1, 2025
c081dfb
Continue adapting code and improve DMRG test
emstoudenmire Jul 2, 2025
e5047fc
Rename tdvp to time_evolve. Add tests.
emstoudenmire Jul 2, 2025
3f7442f
Change default outputlevel in tests
emstoudenmire Jul 2, 2025
8ef353f
Rename and reorder some arguments
emstoudenmire Jul 2, 2025
7391c0c
Rename test files
emstoudenmire Jul 2, 2025
735fa7e
Bump version number to 0.14.0
emstoudenmire Jul 3, 2025
1d1dbc0
Rename permute_indices to align_indices
emstoudenmire Jul 4, 2025
b918731
Rename file
emstoudenmire Jul 4, 2025
8928162
Implement many style changes
emstoudenmire Jul 4, 2025
0a4db77
Improve time_steps calculation code
emstoudenmire Jul 5, 2025
9abc732
Change name of callbacks and use overloading
emstoudenmire Jul 6, 2025
7719cc2
Improve import/using code style
emstoudenmire Jul 6, 2025
751902c
Rename region_iterator_action to region_step
emstoudenmire Jul 6, 2025
ddafd9f
Change callbacks and printer to take problem
emstoudenmire Jul 6, 2025
31a86d3
Remove older region_plans.jl file
emstoudenmire Jul 6, 2025
3882692
Change extracter etc to extract, update, insert. Change related kwarg…
emstoudenmire Jul 6, 2025
ad874a5
Fix line of code in time_evolve
emstoudenmire Jul 6, 2025
4a5f686
Merge branch 'network_solvers' of https://github.com/ITensor/ITensorN…
emstoudenmire Jul 6, 2025
ba9c1ef
Commit fitting code and test
emstoudenmire Jul 7, 2025
33d037a
Update ITensorNetworks compat in Project.toml files
emstoudenmire Jul 8, 2025
80cb696
Rename file
emstoudenmire Jul 9, 2025
558f326
Fix error in determining exponents. Change many variable names to mor…
emstoudenmire Jul 9, 2025
fc5c4e8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 10, 2025
a5247f4
Merge branch 'main' into network_solvers
mtfishman Jul 21, 2025
c79e834
Remove ITensors.state from using statement
emstoudenmire Jul 25, 2025
72c87cc
Rename test file
emstoudenmire Jul 25, 2025
97e7c06
Merge branch 'main' into network_solvers
emstoudenmire Aug 7, 2025
96cb182
Simplify Runge Kutta solver
emstoudenmire Aug 15, 2025
9c67d05
Merge remote-tracking branch 'origin/network_solvers' into network_so…
emstoudenmire Aug 15, 2025
1a20572
Rename files
emstoudenmire Aug 15, 2025
287f0b4
Define AbstractProblem. Work on saving max truncerror
emstoudenmire Aug 15, 2025
c5e3949
Remove unused subspace.jl file
emstoudenmire Aug 17, 2025
7e76c6e
Set current_exponent before starting calculation
emstoudenmire Aug 17, 2025
b47ed54
Minor naming improvement
emstoudenmire Aug 18, 2025
32626ef
Split applyexp function to allow passing custom problem
emstoudenmire Aug 18, 2025
999206b
Use Accessors.@set to simplify some code
emstoudenmire Aug 18, 2025
f75d122
Remove sweep_printer and just use sweep_callback
emstoudenmire Aug 18, 2025
f750ac1
Allow subspace parameters to be arrays
emstoudenmire Aug 27, 2025
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
6 changes: 5 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name = "ITensorNetworks"
uuid = "2919e153-833c-4bdc-8836-1ea460a35fc7"
authors = ["Matthew Fishman <mfishman@flatironinstitute.org>, Joseph Tindall <jtindall@flatironinstitute.org> and contributors"]
version = "0.13.16"
version = "0.14.0"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
DataGraphs = "b5a273c3-7e6c-41f6-98bd-8d7f1525a36a"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
Expand Down Expand Up @@ -50,9 +52,11 @@ ITensorNetworksTensorOperationsExt = "TensorOperations"

[compat]
AbstractTrees = "0.4.4"
Accessors = "0.1.42"
Adapt = "4"
Combinatorics = "1"
Compat = "3, 4"
ConstructionBase = "1.6.0"
DataGraphs = "0.2.3"
DataStructures = "0.18, 0.19"
Dictionaries = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"

[compat]
Documenter = "1.10.0"
ITensorNetworks = "0.13.0"
ITensorNetworks = "0.14.0"
Literate = "2.20.1"
2 changes: 1 addition & 1 deletion examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7"

[compat]
ITensorNetworks = "0.13.2"
ITensorNetworks = "0.14.0"
41 changes: 24 additions & 17 deletions src/ITensorNetworks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ include("formnetworks/quadraticformnetwork.jl")
include("gauging.jl")
include("utils.jl")
include("update_observer.jl")
include("solvers/local_solvers/eigsolve.jl")
include("solvers/local_solvers/exponentiate.jl")
include("solvers/local_solvers/dmrg_x.jl")
include("solvers/local_solvers/contract.jl")
include("solvers/local_solvers/linsolve.jl")

include("treetensornetworks/abstracttreetensornetwork.jl")
include("treetensornetworks/treetensornetwork.jl")
include("treetensornetworks/opsum_to_ttn/matelem.jl")
Expand All @@ -48,18 +44,29 @@ include("treetensornetworks/projttns/abstractprojttn.jl")
include("treetensornetworks/projttns/projttn.jl")
include("treetensornetworks/projttns/projttnsum.jl")
include("treetensornetworks/projttns/projouterprodttn.jl")
include("solvers/solver_utils.jl")
include("solvers/defaults.jl")
include("solvers/insert/insert.jl")
include("solvers/extract/extract.jl")
include("solvers/alternating_update/alternating_update.jl")
include("solvers/alternating_update/region_update.jl")
include("solvers/tdvp.jl")
include("solvers/dmrg.jl")
include("solvers/dmrg_x.jl")
include("solvers/contract.jl")
include("solvers/linsolve.jl")
include("solvers/sweep_plans/sweep_plans.jl")

include("solvers/local_solvers/eigsolve.jl")
include("solvers/local_solvers/exponentiate.jl")
include("solvers/local_solvers/runge_kutta.jl")
include("solvers/truncation_parameters.jl")
include("solvers/iterators.jl")
include("solvers/adapters.jl")
include("solvers/sweep_solve.jl")
include("solvers/region_plans/dfs_plans.jl")
include("solvers/region_plans/euler_tour.jl")
include("solvers/region_plans/euler_plans.jl")
include("solvers/region_plans/tdvp_region_plans.jl")
include("solvers/extract.jl")
include("solvers/insert.jl")
include("solvers/subspace/subspace.jl")
include("solvers/subspace/densitymatrix.jl")
include("solvers/align_indices.jl")
include("solvers/operator_map.jl")
include("solvers/abstract_problem.jl")
include("solvers/eigsolve.jl")
include("solvers/applyexp.jl")
include("solvers/fitting.jl")

include("apply.jl")
include("inner.jl")
include("normalize.jl")
Expand Down
4 changes: 2 additions & 2 deletions src/itensornetwork.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using DataGraphs: DataGraphs, DataGraph
using Dictionaries: Indices, dictionary
using ITensors: ITensors, ITensor, op, state
using ITensors: ITensors, ITensor, op
using .ITensorsExtensions: trivial_space
using NamedGraphs: NamedGraphs, NamedEdge, NamedGraph, vertextype

Expand Down Expand Up @@ -180,7 +180,7 @@ function generic_state(x::Op, inds::NamedTuple)
end
function generic_state(s::AbstractString, inds::NamedTuple)
# TODO: Figure out what to do if there is more than one site.
site_tensors = [state(s, only(inds.siteinds))]
site_tensors = [ITensors.state(s, only(inds.siteinds))]
link_tensors = [[onehot(i => 1) for i in inds.linkinds[e]] for e in keys(inds.linkinds)]
return contract(reduce(vcat, link_tensors; init=site_tensors))
end
Expand Down
4 changes: 4 additions & 0 deletions src/solvers/abstract_problem.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

abstract type AbstractProblem end

set_truncation_info(P::AbstractProblem, args...; kws...) = P
32 changes: 32 additions & 0 deletions src/solvers/adapters.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

#
# TupleRegionIterator
#
# Adapts outputs to be (region, region_kwargs) tuples
#
# More generic design? maybe just assuming RegionIterator
# or its outputs implement some interface function that
# generates each tuple?
#

mutable struct TupleRegionIterator{RegionIter}
Copy link
Member

@mtfishman mtfishman Jul 2, 2025

Choose a reason for hiding this comment

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

Maybe we can come up with a name that is more descriptive, like RegionIteratorWithKwargs. Tuple is a bit vague.

region_iterator::RegionIter
end

region_iterator(T::TupleRegionIterator) = T.region_iterator

function Base.iterate(T::TupleRegionIterator, which=1)
state = iterate(region_iterator(T), which)
isnothing(state) && return nothing
(current_region, region_kwargs) = current_region_plan(region_iterator(T))
return (current_region, region_kwargs), last(state)
end

"""
region_tuples(R::RegionIterator)

The `region_tuples` adapter converts a RegionIterator into an
iterator which outputs a tuple of the form (current_region, current_region_kwargs)
at each step.
"""
region_tuples(R::RegionIterator) = TupleRegionIterator(R)
16 changes: 16 additions & 0 deletions src/solvers/align_indices.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

function align_indices(tn)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
function align_indices(tn)
function align_inds(tn)

since in general ITensor indices are referred to as inds in function names.

si = siteinds(tn)
ptn = copy(tn)
for v in vertices(tn)
is = inds(tn[v])
ls = setdiff(is, si[v])
isempty(ls) && continue
new_is = [first(ls), si[v]...]
if length(ls) >= 2
new_is = vcat(new_is, ls[2:end])
end
ptn[v] = permute(tn[v], new_is)
end
return ptn
end
143 changes: 0 additions & 143 deletions src/solvers/alternating_update/alternating_update.jl

This file was deleted.

77 changes: 0 additions & 77 deletions src/solvers/alternating_update/region_update.jl

This file was deleted.

Loading