Hi all…could someone point me a way with which I can define a function that outputs an itensor of the rank given?
Thanks for the question. It’s not possible to create an ITensor that just has a given rank (by which I think you mean number of indices) without also specifying the indices. As you may know, the way to make an ITensor is to provide the indices that it has, for example:
i = Index(3,"index i")
j = Index(2,"j")
T = ITensor(j,i)
Happy to discuss more
Yup I know that…but I wanted to know if there was a way to make it more automated …like say I specify a couple of tensors and there ranks in a function…and design the function to contract in a particular way among the tensors …to make the process more fluent …is there no predefined function in ITensor to do this…or should I use a loop and iteratively define the indices…can it be done?
That sort of thing sounds like it could be done. But it’s hard for me to say whether there is a function in ITensor to do what you are asking, because I’m still not very clear about what you are wanting to do. Could you give a specific example? What would be the inputs to the function, specifically, and what output would you want?
Part of what you’re asking about might relate to a new package Matt Fishman is developing called “ITensorNetworks” which offers advanced features to put tensor networks onto arbitrary graphs and do tasks like contracting them: GitHub - mtfishman/ITensorNetworks.jl: A package with general tools for working with higher-dimensional tensor networks based on ITensor.