+1 vote
asked by (310 points)

Hi Miles,

I ran into some problems when defining a new QN.
Let me first explain what I want to do:
I wanted to study a two-component Hardcore-Boson model, i.e. on each site, there are two kinds of bosons, say, A and B. In this model, the number of boson A and B both conserve.
I thought a way to do this is use the "hubbard.h" as a template, because there we also have two conserved quantum numbers "Sz" and "Nf".
What I actually did is to substitute "Sz"and "Nf" with "Nb" in hubbard.h , as well as rewriting correspondent operators. However, dmrg program does not work. I printed the Hamiltonian and state tensors, I found their indices QN only has one value.
So I guess maybe program can not recognize two same type of QN. In another word, if I write:
site_.at(j) = IQIndex(nameint("site=", j), Index(nameint("Emp ",j), 1, Site), QN("Nb=", 0, "Nb=", 0), Index(nameint("A ", j), 1, Site), QN("Nb=", 1, "Nb=", 0), Index(nameint("B ", j), 1, Site), QN("Nb=", 0, "Nb=", 1), Index(nameint("AB ", j), 1, Site), QN("Nb=", 1, "Nb=", 1));
the program will only see one "Nb=" slot, right?

If this is true, I think there could still be one solution, i.e. defining two types of slots with new names. So here comes the next question: how to make it?
I tried in the following way: in the "qn.h" and "qn.cc" whenever I see "Nb", I duplicate that line of code only changing "Nb" into new names "Nba" and "Nbb", and back to the site file, I rewrite:
site_.at(j) = IQIndex(nameint("site=", j), Index(nameint("Emp ",j), 1, Site), QN("Nba=", 0, "Nbb=", 0), Index(nameint("A ", j), 1, Site), QN("Nba=", 1, "Nbb=", 0), Index(nameint("B ", j), 1, Site), QN("Nba=", 0, "Nbb=", 1), Index(nameint("AB ", j), 1, Site), QN("Nba=", 1, "Nbb=", 1));

I think in this way I should have create two kind of new slots "Nba","Nbb"with the same property as that of "Nb". But it still cannot work. Again, I print the tensors, but it shows "QN()", which means it still cannot recognize the new names of QN slots. So could you please show me what else should I do when I want to define a new QN slot with new name?

Thank you.
Best,
Zhiyu

1 Answer

+1 vote
answered by (70.1k points)
selected by
 
Best answer

Hi Zhiyu,
We just put the "named slot" feature into the QN system for convenience when making very common types of QNs. I think your best bet here is to instead just use the "manual" way of making QNs where you specify the value and mod factor of each slot. So for two separately conserved types of hardcore bosons (without spin) I would just do:

QN({na,1},{nb,1})

where na and nb are integers (0 or 1) indicating how many of each type of boson you have.

Does that work for your problem?

Miles

commented by (310 points)
Hi Miles,
It works! Thank you:)

Zhiyu
Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.

Categories

...