comparison test/LazyTensors/lazy_tensor_operations_test.jl @ 1086:74c54996de6a

Merge feature/scalar_times_tensor
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Sun, 08 May 2022 11:35:22 +0200
parents 2e606d4c0ab1
children 2278730f9cee 1e8270c18edb 97dfca9ec054
comparison
equal deleted inserted replaced
1082:9abb140a4636 1086:74c54996de6a
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...)