0 votes
asked by (240 points)

Hi Miles,

With two sets of QN alternate in a siteset, is there any way to swap between two neighboring site with non-identical QN?

1 Answer

0 votes
answered by (14.1k points)

Hi Mingru,

Can you just create a set of swap gates using delta functions? i.e. for sites 5 and 6 with indices s5 and s6, make the swap gate:

auto swap56 = delta(s5,prime(s6))*delta(s6,prime(s5));

Cheers,
Matt

commented by (240 points)
But then the QN at site 6 is still the old one. Is there any way to also exchange their QN? Although it violates the siteset definition...
commented by (14.1k points)
edited by
Hmm, it sounds like maybe you need to define two different versions of your siteset, where you can choose:

ABABAB...

or

BABABA...

where A is one site type and B is another site type? But I guess the problem is then that you want the sites of the first one to be compatible with the sites of the second one?

You can always use delta functions to then make your MPS compatible with the new SiteSet. For example, if you have the following two SiteSets:

    auto sitesA = SiteSetA(N);
    auto sitesB = SiteSetB(N);

where SiteSetA and SiteSetB generate the sites ABAB... and BABA... respectively, and you make an MPS:

    auto psi = MPS(sitesA);

you can use the swap gates:

    auto swap56 = delta(sitesA(5),sitesB(6))*delta(sitesA(6),sitesB(5));

so when you apply the swap gates to the MPS `psi`, `psi` then has the sites of SiteSetB and you can use `sitesB`.
commented by (14.1k points)
edited by
You could possibly get away with just using a singe SiteSet, depending on what you want to do with your state.

Another thing you can do is, say you have your SiteSet `sitesA` that has a pattern: ABABAB... where A and B are your different types of sites. Then if you make an MPS with those sites:

     auto psi = MPS(sitesA);

and then swap them with swap gates:

    auto swap56 = delta(sitesA(5),prime(sitesA(6)))*delta(sitesA(5),prime(sitesA(6)));

defined as above, you can just use the original SiteSet `sitesA` but if you want to apply an operator to site 5 of your swapped system, use `sites.op("Sz",6)`, for example.

Again, it depends on what you want to do with the swapped system.
commented by (240 points)
Thanks Matt!

I'm thinking of constructing two sitesets also. But I guess there are some tricky things going on, such as the new siteset should be constructed from the old one instead of constructing separately, otherwise they won't be compatible?
commented by (14.1k points)
That is why I suggested the special swap gates:

    `auto swap56 = delta(sitesA(5),sitesB(6))*delta(sitesA(6),sitesB(5));`

which will transform your MPS between the different sites. So if you applied that to an MPS made from `sitesA`, it would then become an MPS defined on the second SiteSet `sitesB`.

So that would work even if SiteSet `sitesA` and `sitesB` where constructed totally separately.
commented by (240 points)
Thanks, I'll try to see if it works.
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

...