## 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
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.