+1 vote
asked by (210 points)
edited by

Hi,

This may sound really naive but I was trying to understand the implementation of TEBD-type time evolution from the example: http://itensor.org/docs.cgi?vers=julia&page=getting_started/mps_time_evolution . Then I was trying to find the function 'apply'. I did not manage to do that but I found function 'product' under abstractmps.jl which looks like:

product(o::ITensor, ψ::Union{MPS, MPO}, [ns::Vector{Int}]; )
apply([...])

Is product the same as apply? If so, how is it realized?

Much appreciated in advance!

Cheers,
Tianqi

1 Answer

+1 vote
answered by (55.1k points)

Hi Tianqi,
Glad you are looking into this. You are correct that the code is in the function product inside of the src/mps/abstractmps.jl file. Here is a link to it for your reference (or others reading this answer):

https://github.com/ITensor/ITensors.jl/blob/9be101ef167cd50588a8e9c556d37be3518aba7b/src/mps/abstractmps.jl#L1733

The way that it is aliased also to the function name apply is potentially confusing: it is done in a single line of code inside the file src/itensor.jl (line 2212) which just reads

  # Alias apply with product
  const apply = product

You can see this here:
https://github.com/ITensor/ITensors.jl/blob/9be101ef167cd50588a8e9c556d37be3518aba7b/src/itensor.jl#L2212

Hope that helps!

Miles

commented by (210 points)
Just saw this. Thank you Miles for your answer! Now we get it.
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

...