Skip to content
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

Merged
merged 29 commits into from
Mar 28, 2023

Conversation

LHerviou
Copy link
Contributor

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:

  • SU(3) and SU(4) irrep using color conservation (nothing non-Abelian)
  • some small fixes in general
  • implementation of a few convenient functions for data analysis (QN-resolved analysis of ent spectrum, transfer matrix spectrum + some correlation functions)
  • a working iDMRG for InfiniteMPOMatrix
  • a working InfiniteMPO constructed from an InfiniteMPOMatrix
  • a working iDMRG for InfiniteMPO
  • compression of iMPOs using InfiniteMPOMatrix and the approach by Parker, Cao et Zaletel in Phys.Rev.B 102 . It is not yet fully benchmarked so that should clearly be experimental , especially as it is the simplest, non-fail proof version.
  • I also plan to do this week some modifications on the subspace expansion as I cannot afford the default version in my new project (the one that required the compression of iMPOs)

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.

@LHerviou
Copy link
Contributor Author

The failure does not seem to come from my code but from the new @require.

@mtfishman

This comment was marked as duplicate.

@mtfishman
Copy link
Member

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.

@nbaldelli
Copy link
Contributor

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 !

@JanReimers

This comment was marked as duplicate.

@mtfishman mtfishman changed the title Minor update fixing #68 Generalize infsiteinds to fractional QN densities Mar 1, 2023
@mingruyang
Copy link

mingruyang commented Mar 6, 2023

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
AssertionError: Flux not invariant under one unit cell translation, not implemented

@mtfishman
Copy link
Member

@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 infsiteinds.

@nbaldelli
Copy link
Contributor

Hi @LHerviou, any update on this? Otherwise I could try to merge the same fix from my fork.

@LHerviou
Copy link
Contributor Author

Sorry, somehow everything went into my spams.

I will submit my fix today or tomorrow.
Sorry for the delay

@mingruyang
Copy link

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.

@mtfishman
Copy link
Member

@mingruyang could you start a new issue for problems you come across with subspace expansion (with a minimal runnable code example)?

@mtfishman
Copy link
Member

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).

@LHerviou
Copy link
Contributor Author

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.

@mtfishman
Copy link
Member

That would be a nice modification to the tests.

That sounds like a good idea to improve the handling of Zn symmetries!

@LHerviou
Copy link
Contributor Author

I will try to do this this weekend then.

@LHerviou
Copy link
Contributor Author

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
y = 0 mod N and y = flux mod p. Then we just need to find x such that y = N x.

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.
The action of the multiplier is flux -> b flux, p -> b p. b = N is a trivial solution. That was more or less what the previous code was doing.
Now I am a bit more subtle: I try to find the smallest b such that:
b flux = 0 mod gcd(N, p b).
It changes nothing but is more satisfactory and natural.

Case when things changed: N = 3, initstate = +--, flux = 1 mod 2.
Previous version: 1 is not divisible by 3, so we mutiply everything by 3. Gives QN ( 4 mod 6, 1 mod 6)
Current version: gcd(2, 3) = 1, so a solution actually exists: 3 x 1 = 1 mod 2 => work with QN (0 mod 2, 1 mod 2)

@mtfishman
Copy link
Member

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?

@LHerviou
Copy link
Contributor Author

Well, the construction of \psi already guarantees that the flux is 0. But I added the @test in any case.

@mtfishman
Copy link
Member

Thanks @LHerviou! Is this good to merge from your end once tests pass?

@LHerviou
Copy link
Contributor Author

Yes !

@mtfishman mtfishman merged commit 61d5bbb into ITensor:main Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants