Skip to content

Commit

Permalink
Switch gauging to use quadraticformnetwork for cache. Set default for…
Browse files Browse the repository at this point in the history
… operator link space based on siteinds
  • Loading branch information
JoeyT1994 committed May 8, 2024
1 parent 91852b7 commit a32a481
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/formnetworks/bilinearformnetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ function BilinearFormNetwork(
kwargs...,
)
@assert issetequal(flatten_siteinds(bra), flatten_siteinds(ket))
link_space = isempty(flatten_siteinds(bra)) ? 1 : nothing
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; link_space=nothing)
O = ITensorNetwork(Op("I"), operator_inds; link_space)
return BilinearFormNetwork(O, bra, ket; dual_site_index_map, kwargs...)
end

Expand Down
5 changes: 1 addition & 4 deletions src/gauging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ function Base.copy(ψ::VidalITensorNetwork)
return VidalITensorNetwork(copy(site_tensors(ψ)), copy(bond_tensors(ψ)))
end

function default_norm_cache::ITensorNetwork)
ψψ = norm_sqr_network(ψ)
return BeliefPropagationCache(ψψ, group(v -> first(v), vertices(ψψ)))
end
default_norm_cache::ITensorNetwork) = BeliefPropagationCache(QuadraticFormNetwork(ψ))

function ITensorNetwork(
ψ_vidal::VidalITensorNetwork; (cache!)=nothing, update_gauge=false, update_kwargs...
Expand Down

0 comments on commit a32a481

Please sign in to comment.