Hey I have a question that I am stuck on. I have a problem where the cost function exp(-i beta H) is diagonal i.e. H is created from Z operators only. Plus I have a scenario where I add an extra penalty for some specific classical product states say |i>.
I want to find the final solution as a product state |i_final> which is a classical product state.
I want to use the METTS algorithm to try to ssolve this problem. I am looking at the METTS formulation in the Paper Link .
The issue is I see that in the METTS algorithm we need to start with a sampled CPS |i>, compute phi using this state and theexp(-beta H / 2) and P^{-1/2}. Finally we sample the new state i’ from the inner product of “i” and phi.
I cant seem to reconcile this formulation with the example implementation of METTS in ITensor that I see here: METTS ITensor Code Example. In this code, I just see that the state is initialized randomly psi = random_mps(s), and this state is perturbed using psi = apply(gates, psi; cutoff). I am not sure how does gates capture both the exp(- beta H/2) and the P^{-1/2} term? Can you help me understand this implementation in ITensors?
Also when I am trying to adapt this code for a different classical H (where both the original and penalty terms are diagonal)? I can also consider I can set the probability to 0 in the cases the penalty is triggered directly?
It’s a good question about the example code. I think the code was that way out of convenience, and because by default the first nwarm METTS get discarded to “warm up” the Monte Carlo sampling, so it is ok in this sense if the first state is technically not a METTS.
But I just made a small PR that changes the first initial state to be a product state for pedagogical clarity.
Regarding the P^{-1/2} probability weight, that is just the analytical form of the norm of the METTS after it is computed, and multiplying by it makes the METTS to have a norm of 1.0. So if the time evolution method has the effect of outputting a time-evolved state with a norm already equal to 1.0, then the P^{-1/2} factor does not need to be computed explicitly. (If one does want this number, then whichever time evolution method is used can be modified to save and the “norm factors” computed internally during the time evolution.)
About the penalty, I don’t know the answer to that question without working carefully through the theory of METTS for your case (that of a diagonal H plus penalty). I would encourage you to do this since it is important if you’re using METTS in an unusual use-case to gain a deep understanding of how it might behave for your case. I’d strongly suggest working out all of the METTS states for a small example case like when your Hamiltonian is a 2x2 matrix or 4x4 matrix, say.
What might be very important for your case is to develop a sampling scheme that does not collapse only in the Z basis (probably you have realized this already). Since your Hamiltonian is diagonal in this basis, if you evolve and collapse in this basis only the sampling will not be ergodic and will not explore different initial states.