comparison test/LazyTensors/lazy_tensor_operations_test.jl @ 1143:9275d95e2d90 refactor/grids

Merge with default
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 19 Oct 2022 22:36:02 +0200
parents 2e606d4c0ab1
children 2278730f9cee 1e8270c18edb 97dfca9ec054
comparison
equal deleted inserted replaced
1092:c4ea28d904f5 1143:9275d95e2d90
179 v = rand(2) 179 v = rand(2)
180 @test (Ã∘B̃)'*v ≈ B'*A'*v rtol=1e-14 180 @test (Ã∘B̃)'*v ≈ B'*A'*v rtol=1e-14
181 181
182 @test (Ã∘B̃*ComplexF64[1.,2.,3.,4.])[1] isa ComplexF64 182 @test (Ã∘B̃*ComplexF64[1.,2.,3.,4.])[1] isa ComplexF64
183 @test ((Ã∘B̃)'*ComplexF64[1.,2.])[1] isa ComplexF64 183 @test ((Ã∘B̃)'*ComplexF64[1.,2.])[1] isa ComplexF64
184
185 a = 2.
186 v = rand(3)
187 @test a*Ã isa TensorComposition
188 @test a*Ã == Ã*a
189 @test range_size(a*Ã) == range_size(Ã)
190 @test domain_size(a*Ã) == domain_size(Ã)
191 @test a*Ã*v == a.*A*v
184 end 192 end
185 193
186 194
187 @testset "InflatedTensor" begin 195 @testset "InflatedTensor" begin
188 I(sz...) = IdentityTensor(sz...) 196 I(sz...) = IdentityTensor(sz...)