Dear ITensor team,
For my specific requirements, I need to explicitly construct the reduced density matrix. The basic procedure I have followed is to first shift the canonical center of the MPS to a particular site, and then perform an SVD to obtain matrices U, S, and V. My goal is to compute U*S*U^\dag. To achieve this, I attempted to replace the left index of U^\dag (dagged the right link Index of U) with the left index of V.
# the right index of U
indA = commonind(U, S; tags = "Link")
# the left index of V
indB = commonind(V, S; tags = "Link")
#the left link of Aux MPS tensor is replected by the left index of V
replaceind!(Udag, dag(indA), indB)
However, some problems arise as following
LoadError: Attempting to replace the Indices
((dim=2|id=730|"Link,u") <Out>
1: QN("Sz",2) => 1
2: QN("Sz",0) => 1,)
with
((dim=2|id=228|"Link,v") <In>
1: QN("Sz",-2) => 1
2: QN("Sz",0) => 1,)
in the Index collection
((dim=2|id=412|"Aux,S=1/2,Site,n=12") <In>
1: QN("Sz",1) => 1
2: QN("Sz",-1) => 1, (dim=2|id=624|"Link,l=13") <In>
1: QN("Sz",1) => 1
2: QN("Sz",-1) => 1, (dim=2|id=730|"Link,u") <Out>
1: QN("Sz",2) => 1
2: QN("Sz",0) => 1).
However, the Index
(dim=2|id=730|"Link,u") <Out>
1: QN("Sz",2) => 1
2: QN("Sz",0) => 1
has a different space from the Index
(dim=2|id=228|"Link,v") <Out>
1: QN("Sz",-2) => 1
2: QN("Sz",0) => 1.
They must have the same spaces to be replaced.
In the presence of QN, how can I correctly construct the reduce density matrix explicitly.
Best regards.
ZHOU Zongsheng.