Dear Aki,
I had a quick play around with your code. It is very interesting, thanks for sharing. I have never actually messed around with qubo+annealing things before, but after looking at the pyqubo documentation i spotted a couple of things;
1) you put a minus sign on H0 terms... wasn't clear to me why?
2) i am not sure where you get the ideal solution from, but i think it might be inverted with respect to the spin basis?
to check the above i removed the minus signs on H0, swapped the basis in eket so it reads:
eket0 = tensor([basis(2,0) if (33345>>i) & 1 else basis(2,1) for i in range(N)])
I also looked at the solutions provided by sa = neal.SimulatedAnnealingSampler().
eket0 and neal both gave an energy of -18.05
In making these two changes, I found for time =100, the overlap with the modified eket0 and one of the low energy solutions from neal was:
0.20110908112627024
with an energy of -17.887669020610808
for time 200, i see an overlap of
0.3401019799776224
with an energy of -17.975861565097063
which seems reasonable? Again, I am not an expert on this, so maybe theres good reasons for the two issues I mentioned above. also, I think there seemed to be multiple optimal solutions from neal.SimulatedAnnealing, so
perhaps the fidelity as defined will never go very high
i think your example is very nice, maybe when you are finished you might want to contribute it to qutip-tutorials? though i am not sure if having a pyqubo dependency will be ok.
all the best
neill