Hi Johannes and Jakob,
Thank you again for your answers and suggestions to this question. I have had a chance to think about this now and I think that these suggestions do not solve the problem. I will try to explain more clearly with a fully self-contained minimal example. Here is my example script...
Python: Select all
from tenpy.models.hubbard import FermiHubbardChain
from tenpy.algorithms.exact_diag import ExactDiag
from tenpy.networks.mps import MPS
M = FermiHubbardChain({"L": 2})
product_states = [[3, 0], [1, 2], [2, 1], [0, 3]]
basis_map = []
for state in product_states:
prod_mps = MPS.from_product_state(M.lat.mps_sites(), state)
ED = ExactDiag(M, charge_sector=[2, 0])
prod_statevector = list(ED.mps_to_full(prod_mps).to_ndarray())
print(f"{state} => {prod_statevector}")
basis_map.append(prod_statevector.index(1))
print(f"basis map = {basis_map}")
...and here is its output...
Code: Select all
[3, 0] => [0.0, 0.0, 1.0, 0.0]
[1, 2] => [0.0, 0.0, 0.0, 1.0]
[2, 1] => [1.0, 0.0, 0.0, 0.0]
[0, 3] => [0.0, 1.0, 0.0, 0.0]
basis map = [2, 3, 0, 1]
In the above example, I consider a L=2 FermiHubbardChain and I fix the symmetry sector to (N, Sz)=(2, 0). There are 4 possible product states in this symmetry sector [[3, 0], [1, 2], [2, 1], [0, 3]]. I would now like to deduce the basis ordering for a statevector given from the
mps_to_full
function. To this end, I can convert the individual MPS product states into statevectors (total Hilbert space dimension of 4). I can do this one-by-one and see which entry each product state corresponds to, which finally gives me a basis map.
What I would like to do is find a way to deduce basis_map a priori, without having to explicitly convert each product state MPS into a statevector.
Previously suggested methods:
- I do not notice any difference applying
.split_legs()
to the statevector from ED.mps_to_full(prod_mps)
.
- As far as I understand,
ED._pipe._perm
will give me the permutation of the complete Hilbert space (size 16) to the one which is sorted by symmetry sectors. Indeed, if I print ED._mask
, I can tell which of these entries are in the (2, 0) sector. However, this does not help me find basis_map
, as far as I can tell.
- As far as I understand,
ED._pipe.map_incoming_flat(state)
is simply another way to derive ED._pipe._perm
.
Do you know how I can find the
basis_map
in my example script, without explicitly converting every possible product state? In other words, what is the default ordering of the exact diagonalization basis in TeNPy, within a symmetry sector?