Skip to content

Commit

Permalink
Fix bug in QuadraticFormNetwork constructor (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyT1994 authored May 7, 2024
1 parent df09ba5 commit d18a61f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/formnetworks/quadraticformnetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function QuadraticFormNetwork(
kwargs...,
)
blf = BilinearFormNetwork(
bra,
ket,
ket;
dual_site_index_map=dual_index_map,
dual_link_index_map=dual_index_map,
Expand Down
6 changes: 5 additions & 1 deletion test/test_forms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ using Random: Random
@test underlying_graph(operator_network(blf)) == underlying_graph(A)
@test underlying_graph(bra_network(blf)) == underlying_graph(ψbra)

qf = QuadraticFormNetwork(ψket)
@test nv(qf) == 3 * nv(ψket)
@test isempty(flatten_siteinds(qf))

qf = QuadraticFormNetwork(A, ψket)
@test nv(qf) == 2 * nv(ψbra) + nv(A)
@test nv(qf) == 2 * nv(ψket) + nv(A)
@test isempty(flatten_siteinds(qf))

v = (1, 1)
Expand Down

0 comments on commit d18a61f

Please sign in to comment.