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

Improving infinite mpo matrix #77

Merged
merged 42 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a96ab73
Improvement on InfiniteMPO done, tests left to do
LHerviou Jun 14, 2023
4abfc79
Fixing for dense
LHerviou Jun 15, 2023
397d6e4
Apply suggestions from code review
LHerviou Jun 15, 2023
4817582
Fixing order of downloading
LHerviou Jun 15, 2023
fc72016
Fixing unconventional translations
LHerviou Jun 15, 2023
bef7ee1
Trying to fix format
LHerviou Jun 15, 2023
60191be
Initializing
LHerviou Jun 16, 2023
4c3caa3
Fixing vumps_mpo
LHerviou Jun 16, 2023
1a6a6cf
Implementation of Mat comments
LHerviou Jun 16, 2023
72e84e6
Merge pull request #250 from LHerviou/TemporaryTests
LHerviou Jun 16, 2023
1e8db7d
Working with adhoc add and multiply
LHerviou Jun 20, 2023
ca08705
Introduced propser summation for empty tensors
LHerviou Jun 20, 2023
e3965ef
Testing with newest ITensor
LHerviou Jun 26, 2023
d9bdba5
Testing the fix
LHerviou Jun 26, 2023
aafb7e2
Merge pull request #252 from LHerviou/Temp_Improving
LHerviou Jul 3, 2023
95c892c
Faster construction for long range models. There seems to be a signif…
LHerviou Jul 4, 2023
7ab8adf
Taking into account Mats comments
LHerviou Aug 23, 2023
9167704
Moved a function around, and added a convenience fuse_legs! that do t…
LHerviou Aug 23, 2023
e6988e6
Fixing format
LHerviou Aug 23, 2023
c0c586e
Removed apply_tensor from tests and add the fill! fix as it does not …
LHerviou Aug 23, 2023
ac087d9
Format test
LHerviou Aug 23, 2023
0a0849c
Merge pull request #253 from LHerviou/Temp_ImprovingInfiniteMPOMatrix
LHerviou Aug 23, 2023
e44c58a
Attempt at limiting the number of calls to translatecell
LHerviou Aug 23, 2023
5772ec9
Format
LHerviou Aug 23, 2023
0c8a6cd
Matts comments
LHerviou Aug 24, 2023
559e9c6
Fixing the test
LHerviou Aug 25, 2023
dbd351b
Merge pull request #254 from LHerviou/Temp_ImprovingInfiniteMPOMatrix
LHerviou Aug 25, 2023
334ebf4
Fixing fuse_legs!
LHerviou Aug 25, 2023
7f52678
Merge pull request #255 from LHerviou/Temp_ImprovingInfiniteMPOMatrix
LHerviou Aug 25, 2023
ad42339
Minor bug
LHerviou Aug 25, 2023
0e1d8b5
Merge pull request #256 from LHerviou/Temp_ImprovingInfiniteMPOMatrix
LHerviou Aug 25, 2023
f6b6868
Comments
LHerviou Aug 28, 2023
56b6719
Name change for InfiniteMPOMatrix to InfiniteMPOBlock
LHerviou Aug 28, 2023
bd8f653
Forgot a change in a test, and trying to see if I can remove the fill
LHerviou Aug 28, 2023
4512b02
Restablishing fill
LHerviou Aug 28, 2023
d6c00b8
Merge pull request #257 from LHerviou/Temp_ImprovingInfiniteMPOMatrix
LHerviou Aug 28, 2023
07655f3
Fixing name
LHerviou Aug 28, 2023
a4c24dc
Merge pull request #258 from LHerviou/Temp_ImprovingInfiniteMPOMatrix
LHerviou Aug 28, 2023
39ffc55
Comments + convenience
LHerviou Aug 29, 2023
ece17bc
Format
LHerviou Aug 29, 2023
4c482b2
Bug fix
LHerviou Aug 29, 2023
8da20d1
Cleaning up combineblocks
LHerviou Aug 30, 2023
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: 3 additions & 3 deletions src/ITensorInfiniteMPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ include("itensormap.jl")
include("celledvectors.jl")
include("abstractinfinitemps.jl")
include("infinitemps.jl")
include("infinitempo.jl")
include("infinitecanonicalmps.jl")
include("infinitempomatrix.jl")
include("infiniteblockmpo.jl")
include("infinitempo.jl")
include("transfermatrix.jl")
include("models/models.jl")
include("models/fqhe13.jl")
Expand All @@ -60,7 +60,7 @@ export Cell,
InfMPS,
InfiniteSum,
InfiniteMPO,
InfiniteMPOMatrix,
InfiniteBlockMPO,
InfiniteSumLocalOps,
ITensorMap,
ITensorNetwork,
Expand Down
10 changes: 10 additions & 0 deletions src/ITensors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,13 @@ end
# TODO: make this definition AbstractMPS
# Handle orthogonality center correctly
Base.getindex(ψ::MPS, r::UnitRange{Int}) = MPS([ψ[n] for n in r])

#TODO Remove if everything is working nicely
#Was still crashing on my laptop after updating ITensors
Base.fill!(::NDTensors.NoData, ::Any) = NDTensors.NoData()
Copy link
Member

Choose a reason for hiding this comment

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

I added a similar definition in ITensor/ITensors.jl#1173, is the definition there not sufficient?


function ITensors.NDTensors.contraction_output(
A::NDTensors.EmptyTensor, B::NDTensors.DiagBlockSparseTensor, label
)
return NDTensors.EmptyTensor(promote_type(eltype(A), eltype(B)), label)
end
7 changes: 6 additions & 1 deletion src/celledvectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ _setindex_cell1!(cv::CelledVector, val, n::Int) = (ITensors.data(cv)[n] = val)
function getindex(cv::CelledVector, n::Int)
cellₙ = cell(cv, n)
siteₙ = cellindex(cv, n)
cellₙ == 1 && return _getindex_cell1(cv, siteₙ) #Avoid unnecessary calls
return translatecell(cv.translator, _getindex_cell1(cv, siteₙ), cellₙ - 1)
end

Expand Down Expand Up @@ -169,7 +170,11 @@ getindex(cv::CelledVector, c::Cell) = cv[eachindex(cv, c)]
function setindex!(cv::CelledVector, T, n::Int)
cellₙ = cell(cv, n)
siteₙ = cellindex(cv, n)
_setindex_cell1!(cv, translatecell(cv.translator, T, -(cellₙ - 1)), siteₙ)
if cellₙ == 1
_setindex_cell1!(cv, T, siteₙ)
else
_setindex_cell1!(cv, translatecell(cv.translator, T, -(cellₙ - 1)), siteₙ)
end
return cv
end

Expand Down
Loading
Loading