Hello!
I am trying to look at the left and right eigenvectors of a non-Hemitian MPO. I have seen that DMRG is able to find the lowest eigenvalue of the system if you use the flag ishermitian=false
. It works fine and I am able to find the right eigenvector. However, to find the left eigenvector I use swapprime(dag(ℋ), 0 => 1)
, where `ℋ`` was the previous MPO and it gives me the following error.
DimensionMismatch: cannot add ITensors with different numbers of indices
The code is just that
E,ψ = dmrg(ℋ, MPS(stotal, ["0" for i=1:2*n]), sweeps,ishermitian = false)
E,ψ1 = dmrg(swapprime(dag(ℋ), 0 => 1), MPS(stotal, ["0" for i=1:2*n]), sweeps,ishermitian = false)
and the first line works and the second does not. I have looked at the MPO to see if there was something wrong since it says DimensionMissmatch, and the only thing that I have seen is that the primes in the sites are ordered differently.
ℋ = MPO
[1] ((dim=2|id=156|"Qubit,Site,n=1"), (dim=2|id=156|"Qubit,Site,n=1")', (dim=5|id=918|"Link,l=1"))
[2] ((dim=2|id=72|"Qubit,Site,n=1"), (dim=2|id=72|"Qubit,Site,n=1")', (dim=8|id=768|"Link,l=1"), (dim=5|id=918|"Link,l=1"))
[3] ((dim=2|id=271|"Qubit,Site,n=2"), (dim=2|id=271|"Qubit,Site,n=2")', (dim=10|id=554|"Link,l=2"), (dim=8|id=768|"Link,l=1"))
[4] ((dim=2|id=188|"Qubit,Site,n=2"), (dim=2|id=188|"Qubit,Site,n=2")', (dim=10|id=798|"Link,l=2"), (dim=10|id=554|"Link,l=2"))
[5] ((dim=2|id=584|"Qubit,Site,n=3"), (dim=2|id=584|"Qubit,Site,n=3")', (dim=11|id=592|"Link,l=3"), (dim=10|id=798|"Link,l=2"))
[6] ((dim=2|id=613|"Qubit,Site,n=3"), (dim=2|id=613|"Qubit,Site,n=3")', (dim=10|id=473|"Link,l=3"), (dim=11|id=592|"Link,l=3"))
[7] ((dim=2|id=388|"Qubit,Site,n=4"), (dim=2|id=388|"Qubit,Site,n=4")', (dim=11|id=446|"Link,l=4"), (dim=10|id=473|"Link,l=3"))
[8] ((dim=2|id=994|"Qubit,Site,n=4"), (dim=2|id=994|"Qubit,Site,n=4")', (dim=10|id=916|"Link,l=4"), (dim=11|id=446|"Link,l=4"))
[9] ((dim=2|id=520|"Qubit,Site,n=5"), (dim=2|id=520|"Qubit,Site,n=5")', (dim=9|id=517|"Link,l=5"), (dim=10|id=916|"Link,l=4"))
[10] ((dim=2|id=556|"Qubit,Site,n=5"), (dim=2|id=556|"Qubit,Site,n=5")', (dim=9|id=443|"Link,l=5"), (dim=9|id=517|"Link,l=5"))
[11] ((dim=2|id=497|"Qubit,Site,n=6"), (dim=2|id=497|"Qubit,Site,n=6")', (dim=9|id=589|"Link,l=6"), (dim=9|id=443|"Link,l=5"))
[12] ((dim=2|id=924|"Qubit,Site,n=6"), (dim=2|id=924|"Qubit,Site,n=6")', (dim=9|id=760|"Link,l=6"), (dim=9|id=589|"Link,l=6"))
[13] ((dim=2|id=822|"Qubit,Site,n=7"), (dim=2|id=822|"Qubit,Site,n=7")', (dim=8|id=170|"Link,l=7"), (dim=9|id=760|"Link,l=6"))
[14] ((dim=2|id=806|"Qubit,Site,n=7"), (dim=2|id=806|"Qubit,Site,n=7")', (dim=9|id=641|"Link,l=7"), (dim=8|id=170|"Link,l=7"))
[15] ((dim=2|id=402|"Qubit,Site,n=8"), (dim=2|id=402|"Qubit,Site,n=8")', (dim=8|id=417|"Link,l=8"), (dim=9|id=641|"Link,l=7"))
[16] ((dim=2|id=363|"Qubit,Site,n=8"), (dim=2|id=363|"Qubit,Site,n=8")', (dim=8|id=472|"Link,l=8"), (dim=8|id=417|"Link,l=8"))
[17] ((dim=2|id=452|"Qubit,Site,n=9"), (dim=2|id=452|"Qubit,Site,n=9")', (dim=5|id=967|"Link,l=9"), (dim=8|id=472|"Link,l=8"))
[18] ((dim=2|id=779|"Qubit,Site,n=9"), (dim=2|id=779|"Qubit,Site,n=9")', (dim=5|id=586|"Link,l=9"), (dim=5|id=967|"Link,l=9"))
[19] ((dim=2|id=43|"Qubit,Site,n=10"), (dim=2|id=43|"Qubit,Site,n=10")', (dim=2|id=6|"Link,l=19"), (dim=5|id=586|"Link,l=9"))
[20] ((dim=2|id=124|"Qubit,Site,n=10"), (dim=2|id=124|"Qubit,Site,n=10")', (dim=2|id=6|"Link,l=19"))
swapprime(dag(ℋ), 0 => 1) = MPO
[1] ((dim=2|id=156|"Qubit,Site,n=1")', (dim=2|id=156|"Qubit,Site,n=1"), (dim=5|id=918|"Link,l=1")')
[2] ((dim=2|id=72|"Qubit,Site,n=1")', (dim=2|id=72|"Qubit,Site,n=1"), (dim=8|id=768|"Link,l=1")', (dim=5|id=918|"Link,l=1")')
[3] ((dim=2|id=271|"Qubit,Site,n=2")', (dim=2|id=271|"Qubit,Site,n=2"), (dim=10|id=554|"Link,l=2")', (dim=8|id=768|"Link,l=1")')
[4] ((dim=2|id=188|"Qubit,Site,n=2")', (dim=2|id=188|"Qubit,Site,n=2"), (dim=10|id=798|"Link,l=2")', (dim=10|id=554|"Link,l=2")')
[5] ((dim=2|id=584|"Qubit,Site,n=3")', (dim=2|id=584|"Qubit,Site,n=3"), (dim=11|id=592|"Link,l=3")', (dim=10|id=798|"Link,l=2")')
[6] ((dim=2|id=613|"Qubit,Site,n=3")', (dim=2|id=613|"Qubit,Site,n=3"), (dim=10|id=473|"Link,l=3")', (dim=11|id=592|"Link,l=3")')
[7] ((dim=2|id=388|"Qubit,Site,n=4")', (dim=2|id=388|"Qubit,Site,n=4"), (dim=11|id=446|"Link,l=4")', (dim=10|id=473|"Link,l=3")')
[8] ((dim=2|id=994|"Qubit,Site,n=4")', (dim=2|id=994|"Qubit,Site,n=4"), (dim=10|id=916|"Link,l=4")', (dim=11|id=446|"Link,l=4")')
[9] ((dim=2|id=520|"Qubit,Site,n=5")', (dim=2|id=520|"Qubit,Site,n=5"), (dim=9|id=517|"Link,l=5")', (dim=10|id=916|"Link,l=4")')
[10] ((dim=2|id=556|"Qubit,Site,n=5")', (dim=2|id=556|"Qubit,Site,n=5"), (dim=9|id=443|"Link,l=5")', (dim=9|id=517|"Link,l=5")')
[11] ((dim=2|id=497|"Qubit,Site,n=6")', (dim=2|id=497|"Qubit,Site,n=6"), (dim=9|id=589|"Link,l=6")', (dim=9|id=443|"Link,l=5")')
[12] ((dim=2|id=924|"Qubit,Site,n=6")', (dim=2|id=924|"Qubit,Site,n=6"), (dim=9|id=760|"Link,l=6")', (dim=9|id=589|"Link,l=6")')
[13] ((dim=2|id=822|"Qubit,Site,n=7")', (dim=2|id=822|"Qubit,Site,n=7"), (dim=8|id=170|"Link,l=7")', (dim=9|id=760|"Link,l=6")')
[14] ((dim=2|id=806|"Qubit,Site,n=7")', (dim=2|id=806|"Qubit,Site,n=7"), (dim=9|id=641|"Link,l=7")', (dim=8|id=170|"Link,l=7")')
[15] ((dim=2|id=402|"Qubit,Site,n=8")', (dim=2|id=402|"Qubit,Site,n=8"), (dim=8|id=417|"Link,l=8")', (dim=9|id=641|"Link,l=7")')
[16] ((dim=2|id=363|"Qubit,Site,n=8")', (dim=2|id=363|"Qubit,Site,n=8"), (dim=8|id=472|"Link,l=8")', (dim=8|id=417|"Link,l=8")')
[17] ((dim=2|id=452|"Qubit,Site,n=9")', (dim=2|id=452|"Qubit,Site,n=9"), (dim=5|id=967|"Link,l=9")', (dim=8|id=472|"Link,l=8")')
[18] ((dim=2|id=779|"Qubit,Site,n=9")', (dim=2|id=779|"Qubit,Site,n=9"), (dim=5|id=586|"Link,l=9")', (dim=5|id=967|"Link,l=9")')
[19] ((dim=2|id=43|"Qubit,Site,n=10")', (dim=2|id=43|"Qubit,Site,n=10"), (dim=2|id=6|"Link,l=19")', (dim=5|id=586|"Link,l=9")')
[20] ((dim=2|id=124|"Qubit,Site,n=10")', (dim=2|id=124|"Qubit,Site,n=10"), (dim=2|id=6|"Link,l=19")')
Could this be the problem. If so, is there an easy way to fix it?
Thank you very much,
Aleix