diff --git a/Project.toml b/Project.toml index 080d789e..e0429fa7 100644 --- a/Project.toml +++ b/Project.toml @@ -6,6 +6,7 @@ version = "0.1.0" [deps] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" +ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2" ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" Infinities = "e1ba4f0e-776d-440f-acd9-e1d2e9742647" IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e" @@ -13,19 +14,18 @@ KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" -Requires = "ae029012-a4dd-5104-9daa-d747884805df" SplitApplyCombine = "03a91e81-4c3e-53e1-a0a4-9c0c8f19dd66" [compat] Compat = "3, 4" -HDF5 = "0.15, 0.16" -ITensors = "0.3.48" +HDF5 = "0.15, 0.16, 0.17" +ITensorMPS = "0.1" +ITensors = "0.3.48, 0.4, 0.5, 0.6" Infinities = "0.1" IterTools = "1" -KrylovKit = "0.5, 0.6" +KrylovKit = "0.5, 0.6, 0.7" OffsetArrays = "1" QuadGK = "2" -Requires = "1" SplitApplyCombine = "1.2.2" julia = "1.6" diff --git a/README.md b/README.md index 78b24494..b5f064cb 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ julia> using Pkg; Pkg.add(url="https://github.com/mtfishman/ITensorInfiniteMPS.j This package is a work in progress. Here are some examples of the interface: ```julia -julia> using ITensors, ITensorInfiniteMPS +julia> using ITensors, ITensorMPS, ITensorInfiniteMPS julia> s = siteinds("S=1/2", 3) 3-element Array{Index{Int64},1}: diff --git a/examples/development/finite_mps_to_infinite_mps.jl b/examples/development/finite_mps_to_infinite_mps.jl index 01fe041a..4fbea42f 100644 --- a/examples/development/finite_mps_to_infinite_mps.jl +++ b/examples/development/finite_mps_to_infinite_mps.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS # H = -J Σⱼ XⱼXⱼ₊₁ - h Σⱼ Zⱼ diff --git a/examples/development/orthogonalize_infinitemps.jl b/examples/development/orthogonalize_infinitemps.jl index 273b1cfb..101ce85e 100644 --- a/examples/development/orthogonalize_infinitemps.jl +++ b/examples/development/orthogonalize_infinitemps.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Random diff --git a/examples/development/vumps/transfer_matrix_spectrum_arpack.jl b/examples/development/vumps/transfer_matrix_spectrum_arpack.jl index b7c65daf..b4694b59 100644 --- a/examples/development/vumps/transfer_matrix_spectrum_arpack.jl +++ b/examples/development/vumps/transfer_matrix_spectrum_arpack.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS ############################################################################## diff --git a/examples/development/vumps/vumps_from_dmrg.jl b/examples/development/vumps/vumps_from_dmrg.jl index 5dd6a202..cbf42e92 100644 --- a/examples/development/vumps/vumps_from_dmrg.jl +++ b/examples/development/vumps/vumps_from_dmrg.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Random diff --git a/examples/development/vumps/vumps_ising_noncontiguous.jl b/examples/development/vumps/vumps_ising_noncontiguous.jl index 032a9a2e..a7787d58 100644 --- a/examples/development/vumps/vumps_ising_noncontiguous.jl +++ b/examples/development/vumps/vumps_ising_noncontiguous.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS ############################################################################## diff --git a/examples/development/vumps/vumps_localham.jl b/examples/development/vumps/vumps_localham.jl index 14ff15ce..c9598c22 100644 --- a/examples/development/vumps/vumps_localham.jl +++ b/examples/development/vumps/vumps_localham.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Random diff --git a/examples/development/vumps/vumps_localham_qns.jl b/examples/development/vumps/vumps_localham_qns.jl index b83ea29d..5c5c434e 100644 --- a/examples/development/vumps/vumps_localham_qns.jl +++ b/examples/development/vumps/vumps_localham_qns.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Random diff --git a/examples/development/vumps/vumps_mpo.jl b/examples/development/vumps/vumps_mpo.jl index acfa204c..e2150d7c 100644 --- a/examples/development/vumps/vumps_mpo.jl +++ b/examples/development/vumps/vumps_mpo.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Random diff --git a/examples/vumps/src/entropy.jl b/examples/vumps/src/entropy.jl index 8c740707..767bbb41 100644 --- a/examples/vumps/src/entropy.jl +++ b/examples/vumps/src/entropy.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS # calculate -\sum_i rho_i log(rho_i) diff --git a/examples/vumps/src/vumps_subspace_expansion.jl b/examples/vumps/src/vumps_subspace_expansion.jl index 658425b9..8468afd0 100644 --- a/examples/vumps/src/vumps_subspace_expansion.jl +++ b/examples/vumps/src/vumps_subspace_expansion.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS # Alternate steps of running TDVP and increasing the bond dimension. diff --git a/examples/vumps/transfer_matrix_spectrum.jl b/examples/vumps/transfer_matrix_spectrum.jl index ed6a4e43..881da749 100644 --- a/examples/vumps/transfer_matrix_spectrum.jl +++ b/examples/vumps/transfer_matrix_spectrum.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS include( diff --git a/examples/vumps/vumps_2d_heisenberg.jl b/examples/vumps/vumps_2d_heisenberg.jl index 0d188473..968606d0 100644 --- a/examples/vumps/vumps_2d_heisenberg.jl +++ b/examples/vumps/vumps_2d_heisenberg.jl @@ -1,5 +1,5 @@ using ITensorInfiniteMPS -using ITensors +using ITensors, ITensorMPS include( joinpath( diff --git a/examples/vumps/vumps_heisenberg.jl b/examples/vumps/vumps_heisenberg.jl index d2842a65..d9da157f 100644 --- a/examples/vumps/vumps_heisenberg.jl +++ b/examples/vumps/vumps_heisenberg.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS include( diff --git a/examples/vumps/vumps_hubbard_extended.jl b/examples/vumps/vumps_hubbard_extended.jl index 8994c73e..b28e6bc9 100644 --- a/examples/vumps/vumps_hubbard_extended.jl +++ b/examples/vumps/vumps_hubbard_extended.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS base_path = joinpath(pkgdir(ITensorInfiniteMPS), "examples", "vumps", "src") diff --git a/examples/vumps/vumps_ising.jl b/examples/vumps/vumps_ising.jl index bd24e713..6af5ca9d 100644 --- a/examples/vumps/vumps_ising.jl +++ b/examples/vumps/vumps_ising.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS base_path = joinpath(pkgdir(ITensorInfiniteMPS), "examples", "vumps", "src") diff --git a/examples/vumps/vumps_ising_extended.jl b/examples/vumps/vumps_ising_extended.jl index ed4af6f9..cafd12a0 100644 --- a/examples/vumps/vumps_ising_extended.jl +++ b/examples/vumps/vumps_ising_extended.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS include( diff --git a/src/ITensorInfiniteMPS.jl b/src/ITensorInfiniteMPS.jl index c1af600a..1a2a7e9d 100644 --- a/src/ITensorInfiniteMPS.jl +++ b/src/ITensorInfiniteMPS.jl @@ -1,10 +1,7 @@ module ITensorInfiniteMPS - # For `only`, which was introduced in Julia v1.4 using Compat -using ITensors -# For optional ITensorsVisualization dependency. -using Requires +using ITensors, ITensorMPS # For using ∞ as lengths, ranges, etc. using Infinities # For functions like `isdiag` @@ -85,10 +82,4 @@ export Cell, ⊕, ⊗, × - -function __init__() - # This is used for debugging using visualizations - @require ITensorsVisualization = "f2aed53d-2f32-47c3-a7b9-1ee253853786" @eval using ITensorsVisualization -end - end diff --git a/src/ITensors.jl b/src/ITensors.jl index 7b60b6f6..8660fda2 100644 --- a/src/ITensors.jl +++ b/src/ITensors.jl @@ -1,3 +1,7 @@ +using ITensorMPS: MPS +using ITensors.NDTensors: NDTensors, tensor +using ITensors: ITensors, IndexSet, QN, Tag, TagSet, dag, inds, isdiag, sim +using LinearAlgebra: LinearAlgebra, eigen ############################################################################ # imports.jl @@ -131,8 +135,6 @@ ITensors.noncommoninds(is::IndexSet) = is # itensor.jl # -using ITensors.NDTensors - # Helpful for making sure the ITensor doesn't contract ITensors.sim(A::ITensor) = ITensors.setinds(A, sim(inds(A))) diff --git a/src/vumps_generic.jl b/src/vumps_generic.jl index 16d3cbb0..85d7db6b 100644 --- a/src/vumps_generic.jl +++ b/src/vumps_generic.jl @@ -1,3 +1,8 @@ +using ITensorMPS: ITensorMPS, linkinds, tdvp +using ITensors: δ, dag, noprime, prime +using ITensors.NDTensors: denseblocks +using KrylovKit: exponentiate + struct Hᶜ{T} ∑h::InfiniteSum{T} Hᴸ::InfiniteMPS @@ -151,7 +156,7 @@ function tdvp_iteration(args...; multisite_update_alg="sequential", kwargs...) end end -function tdvp( +function ITensorMPS.tdvp( solver::Function, ∑h, ψ; @@ -232,7 +237,9 @@ function vumps( ) end -function tdvp(args...; time_step, solver_tol=(x -> x / 100), eager=true, kwargs...) +function ITensorMPS.tdvp( + args...; time_step, solver_tol=(x -> x / 100), eager=true, kwargs... +) solver = if !isinf(time_step) println("Using TDVP solver with time step $time_step") flush(stdout) diff --git a/test/Project.toml b/test/Project.toml index b9fb7403..4e8c1760 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,4 +1,6 @@ [deps] +ITensorInfiniteMPS = "1dc1fb26-a137-4954-ae60-1bd4106e95ad" +ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2" ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/test/test_iMPOConversions.jl b/test/test_iMPOConversions.jl index 5f4ac39a..767f1d04 100644 --- a/test/test_iMPOConversions.jl +++ b/test/test_iMPOConversions.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Test diff --git a/test/test_itensormap.jl b/test/test_itensormap.jl index cba4dd36..ee3b0d35 100644 --- a/test/test_itensormap.jl +++ b/test/test_itensormap.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Test using Random diff --git a/test/test_readwrite.jl b/test/test_readwrite.jl index 18115c9d..c270a46a 100644 --- a/test/test_readwrite.jl +++ b/test/test_readwrite.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using ITensorInfiniteMPS.HDF5 using Test diff --git a/test/test_unitcell_qns.jl b/test/test_unitcell_qns.jl index 3102fa0e..59a23a3b 100644 --- a/test/test_unitcell_qns.jl +++ b/test/test_unitcell_qns.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Test using Random diff --git a/test/test_vumps.jl b/test/test_vumps.jl index b553fa78..ad16e497 100644 --- a/test/test_vumps.jl +++ b/test/test_vumps.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Test using Random diff --git a/test/test_vumps_extendedising.jl b/test/test_vumps_extendedising.jl index 7842cf27..a5ac2b1c 100644 --- a/test/test_vumps_extendedising.jl +++ b/test/test_vumps_extendedising.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Test using Random diff --git a/test/test_vumpsmpo.jl b/test/test_vumpsmpo.jl index 19175fdb..83583a9e 100644 --- a/test/test_vumpsmpo.jl +++ b/test/test_vumpsmpo.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Test using Random diff --git a/test/test_vumpsmpo_fqhe.jl b/test/test_vumpsmpo_fqhe.jl index e9406352..a59e8c55 100644 --- a/test/test_vumpsmpo_fqhe.jl +++ b/test/test_vumpsmpo_fqhe.jl @@ -1,4 +1,4 @@ -using ITensors +using ITensors, ITensorMPS using ITensorInfiniteMPS using Test using Random