Skip to content

Commit

Permalink
Enhance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jofrevalles committed Nov 20, 2024
1 parent 4c28ab9 commit 7612188
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/MPS_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ using LinearAlgebra
ψ = rand(MPS; n=5, maxdim=16)
canonize!(ψ)

truncated = truncate(ψ, [site"2", site"3"]; maxdim=2)
truncated = truncate(ψ, [site"2", site"3"]; maxdim=2, recanonize=true)
@test size(truncated, inds(truncated; bond=[site"2", site"3"])) == 2
@test Tenet.check_form(truncated)
end

@testset "MixedCanonical" begin
Expand Down Expand Up @@ -311,6 +312,7 @@ using LinearAlgebra
canonize!(ψ)
evolved = evolve!(deepcopy(ψ), gate)

@test Tenet.check_form(evolved)
@test isapprox(contract(evolved), contract(ϕ)) # Identity gate should not change the state

# Ensure that the original MixedCanonical state evolves into the same state as the canonicalized one
Expand Down

0 comments on commit 7612188

Please sign in to comment.