diff --git a/src/formnetworks/bilinearformnetwork.jl b/src/formnetworks/bilinearformnetwork.jl index 19ca7568..11d298c5 100644 --- a/src/formnetworks/bilinearformnetwork.jl +++ b/src/formnetworks/bilinearformnetwork.jl @@ -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 diff --git a/src/gauging.jl b/src/gauging.jl index 9f394243..2ad9d0f4 100644 --- a/src/gauging.jl +++ b/src/gauging.jl @@ -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...