Skip to content

Commit

Permalink
Add support for building operators without a link space
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyT1994 committed May 8, 2024
1 parent 65f40ec commit 91852b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/abstractindsnetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,13 @@ function insert_linkinds(
for e in edges
# TODO: Change to check if it is empty.
if !isassigned(indsnetwork, e)
iₑ = Index(link_space, edge_tag(e))
# TODO: Allow setting with just `Index`.
indsnetwork[e] = [iₑ]
if !isnothing(link_space)
iₑ = Index(link_space, edge_tag(e))
# TODO: Allow setting with just `Index`.
indsnetwork[e] = [iₑ]
else
indsnetwork[e] = []
end
end
end
return indsnetwork
Expand Down
2 changes: 1 addition & 1 deletion src/formnetworks/bilinearformnetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function BilinearFormNetwork(
@assert issetequal(flatten_siteinds(bra), flatten_siteinds(ket))
operator_inds = union_all_inds(siteinds(ket), dual_site_index_map(siteinds(ket)))
# TODO: Define and use `identity_network` here.
O = ITensorNetwork(Op("I"), operator_inds)
O = ITensorNetwork(Op("I"), operator_inds; link_space=nothing)
return BilinearFormNetwork(O, bra, ket; dual_site_index_map, kwargs...)
end

Expand Down

0 comments on commit 91852b7

Please sign in to comment.