This repository was archived by the owner on Mar 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
This repository was archived by the owner on Mar 23, 2025. It is now read-only.
Drop zero blocks during uncombining #55
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Uncombining can "generate" nonzero blocks:
using ITensors
i = Index(QN(0,2)=>2,QN(1,2)=>2; tags="i")
j = settags(i,"j")
A = emptyITensor(i,j,dag(i'))
A[1,1,1] = 1.0
C = combiner(i, j; tags="c")
AC = A * C
Ap = AC * dag(C)
@show A
@show Apgives:
A = ITensor ord=3
Dim 1: (dim=4|id=251|"i") <Out>
1: QN(0,2) => 2
2: QN(1,2) => 2
Dim 2: (dim=4|id=251|"j") <Out>
1: QN(0,2) => 2
2: QN(1,2) => 2
Dim 3: (dim=4|id=251|"i")' <In>
1: QN(0,2) => 2
2: QN(1,2) => 2
NDTensors.BlockSparse{Float64,Array{Float64,1},3}
4×4×4
Block: Block{3}((0x0000000000000001, 0x0000000000000001, 0x0000000000000001), 0x8324cf5639de3e67)
[1:2, 1:2, 1:2]
[:, :, 1] =
1.0 0.0
0.0 0.0
[:, :, 2] =
0.0 0.0
0.0 0.0
Ap = ITensor ord=3
Dim 1: (dim=4|id=251|"i") <Out>
1: QN(0,2) => 2
2: QN(1,2) => 2
Dim 2: (dim=4|id=251|"j") <Out>
1: QN(0,2) => 2
2: QN(1,2) => 2
Dim 3: (dim=4|id=251|"i")' <In>
1: QN(0,2) => 2
2: QN(1,2) => 2
NDTensors.BlockSparse{Float64,Array{Float64,1},3}
4×4×4
Block: Block{3}((0x0000000000000001, 0x0000000000000001, 0x0000000000000001), 0x8324cf5639de3e67)
[1:2, 1:2, 1:2]
[:, :, 1] =
1.0 0.0
0.0 0.0
[:, :, 2] =
0.0 0.0
0.0 0.0
Block: Block{3}((0x0000000000000002, 0x0000000000000002, 0x0000000000000001), 0x8681cd10e233a627)
[3:4, 3:4, 1:2]
[:, :, 1] =
0.0 0.0
0.0 0.0
[:, :, 2] =
0.0 0.0
0.0 0.0We could check for zero blocks here and drop them. However, checking every block for zeros may not be a cost we want to impose every time an uncombiner is used.
Since it is inconvenient to pass tolerances to contract, we could be very strict with the tolerance there, and then provide a dropzeros[!] function for NDTensors and ITensors.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request