I am interested in implementing an MPS that is truly periodic in ITensors.jl. By this, what I mean is that sites 1 and N have a common index, the same way that sites j and j+1 have a common index for j = 1, 2, ..., N-1. Here is what I am thinking:
(1) Make a sweepnext_periodic
function so that, rather than turning around when it reaches the end of the chain, it just repeatedly works its way around the loop. For instance, if it were 3-site DMRG on an N-site chain, it would do sites 1:2:3, then sites 2:3:4, and so on, until sites (N-2):(N-1):N, then sites (N-1):N:1, then sites N:1:2, and that would complete the sweep. The next sweep will begin with 1:2:3 again.
(2) Make a productMPS_periodic
function that includes an ITensors Index object for site N during initialization. Right now, Index objects are created to follow sites 1 through N-1, but this new site will connect sites N and 1.
(3) Create a replacebond_periodic!
function so that it understands "wrapping around." For instance, if it is fed index N, it should understand that it is to look at sites N and 1, rather than throwing an error.
Is there anything else I am fundamentally missing, or is anything fundamentally wrong about what I am proposing above? Are there better ways to implement what I am thinking about implementing? For example, should I just make new objects rather than adding methods to the old ones? (I wouldn't want to do this unless the differences are just way too much to accommodate.) Making this work will likely take many hours of coding, so I want to make sure I have some sense of what I am doing before I begin.
This would also be a good time to double-check my understanding of the difficulties associated with My understanding is that this is not natively in the code primarily because it has poor performance on large chains. Is this correct? If not, what is (are) the primary obstacle(s) to the implementation of truly periodic matrix product states?
In case you may be wondering about my initial motivation for doing this, basically it is that I want to implement a lattice formulation of the Schwinger model. Up until now, I have tried to avoid this issue in a number of ways, but at this point, I think I am out of alternatives. In particular, the combination of DMRG and local gauge constraints makes it imperative that the last site and the first site are actually connected in the MPS and not just in the Hamiltonian. Otherwise, the last site gets "stuck" because, if you want to respect the gauge constraint, there is no way to alter that site without altering the first or second site.