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

Add site-dependent QNs numbers #47

Open
LHerviou opened this issue Feb 8, 2022 · 7 comments
Open

Add site-dependent QNs numbers #47

LHerviou opened this issue Feb 8, 2022 · 7 comments

Comments

@LHerviou
Copy link
Contributor

LHerviou commented Feb 8, 2022

The final step I need for my FQHE code is to implement site-dependent QNs.
I managed to make it work with a little bit of dirty code on ITensors for finite DMRG, so it should be also workable.

Now, it would be logical to implement this at the level of the CelledVectors.
One possibility is to add a functional component to the structure (e.g. named QN_translation_operation) which would be called and applied on the QNs. To make the behavior transparent, I could make its default value "nothing", and add a few if lines in the code that only applies the function if it is assigned/not nothing.

What do you think of this solution?

A description of the implementation of the symmetry I need is given in the Supplemental Materials of https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.110.236801.
Basically, if I note the shifted charge conservation C_n = q N_n - p (for site n at filling p/q), the local momentum operator is K_n = n C_n + s, where s is a constant shift that is fixed at the creation of the MPS. For a well chosen s, the transformation rules for all charge legs would be (c, k) -> (c, k + nsites(\psi) c) for all legs.

@mtfishman
Copy link
Member

mtfishman commented Feb 8, 2022

My ultimate plan has always been to make the CelledVector type more general by defining it like this:

struct CelledVector{T,F} <: AbstractVector{T}
  data::Vector{T}
  translatecell::F
end

translatecell would be a function of the form:

function my_translatecell_function(x::T, n)
  # Function that translates an element of the unit cell by `n` cells
end

CelledVector(mps_tensors, my_translatecell_function)

Then, you can define any function you want, which could include both translating the cell tags and shifting the QNs for the case you outline above.

@LHerviou
Copy link
Contributor Author

LHerviou commented Feb 8, 2022

That seems to fit exactly what I had in mind.
I will start having a look at it.

@LHerviou
Copy link
Contributor Author

LHerviou commented Feb 9, 2022

A prototype seems to be working.

I have a very stupid problem to benchmark my code. I am getting an error of the type
Overload of "op" or "op!" functions not found for operator name "N" and Index tags: "Fermions,Site,c=1,n=1")

I do not see where the overload was done for the spins

@mtfishman
Copy link
Member

Looks like that error shows that you are using the site type "Fermions" instead of "Fermion". This works:

julia> using ITensors

julia> s = siteind("Fermion")
(dim=2|id=199|"Fermion,Site")

julia> @show op("N", s);
op("N", s) = ITensor ord=2
Dim 1: (dim=2|id=199|"Fermion,Site")'
Dim 2: (dim=2|id=199|"Fermion,Site")
NDTensors.Dense{Float64, Vector{Float64}}
 2×2
 0.0  0.0
 0.0  1.0

@LHerviou
Copy link
Contributor Author

LHerviou commented Mar 1, 2022

I was blind. Thanks for the fix, the generalized cellvectors are working.

I will make a PR once the current one is synchronized, probably also including a generalized subspace expansion I needed for my computations.

@mtfishman
Copy link
Member

Amazing, thanks!

@LHerviou
Copy link
Contributor Author

A quick comment: some default functions for translatecells are not implemented apparently (a colleague was struggling) => probably a consequence of the name change.
I will try to make a PR for that tomorrow at the latest.

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

No branches or pull requests

2 participants