Skip to content
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

[ITensors] Excise ITensors.ITensorMPS #1551

Merged
merged 22 commits into from
Oct 25, 2024
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
1 change: 0 additions & 1 deletion .github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
package:
- {user: ITensor, repo: ITensorGaussianMPS.jl}
- {user: ITensor, repo: ITensorMPS.jl}
- {user: ITensor, repo: ITensorTDVP.jl}
- {user: ITensor, repo: ITensorUnicodePlots.jl}
- {user: ITensor, repo: ITensorVisualizationBase.jl}

Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/test_itensormps_ubuntu.yml

This file was deleted.

16 changes: 1 addition & 15 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ITensors"
uuid = "9136182c-28ba-11e9-034c-db9fb085ebd5"
authors = ["Matthew Fishman <[email protected]>", "Miles Stoudenmire <[email protected]>"]
version = "0.6.23"
version = "0.7.0"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand All @@ -12,11 +12,8 @@ Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
IsApprox = "28f27b66-4bd8-47e7-9110-e2746eb8bed7"
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearMaps = "7a12625a-238d-50fd-b39a-03d52299707e"
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
PackageExtensionCompat = "65ce6f38-6b18-4e1d-a461-8949797d7930"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand All @@ -31,15 +28,11 @@ Zeros = "bd1ec220-6eb4-527a-9b49-e79c3db6233b"

[weakdeps]
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
Observers = "338f10d5-c7f1-4033-a7d1-f9dec39bcaa0"
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8"
ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"

[extensions]
ITensorsHDF5Ext = "HDF5"
ITensorsObserversExt = "Observers"
ITensorsPackageCompilerExt = "PackageCompiler"
ITensorsVectorInterfaceExt = "VectorInterface"
ITensorsZygoteRulesExt = "ZygoteRules"

Expand All @@ -53,13 +46,8 @@ DocStringExtensions = "0.9.3"
Functors = "0.2, 0.3, 0.4"
HDF5 = "0.14, 0.15, 0.16, 0.17"
IsApprox = "0.1, 1, 2"
KrylovKit = "0.4.2, 0.5, 0.6, 0.7, 0.8"
LinearAlgebra = "1.6"
LinearMaps = "3"
NDTensors = "0.3.34"
Observers = "0.2"
PackageCompiler = "1, 2"
PackageExtensionCompat = "1"
Pkg = "1.6"
Printf = "1.6"
Random = "1.6"
Expand All @@ -78,7 +66,5 @@ julia = "1.10"
[extras]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
Observers = "338f10d5-c7f1-4033-a7d1-f9dec39bcaa0"
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8"
ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Strided = "5e0ebb24-38b0-5f93-81fe-25c709ecae67"

Expand Down
8 changes: 7 additions & 1 deletion docs/settings.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
using Documenter
using ITensors
using ITensorMPS

# Allows using ITensorMPS.jl docstrings in ITensors.jl documentation:
# https://github.com/JuliaDocs/Documenter.jl/issues/1734
DocMeta.setdocmeta!(ITensors, :DocTestSetup, :(using ITensors); recursive=true)
DocMeta.setdocmeta!(ITensorMPS, :DocTestSetup, :(using ITensorMPS); recursive=true)

sitename = "ITensors.jl"

settings = Dict(
:modules => [ITensors],
# Allows using ITensorMPS.jl docstrings in ITensors.jl documentation:
# https://github.com/JuliaDocs/Documenter.jl/issues/1734
:modules => [ITensors, ITensorMPS],
:pages => [
"Introduction" => "index.md",
"Getting Started with ITensor" => [
Expand Down
138 changes: 69 additions & 69 deletions docs/src/MPSandMPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,125 +32,125 @@ MPO(::Type{<:Number}, ::Vector{<:Index}, ::String)
## Copying behavior

```@docs
copy(::ITensors.AbstractMPS)
deepcopy(::ITensors.AbstractMPS)
copy(::ITensorMPS.AbstractMPS)
deepcopy(::ITensorMPS.AbstractMPS)
```

## Properties

```@docs
eltype(::ITensors.AbstractMPS)
flux(::ITensors.AbstractMPS)
hasqns(::ITensors.AbstractMPS)
length(::ITensors.AbstractMPS)
maxlinkdim(::ITensors.AbstractMPS)
eltype(::ITensorMPS.AbstractMPS)
flux(::ITensorMPS.AbstractMPS)
hasqns(::ITensorMPS.AbstractMPS)
length(::ITensorMPS.AbstractMPS)
maxlinkdim(::ITensorMPS.AbstractMPS)
```

## Obtaining and finding indices

```@docs
siteinds(::typeof(commoninds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS, ::Int)
siteinds(::typeof(uniqueinds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS, ::Int)
siteinds(::typeof(commoninds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS, ::Int)
siteinds(::typeof(uniqueinds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS, ::Int)
findsite
findsites
firstsiteinds
linkind(::ITensors.AbstractMPS,::Int)
linkind(::ITensorMPS.AbstractMPS,::Int)
siteind(::MPS, ::Int)
siteind(::typeof(first), ::MPS, ::Int)
siteinds(::MPS)
siteind(::MPO, ::Int)
siteinds(::MPO)
siteinds(::ITensors.AbstractMPS, ::Int)
siteinds(::ITensorMPS.AbstractMPS, ::Int)
```

## Priming and tagging

```@docs
prime(::ITensors.AbstractMPS)
prime(::typeof(siteinds), ::ITensors.AbstractMPS)
prime(::typeof(linkinds), ::ITensors.AbstractMPS)
prime(::typeof(siteinds), ::typeof(commoninds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)
prime(::typeof(siteinds), ::typeof(uniqueinds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)

swapprime(::ITensors.AbstractMPS, args...; kwargs...)

setprime(::ITensors.AbstractMPS)
setprime(::typeof(siteinds), ::ITensors.AbstractMPS)
setprime(::typeof(linkinds), ::ITensors.AbstractMPS)
setprime(::typeof(siteinds), ::typeof(commoninds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)
setprime(::typeof(siteinds), ::typeof(uniqueinds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)

noprime(::ITensors.AbstractMPS)
noprime(::typeof(siteinds), ::ITensors.AbstractMPS)
noprime(::typeof(linkinds), ::ITensors.AbstractMPS)
noprime(::typeof(siteinds), ::typeof(commoninds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)
noprime(::typeof(siteinds), ::typeof(uniqueinds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)

addtags(::ITensors.AbstractMPS)
addtags(::typeof(siteinds), ::ITensors.AbstractMPS)
addtags(::typeof(linkinds), ::ITensors.AbstractMPS)
addtags(::typeof(siteinds), ::typeof(commoninds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)
addtags(::typeof(siteinds), ::typeof(uniqueinds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)

removetags(::ITensors.AbstractMPS)
removetags(::typeof(siteinds), ::ITensors.AbstractMPS)
removetags(::typeof(linkinds), ::ITensors.AbstractMPS)
removetags(::typeof(siteinds), ::typeof(commoninds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)
removetags(::typeof(siteinds), ::typeof(uniqueinds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)

replacetags(::ITensors.AbstractMPS)
replacetags(::typeof(siteinds), ::ITensors.AbstractMPS)
replacetags(::typeof(linkinds), ::ITensors.AbstractMPS)
replacetags(::typeof(siteinds), ::typeof(commoninds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)
replacetags(::typeof(siteinds), ::typeof(uniqueinds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)

settags(::ITensors.AbstractMPS)
settags(::typeof(siteinds), ::ITensors.AbstractMPS)
settags(::typeof(linkinds), ::ITensors.AbstractMPS)
settags(::typeof(siteinds), ::typeof(commoninds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)
settags(::typeof(siteinds), ::typeof(uniqueinds), ::ITensors.AbstractMPS, ::ITensors.AbstractMPS)
prime(::ITensorMPS.AbstractMPS)
prime(::typeof(siteinds), ::ITensorMPS.AbstractMPS)
prime(::typeof(linkinds), ::ITensorMPS.AbstractMPS)
prime(::typeof(siteinds), ::typeof(commoninds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)
prime(::typeof(siteinds), ::typeof(uniqueinds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)

swapprime(::ITensorMPS.AbstractMPS, args...; kwargs...)

setprime(::ITensorMPS.AbstractMPS)
setprime(::typeof(siteinds), ::ITensorMPS.AbstractMPS)
setprime(::typeof(linkinds), ::ITensorMPS.AbstractMPS)
setprime(::typeof(siteinds), ::typeof(commoninds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)
setprime(::typeof(siteinds), ::typeof(uniqueinds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)

noprime(::ITensorMPS.AbstractMPS)
noprime(::typeof(siteinds), ::ITensorMPS.AbstractMPS)
noprime(::typeof(linkinds), ::ITensorMPS.AbstractMPS)
noprime(::typeof(siteinds), ::typeof(commoninds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)
noprime(::typeof(siteinds), ::typeof(uniqueinds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)

addtags(::ITensorMPS.AbstractMPS)
addtags(::typeof(siteinds), ::ITensorMPS.AbstractMPS)
addtags(::typeof(linkinds), ::ITensorMPS.AbstractMPS)
addtags(::typeof(siteinds), ::typeof(commoninds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)
addtags(::typeof(siteinds), ::typeof(uniqueinds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)

removetags(::ITensorMPS.AbstractMPS)
removetags(::typeof(siteinds), ::ITensorMPS.AbstractMPS)
removetags(::typeof(linkinds), ::ITensorMPS.AbstractMPS)
removetags(::typeof(siteinds), ::typeof(commoninds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)
removetags(::typeof(siteinds), ::typeof(uniqueinds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)

replacetags(::ITensorMPS.AbstractMPS)
replacetags(::typeof(siteinds), ::ITensorMPS.AbstractMPS)
replacetags(::typeof(linkinds), ::ITensorMPS.AbstractMPS)
replacetags(::typeof(siteinds), ::typeof(commoninds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)
replacetags(::typeof(siteinds), ::typeof(uniqueinds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)

settags(::ITensorMPS.AbstractMPS)
settags(::typeof(siteinds), ::ITensorMPS.AbstractMPS)
settags(::typeof(linkinds), ::ITensorMPS.AbstractMPS)
settags(::typeof(siteinds), ::typeof(commoninds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)
settags(::typeof(siteinds), ::typeof(uniqueinds), ::ITensorMPS.AbstractMPS, ::ITensorMPS.AbstractMPS)
```

## Operations

```@docs
expect(::MPS, ::Any)
correlation_matrix(::MPS, ::AbstractString, ::AbstractString)
dag(::ITensors.AbstractMPS)
dense(::ITensors.AbstractMPS)
movesite(::ITensors.AbstractMPS, ::Pair{Int, Int};orthocenter::Int,kwargs...)
dag(::ITensorMPS.AbstractMPS)
dense(::ITensorMPS.AbstractMPS)
movesite(::ITensorMPS.AbstractMPS, ::Pair{Int, Int};orthocenter::Int,kwargs...)
orthogonalize!
replacebond!(::MPS, ::Int, ::ITensor)
sample(::MPS)
sample!(::MPS)
sample(::MPO)
swapbondsites(::ITensors.AbstractMPS, ::Int; kwargs...)
swapbondsites(::ITensorMPS.AbstractMPS, ::Int; kwargs...)
truncate!
```

## Gate evolution

```@docs
product(::ITensor, ::ITensors.AbstractMPS)
product(::Vector{ITensor}, ::ITensors.AbstractMPS)
product(::ITensor, ::ITensorMPS.AbstractMPS)
product(::Vector{ITensor}, ::ITensorMPS.AbstractMPS)
```

## Algebra Operations

```@docs
inner(::MPST, ::MPST) where {MPST <: ITensors.AbstractMPS}
dot(::MPST, ::MPST) where {MPST <: ITensors.AbstractMPS}
loginner(::MPST, ::MPST) where {MPST <: ITensors.AbstractMPS}
logdot(::MPST, ::MPST) where {MPST <: ITensors.AbstractMPS}
inner(::MPST, ::MPST) where {MPST <: ITensorMPS.AbstractMPS}
dot(::MPST, ::MPST) where {MPST <: ITensorMPS.AbstractMPS}
loginner(::MPST, ::MPST) where {MPST <: ITensorMPS.AbstractMPS}
logdot(::MPST, ::MPST) where {MPST <: ITensorMPS.AbstractMPS}
inner(::MPS, ::MPO, ::MPS)
dot(::MPS, ::MPO, ::MPS)
inner(::MPO, ::MPS, ::MPO, ::MPS)
dot(::MPO, ::MPS, ::MPO, ::MPS)
norm(::ITensors.AbstractMPS)
normalize(::ITensors.AbstractMPS)
normalize!(::ITensors.AbstractMPS)
lognorm(::ITensors.AbstractMPS)
+(::ITensors.AbstractMPS...)
norm(::ITensorMPS.AbstractMPS)
normalize(::ITensorMPS.AbstractMPS)
normalize!(::ITensorMPS.AbstractMPS)
lognorm(::ITensorMPS.AbstractMPS)
+(::ITensorMPS.AbstractMPS...)
contract(::MPO, ::MPS)
apply(::MPO, ::MPS)
contract(::MPO, ::MPO)
Expand Down
4 changes: 3 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Development of ITensor is supported by the Flatiron Institute, a division of the

## News

- October 24, 2024: ITensors.jl v0.7 has been released. This is a major breaking change, since all of the MPS/MPO functionality from this package has been moved to [ITensorMPS.jl](https://github.com/ITensor/ITensorMPS.jl), along with all of the functionality of [ITensorTDVP.jl](https://github.com/ITensor/ITensorTDVP.jl). If you want to use MPS/MPO types and related functionality, such as `MPS`, `MPO`, `dmrg`, `siteinds`, `OpSum`, `op`, etc. you now must install and load the ITensorMPS.jl package. Additionally, if you are using ITensorTDVP.jl in your code, please change `using ITensorTDVP` to `using ITensorMPS`. ITensorMPS.jl has all of the same functionality as ITensorTDVP.jl, and ITensorTDVP.jl will be deprecated in favor of ITensorMPS.jl. **Note:** If you are using `ITensors.compile`, you must now install and load the ITensorMPS.jl package in order to trigger it to load properly, since it relies on running MPS/MPO functionality as example code for Julia to compile.

- May 9, 2024: A new package [ITensorMPS.jl](https://github.com/ITensor/ITensorMPS.jl) has been released. We plan to move all of the MPS/MPO functionality in [ITensors.jl](https://github.com/ITensor/ITensors.jl) to [ITensorMPS.jl](https://github.com/ITensor/ITensorMPS.jl). For now, ITensorMPS.jl just re-exports the MPS/MPO functionality of ITensors.jl (as well as of [ITensorTDVP.jl](https://github.com/ITensor/ITensorTDVP.jl)), such as `dmrg`, `siteinds`, `MPS`, `MPO`, etc. To prepare for the change over to ITensorMPS.jl, please change `using ITensors` to `using ITensors, ITensorMPS` in any code that makes use of MPS/MPO functionality, and if you are using ITensorTDVP.jl change `using ITensorTDVP` to `using ITensorMPS` in your code.

- May 8, 2024: ITensors.jl v0.6 has been released. This version deletes the experimental "combine-contract" contraction backend, which was enabled by `ITensors.enable_combine_contract()`. This feature enabled performing ITensor contractions by first combining indices and then performing contractions as matrix multiplications, which potentially could lead to speedups for certain contractions involving higher-order QN-conserving tensors. However, the speedups weren't consistent with the current implementation, and this feature will be incorporated into the library in a more systematic way when we release our new non-abelian symmetric tensor backend.
Expand Down Expand Up @@ -321,5 +323,5 @@ After sweep 4 energy=-138.940086009318 maxlinkdim=100 maxerr=1.05E-10 time=11.64
After sweep 5 energy=-138.940086058840 maxlinkdim=96 maxerr=1.00E-10 time=12.771
Final energy = -138.94008605883985
```
You can find more examples of running `dmrg` and related algorithms [here](https://github.com/ITensor/ITensors.jl/tree/main/src/lib/ITensorMPS/examples).
You can find more examples of running `dmrg` and related algorithms [here](https://github.com/ITensor/ITensorMPS.jl/tree/main/examples).

1 change: 0 additions & 1 deletion ext/ITensorsChainRulesCoreExt/ITensorsChainRulesCoreExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ include("indexset.jl")
include("itensor.jl")
include("LazyApply/LazyApply.jl")
include("non_differentiable.jl")
include("itensormps.jl")
include("smallstrings.jl")
end
12 changes: 0 additions & 12 deletions ext/ITensorsChainRulesCoreExt/itensormps.jl

This file was deleted.

Loading
Loading