-
Notifications
You must be signed in to change notification settings - Fork 19
Network solvers redesign #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
eef7d0f
b15d045
3edcc3d
8930d80
9235349
d70bf03
c081dfb
e5047fc
3f7442f
8ef353f
7391c0c
735fa7e
1d1dbc0
b918731
8928162
0a4db77
9abc732
7719cc2
751902c
ddafd9f
31a86d3
3882692
ad874a5
4a5f686
ba9c1ef
33d037a
80cb696
558f326
fc5c4e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
name = "ITensorNetworks" | ||
uuid = "2919e153-833c-4bdc-8836-1ea460a35fc7" | ||
authors = ["Matthew Fishman <[email protected]>, Joseph Tindall <[email protected]> and contributors"] | ||
version = "0.13.12" | ||
version = "0.14.0" | ||
|
||
[deps] | ||
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" | ||
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" | ||
|
@@ -53,6 +54,7 @@ AbstractTrees = "0.4.4" | |
Adapt = "4" | ||
Combinatorics = "1" | ||
Compat = "3, 4" | ||
ConstructionBase = "1.6.0" | ||
DataGraphs = "0.2.3" | ||
DataStructures = "0.18" | ||
Dictionaries = "0.4" | ||
|
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} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
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) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,16 @@ | ||||||
|
||||||
function align_indices(tn) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
since in general ITensor indices are referred to as |
||||||
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 |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A similar change to the function
function ITensors.apply( o, ψ::VidalITensorNetwork; ...)
lower down (lime 322) will be necessary to avoid ambiguity and the current failing test.