+1 vote
asked by (190 points)

Dear ITensor community,

I would like to ask for help with the following problem:

For a 1D boson-chain psi I would like to consider situation:

  1. Let's us define operator
    "auto Sy = 0.5/Cplx_i*( sites.op("Adag",i)*sites.op("A",j) - sites.op("Adag",j)*sites.op("A",i))"

  2. Let's us define its exponential
    "auto expSy = expHermitian(Sy, -Cplx_i*Y);"

I would like to define such an operation:

"psi_i_j:= expSy*psi_i_j", 

i.e. rotation between sites {i,j} by angle Y. I know that to extract a single physical index I should use, psi.Aref(i), however, I stuck in the construction of a rotation itself.

Many thanks in advance,
Marcin

1 Answer

0 votes
answered by (70.1k points)

Hi Marcin,
Thanks for the question.

First of all, when you say you are stuck in the construction of the rotation itself, which part are you stuck on? It seems like you have figured it out perfectly, namely that you can define a Hermitian ITensor (in this case Sy) and then use expHermitian to exponentiate it to construct your rotation operator. So is your question whether the procedure you are doing to make expSy the right one? Or is your question about applying expSy to an MPS?

If your question is about applying expSy to an MPS, then there are two distinct cases:

  1. if i and j are nearest-neighbors, such that j = i+1 say, then there is a tutorial about how to apply gates to MPS on neighboring sites here: http://itensor.org/docs.cgi?vers=cppv3&page=formulas/gate
    Note that this necessarily involves two MPS tensors so it is not sufficient to just get the i'th MPS tensor (I say this since you mentioned psi.Aref(i)).

  2. if i and j are not neighbors, then to apply a gate onto them you just first move one of the sites (say j) through the MPS using a series of "swap" moves in order to apply a gate, then move j back to its original position. There are various ways to do this, but it's much more technical so please let me know first if this is your situation. (Note that in the Julia version of ITensor this is done automatically for you but we don't have that in the C++ version.)

Finally, please note that you don't need to call psi.ref unless it is to modify an MPS tensor. If you are just obtaining the MPS tensor to, say, contract it with some other tensor it's better to write psi(i) and this comes with some extra efficiencies.

Best regards,
Miles

commented by (190 points)
Dear Miles,

Sorry for not being specific. Indeed, I'm considering nearest-neighbours so {j,j+1}. Thanks for the reference - it works!
Best regards,

Marcin
commented by (70.1k points)
Glad to hear it is working!
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

...