## Initial CAT state

How do I use this algorithm? What does that parameter do?
pasa
Posts: 6
Joined: 09 Mar 2020, 12:45

### Initial CAT state

Dear TeNPy community,

I would like to ask whether someone used the function MPS.from_Bflat(sites, Bflat, SVs=None, bc='finite', dtype=None, permute=True, form='B', legL=None) and could help me understand it providing some specific example of how to use it. I didn't manage to follow the documentation. Should I provide every tensor for a given physical entry? What if I want to use a unit cell of size 2? I think that a spin 1/2 example with a 2-unit cell would help a lot.

Thanks!
Johannes
Posts: 209
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

### Re: Initial CAT state

Hi Pasa,
from_product_state and from_singlets call that function in the end. The source code of from_Bflat might serve as an example.

The first argument really is just a list of the B tensor that make up the MPS, in the form of numpy arrays.

The topic title indicates that you want to write a cat state. I guess you want to do time evolution of a finite system?
You could also initialize the two MPS constituting the cat state and add them together in the end with add.
pasa
Posts: 6
Joined: 09 Mar 2020, 12:45

### Re: Initial CAT state

Hi,

thanks for the quick reply. I was thinking about using "add", but I need to run iDMRG ( I saw one can only use it for segment or finite (?) ) and also as you guessed, I am planning to use a CAT state where each of the states have different total charge, and "add" documentation looks to assume they both have the same charge (?). I will try to implement from_Bflat following your suggestion of looking at the end of those two functions. I was missing the way I should provide the tensors: both the order and what happens if I have a two site unit cell. Let me try and perhaps I can post my solution.
Johannes
Posts: 209
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

### Re: Initial CAT state

There is a reason that MPS.add doesn't support adding states of infinite MPS: usually, you really want to avoid writing infinte MPS cat states. I would advice against using it as an initial state for iDMRG... If you do that, you just try to find two ground states at the same time. DMRG should at some point pick one over the other anyways, unless you force it not to (e.g. with symmetry constraints).

If the states really have different charges, you will hardly have success in using from_Bflat either; the charge constraints for the tensors then don't allow to write them as a single MPS.
pasa
Posts: 6
Joined: 09 Mar 2020, 12:45

### Re: Initial CAT state

Hi Johannes,

Thank you again for the explanation. So I want to have a first idea of a phase diagram where I know there is a SSB broken phase whose ground state is pretty close to one of the two possible states in the CAT superposition, being the other one a better initial seed for the other phase that appears. This state would be something like $$|\psi \rangle = \otimes_{j=1}^L |\uparrow\rangle + \otimes_{even \,j} |\uparrow,\downarrow\rangle$$ (actually I am interested in higher spins where this state has an easier MPS representation) So the way I am implementing it is as follows (need to finish some details)

Code: Select all

Bs = []
Beven = np.zeros((M.lat.mps_sites()[0].dim, chi,chi), dtype=np.float64)
Beven[0,0,0] = ...
Beven[1,1,1] = ...
Bs.append(Beven)
Bodd = np.zeros((M.lat.mps_sites()[0].dim, chi, chi), dtype=np.float64)
Bodd[0,0,0] = ...
Bodd[3,1,1] = ...
Bs.append(Bodd)

psi = MPS.from_Bflat(M.lat.mps_sites(), Bs,  bc=M.lat.bc_MPS)

Do you think this could work?

Thanks!
Johannes
Posts: 209
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

### Re: Initial CAT state

Given that you talked about charges, I'll assume that you try to conserve the total Sz spin.
In this case, the all-up state and the Neel state are in completely different sectors, and you can not add them up in a single MPS!

Instead, you can and should run DMRG independently in each of these sectors. In fact, if you conserve the total SZ, running DMRG in the all-up sector is trivial and won't do anything, because this sector has a (hilbert space) dimension of 1, there is only that state with the maximal Sz.
You need to run DMRG in the zero-charge sector starting from the Neel state, and then compare whether the energy of the resulting state is lower than the one of the all-up state - this will give you the "true" ground state in those two sectors. Note that in general the ground state could also be in a different sector with e.g. some more up than down states.

If you are unsure which sector might be the correct one, you can try to run a "warmup" DMRG with a *very* small initial bond dimension of say chi_max=10 and the option diag_method='ED_all', see diag, and use the output as your initial guess for an actual dmrg run at higher chi_max. This allows to switch the charge sector in th, however, due to the very small bond dimension, it is not guaranteed that it actually ends up in the one with the lowest ground state energy at larger bond dimensions.