I’m trying to implement the functionality of a swap gate within an MPS. I saw that the movesite function can be used for this purpose. However, as mentioned in the docstring, when I set up an MPS chain of length 200 and then use movesite, it significantly increases the entanglement in the system, which eventually leads to an “out-of-memory” error.
I’m wondering—are there any other ways in ITensor to implement a swap gate without causing such a large increase in entanglement?
Unfortunately, there is no way around this, as it is not due to a particular code implementation of the swap gate, but to the fact that the swap gate can in general introduce entanglement in the system. Also, if you move two sites that are physically close away from each other in the MPS then the bond dimension will have to increase to “transmit” the now long-ranged correlations between the two.
@DanielSic is right that swap gates generally increases entanglement / bond dimension, especially if there are many swaps or they cover a large spatial range.
An alternative for a long-range gate is to turn it into an MPO. A generic 2-site gate acting on qubits or S=1/2 sites can always be factorized into an MPO of maximum bond dimension 4 (this is just a consequence of how a gate can be reshaped as a 4x4 matrix). So then using this approach, the bond dimension of the MPS will grow at most by a factor of 4 after applying the gate.