Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimbrand committed Dec 27, 2024
1 parent 41d6619 commit c44b3f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/G2MomCorrelator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ end

function Base.show(io::IO, g::G2MomCorrelator{C}) where {C}
if C == 1
print(io, "G2MomCorrelator($(g.d),:first)")
print(io, "G2MomCorrelator($(g.d), :first)")
elseif C == 2
print(io, "G2MomCorrelator($(g.d),:second)")
elseif C == 3
print(io, "G2MomCorrelator($(g.d),:cross)")
print(io, "G2MomCorrelator($(g.d), :second)")
else # C == 3 is the default value and handled in Rimu.jl
@error "G2MomCorrelator{$C} is not implemented!"
end
end

Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ using RimuLegacyHamiltonians: bose_hubbard_2c_interaction
@test diagonal_element(g0s, bfs2) == 1 / 3
test_operator_interface(G2MomCorrelator(3), BoseFS(1, 2, 0, 3, 0, 4, 0, 1))
test_operator_interface(G2MomCorrelator(2), BoseFS2C(BoseFS{1,3}((0, 1, 0)), BoseFS{2,3}((1, 0, 1))))
test_operator_interface(G2MomCorrelator(2, :first), BoseFS2C(BoseFS{1,3}((0, 1, 0)), BoseFS{2,3}((1, 0, 1))))
test_operator_interface(G2MomCorrelator(2, :second), BoseFS2C(BoseFS{1,3}((0, 1, 0)), BoseFS{2,3}((1, 0, 1))))
@test G2MomCorrelator(3, :cross) == G2MomCorrelator(3)
end

end

0 comments on commit c44b3f9

Please sign in to comment.