Hi,

I would like to calculate the entanglement entropy for a ladder geometry (finite or infinite) by cutting longitudinally, this is, through the rungs of the ladder, such that the subsystems A and B correspond to different chains. However, I implement this geometry using a 1D MPS with an enlarged unit cell (different elements in the unit cell correspond to different chains in the y direction). With this ordering, the subsystems A and B correspond to the even and odd sites of the MPS chain, respectively. Therefore, they are disconnected. I wonder if it is still possible to calculate the entanglement entropy corresponding to such decomposition.

I tried entanglement_entropy_segment but I get an error, so I guess this function does not accept disconnected segments. Is there any other way?

Thanks in advance!

Best,

Daniel

## Entanglement entropy for disconnected subsystems

### Re: Entanglement entropy for disconnected subsystems

The function entanglement_entropy_segment should accept disconnected segments, e.g.

However, it works only for *small* enough number of sites in your density matrix - it's exponentially expensive, because it constructs the full density matrix, tracing out the rest of the sites. If your segment

How many sites did you try?

What error messge did you get?

`segment=[0, 2, 4, 6, 8]`

.However, it works only for *small* enough number of sites in your density matrix - it's exponentially expensive, because it constructs the full density matrix, tracing out the rest of the sites. If your segment

How many sites did you try?

What error messge did you get?

### Re: Entanglement entropy for disconnected subsystems

If a try

I get the following error
However, for

there is no problem. I am using the following lattice This means I have a 1D chain with a unit cell of four elements, with L = 10 for instance. Then I want to take as a subsystem the first two elements of each unit cell for a number of sites, for example
I have also tried with the Ising model on a chain and I get the same error.

Code: Select all

`segment = [0, 2]`

I get the following error

Code: Select all

`KeyError: "Label not found: 'p1', current labels: ['p0', 'p0*', 'p', 'p*']"`

Code: Select all

`segment = [0, 1]`

there is no problem. I am using the following lattice

Code: Select all

`lat = Lattice([L], [spin_site] * 4, bc=bc, bc_MPS=bc_MPS)`

Code: Select all

`segment = [6, 7, 10, 11, 14, 15]`

### Re: Entanglement entropy for disconnected subsystems

Sorry, that was a bug in

`MPS.get_rho_segment`

. It should be fixed with the latest version.### Re: Entanglement entropy for disconnected subsystems

Now it works perfectly. Thanks a lot!