Skip to content

Commit

Permalink
Bra_ket vertices function
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyT1994 committed Feb 12, 2024
1 parent 6418fa4 commit c6592f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/FormNetworks/abstractformnetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dual_index_map(f::AbstractFormNetwork) = not_implemented()
tensornetwork(f::AbstractFormNetwork) = not_implemented()
copy(f::AbstractFormNetwork) = not_implemented()
derivative_vertices(f::AbstractFormNetwork) = not_implemented()
bra_ket_vertices(f::AbstractFormNetwork, state_vertices::Vector) = not_implemented()

bra(f::AbstractFormNetwork) = induced_subgraph(f, collect(values(bra_vertex_map(f))))
ket(f::AbstractFormNetwork) = induced_subgraph(f, collect(values(ket_vertex_map(f))))
Expand Down
4 changes: 4 additions & 0 deletions src/FormNetworks/quadraticformnetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function QuadraticFormNetwork(
return QuadraticFormNetwork(operator, ket; kwargs...)
end

function bra_ket_vertices(qf::QuadraticFormNetwork, state_vertices::Vector)
return vcat(bra_vertices(qf, state_vertices), ket_vertices(qf, state_vertices))
end

function update(qf::QuadraticFormNetwork, state_vertex, state::ITensor)
qf = copy(qf)
state_inds = inds(state)
Expand Down

0 comments on commit c6592f7

Please sign in to comment.