# apply function in Julia

+1 vote
edited

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?

Cheers,
Tianqi

+1 vote

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


Hope that helps!

Miles

commented by (290 points)
Just saw this. Thank you Miles for your answer! Now we get it.