+1 vote
asked by (290 points)
edited by


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}]; )

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

Much appreciated in advance!


1 Answer

+1 vote
answered by (70.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):


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:

Hope that helps!


commented by (290 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.