Skip to content

Minor cleanup of internals #91

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

Merged
merged 6 commits into from
Feb 18, 2025
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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ITensorInfiniteMPS"
uuid = "1dc1fb26-a137-4954-ae60-1bd4106e95ad"
authors = ["Matthew Fishman <[email protected]> and contributors"]
version = "0.1.0"
version = "0.2.0"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand All @@ -20,7 +20,7 @@ SplitApplyCombine = "03a91e81-4c3e-53e1-a0a4-9c0c8f19dd66"
Compat = "3, 4"
HDF5 = "0.15, 0.16, 0.17"
ITensorMPS = "0.3"
ITensors = "0.7"
ITensors = "0.7, 0.8"
Infinities = "0.1"
IterTools = "1"
KrylovKit = "0.5, 0.6, 0.7, 0.8"
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,32 @@ This package is a work in progress. Here are some examples of the interface:
julia> using ITensors, ITensorMPS, ITensorInfiniteMPS

julia> s = siteinds("S=1/2", 3)
3-element Array{Index{Int64},1}:
(dim=2|id=652|"S=1/2,Site,n=1")
(dim=2|id=984|"S=1/2,Site,n=2")
(dim=2|id=569|"S=1/2,Site,n=3")
3-element Vector{Index{Int64}}:
(dim=2|id=988|"S=1/2,Site,n=1")
(dim=2|id=220|"S=1/2,Site,n=2")
(dim=2|id=650|"S=1/2,Site,n=3")

julia> ψ = InfiniteMPS(s) # Infinite MPS with 3-site unit cell
InfiniteMPS
[1] IndexSet{3} (dim=1|id=317|"Link,c=0,l=3") (dim=2|id=652|"S=1/2,Site,c=1,n=1") (dim=1|id=77|"Link,c=1,l=1")
[2] IndexSet{3} (dim=1|id=77|"Link,c=1,l=1") (dim=2|id=984|"S=1/2,Site,c=1,n=2") (dim=1|id=868|"Link,c=1,l=2")
[3] IndexSet{3} (dim=1|id=868|"Link,c=1,l=2") (dim=2|id=569|"S=1/2,Site,c=1,n=3") (dim=1|id=317|"Link,c=1,l=3")

[1] ((dim=1|id=108|"Link,c=0,l=3"), (dim=2|id=988|"S=1/2,Site,c=1,n=1"), (dim=1|id=112|"Link,c=1,l=1"))
[2] ((dim=1|id=112|"Link,c=1,l=1"), (dim=2|id=220|"S=1/2,Site,c=1,n=2"), (dim=1|id=429|"Link,c=1,l=2"))
[3] ((dim=1|id=429|"Link,c=1,l=2"), (dim=2|id=650|"S=1/2,Site,c=1,n=3"), (dim=1|id=108|"Link,c=1,l=3"))

julia> ψ[2] == replacetags(ψ[5], "c=2" => "c=1") # Indexing outside of the unit cell gets tensors from other unit cells
true

julia> ψ₁ = ψ[1:3] # Create a finite MPS from the tensors of the first unit cell
MPS
[1] IndexSet{3} (dim=1|id=317|"Link,c=0,l=3") (dim=2|id=652|"S=1/2,Site,c=1,n=1") (dim=1|id=77|"Link,c=1,l=1")
[2] IndexSet{3} (dim=1|id=77|"Link,c=1,l=1") (dim=2|id=984|"S=1/2,Site,c=1,n=2") (dim=1|id=868|"Link,c=1,l=2")
[3] IndexSet{3} (dim=1|id=868|"Link,c=1,l=2") (dim=2|id=569|"S=1/2,Site,c=1,n=3") (dim=1|id=317|"Link,c=1,l=3")
[1] ((dim=1|id=108|"Link,c=0,l=3"), (dim=2|id=988|"S=1/2,Site,c=1,n=1"), (dim=1|id=112|"Link,c=1,l=1"))
[2] ((dim=1|id=112|"Link,c=1,l=1"), (dim=2|id=220|"S=1/2,Site,c=1,n=2"), (dim=1|id=429|"Link,c=1,l=2"))
[3] ((dim=1|id=429|"Link,c=1,l=2"), (dim=2|id=650|"S=1/2,Site,c=1,n=3"), (dim=1|id=108|"Link,c=1,l=3"))


julia> ψ₂ = ψ[4:6] # Create a finite MPS from the tensors of the second unit cell
MPS
[1] IndexSet{3} (dim=1|id=317|"Link,c=1,l=3") (dim=2|id=652|"S=1/2,Site,c=2,n=1") (dim=1|id=77|"Link,c=2,l=1")
[2] IndexSet{3} (dim=1|id=77|"Link,c=2,l=1") (dim=2|id=984|"S=1/2,Site,c=2,n=2") (dim=1|id=868|"Link,c=2,l=2")
[3] IndexSet{3} (dim=1|id=868|"Link,c=2,l=2") (dim=2|id=569|"S=1/2,Site,c=2,n=3") (dim=1|id=317|"Link,c=2,l=3")
[1] ((dim=1|id=108|"Link,c=1,l=3"), (dim=2|id=988|"S=1/2,Site,c=2,n=1"), (dim=1|id=112|"Link,c=2,l=1"))
[2] ((dim=1|id=112|"Link,c=2,l=1"), (dim=2|id=220|"S=1/2,Site,c=2,n=2"), (dim=1|id=429|"Link,c=2,l=2"))
[3] ((dim=1|id=429|"Link,c=2,l=2"), (dim=2|id=650|"S=1/2,Site,c=2,n=3"), (dim=1|id=108|"Link,c=2,l=3"))
```
Useful operations like gauging and optimization are in progress, so stay tuned!

Expand Down
2 changes: 0 additions & 2 deletions src/ITensorInfiniteMPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ using ITensorMPS: AbstractMPS
import ITensors: ⊕

include("ITensors.jl")
include("ITensorNetworks.jl")
include("itensormap.jl")
include("celledvectors.jl")
include("abstractinfinitemps.jl")
Expand Down Expand Up @@ -61,7 +60,6 @@ export Cell,
InfiniteBlockMPO,
InfiniteSumLocalOps,
ITensorMap,
ITensorNetwork,
TransferMatrix,
@Model_str,
Model,
Expand Down
Loading
Loading