Add support for building operators without a link space #171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows one to pass the kwarg
link_space = nothing
into theITensorNetwork(f::Function, s::IndsNetwork; ...)
constructor so that it doesn't add any link indices when constructing theITensorNetwork
. The change is made at the level ofinsert_linkinds(s::IndsNetwork; link_space = trivial_space(s)
. The default of link indices of dimension 1 is unchanged.One can now do
ITensorNetwork(Op("I), s; link_space = nothing)
to build the identity operator without any link indices. The default for theBiLinearForm(psi, phi; ...)
constructor is done based on whetherpsi
does or doesn't have site indices.@mtfishman I'm adding this so that when one builds the
formnetwork
<psi|I|psi>
and does BP the message tensors don't end up with additional trivial indices which can lead to complications when you want to square root them and gauge the local state etc.Let me know if you can think of a better way to support this functionality or if you are okay with as is.