-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalize infsiteinds
to fractional QN densities
#69
Conversation
…1-24-01-14-11-941-02040139585 CompatHelper: bump compat for KrylovKit to 0.6, (keep existing compat)
Automatic JuliaFormatter.jl run
The failure does not seem to come from my code but from the new @require. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Also, I think the issue was from a bug in the JuliaFormatter package which is now fixed, hopefully running the formatter again will fix the CI issue. |
Hi @mtfishman, yes this looks like a cleaner solution of what I was trying in my fork, I will try it and close the issue. Thanks @LHerviou ! |
This comment was marked as duplicate.
This comment was marked as duplicate.
infsiteinds
to fractional QN densities
function initstate(n)
if n%2==0
if (n/2)%2==1
return "Dn"
else
return "Up"
end
else
if (n+1)/2<=19
if ((n+1)/2)%2==1
return "Up"
else
return "Dn"
end
else
return "Emp"
end
end
end
N = 62
s = infsiteinds(n->isodd(n) ? "tJ" : "S=1/2", N; conserve_qns, initstate)
ψ = InfMPS(s, initstate) I got |
@LHerviou @JanReimers I've moved discussions about other topics (InfiniteMPO generation and compression, iDMRG, subspace expansion, etc.) to #73. Let's keep this PR specific to the improvements to |
Hi @LHerviou, any update on this? Otherwise I could try to merge the same fix from my fork. |
Sorry, somehow everything went into my spams. I will submit my fix today or tomorrow. |
For example, as you have mentioned, the error is from that the default two-site subspace expansion does not work in this case, so probably the error message could be "Impossible for the default two-site scheme to do a subspace expansion fails due to the form of the QN conserved Hamiltonian" or pointing our at which line and inside which function the subspace expansion fails. The current error message is difficult for people who are not developer of this repository to trace back where the error happens. |
Improving some error messages
@mingruyang could you start a new issue for problems you come across with subspace expansion (with a minimal runnable code example)? |
Looks good, thanks @LHerviou! Is there a simple test we could add to test out this improvement? Maybe we could modify one of the current tests to have fractional QN densities (the tests already take a while to run so preferably we wouldn't add a new set of VUMPS tests). |
The simplest test is probably to slightly modify our starting state for Ising or XXZ and check that it knows how to build the correct starting MPS. For example, starting with 3 fermions and 1 hole in XXZ with nsites = 4. As a side comment, the implementation for Z_n conserved quantities could be improved easily, if you think it is relevant, by instead finding y such that y * nsites = flux [n], if such solution exists. |
That would be a nice modification to the tests. That sounds like a good idea to improve the handling of Zn symmetries! |
I will try to do this this weekend then. |
Better auto qns for Zn symmetries
Normally this works perfectly, and was running on my side. It relies on the Chinese remainder theorem for Zp symmetries, i.e. noting N the unit cell, we tried to find y such that This system admits a solution iff flux = 0 mod( gcd(p, N)), which is not necessarily true. We can find a global multiplier b such that it is true. Case when things changed: N = 3, initstate = +--, flux = 1 mod 2. |
Thanks, the change is pretty self-contained and seems like it will be very important to make sure the code works for more general models so I'm in favor of adding it. Could you add your description above as a comment in the code so we can keep track of things going forward? |
Well, the construction of \psi already guarantees that the flux is 0. But I added the @test in any case. |
Fixing indices
Thanks @LHerviou! Is this good to merge from your end once tests pass? |
Yes ! |
Hej Mat,
A minor update to fix the issue #68
I am using it as an excuse to ask how to proceed with the following.
On my own fork, I have finished the implementations of a few useful features (paper coming out soon using it). This includes, from trivial to less trivial:
It might be a lot for a single merge request. So how would you like to proceed? It will take me one or two weeks anyway to make things a bit cleaner.