comparison src/LazyTensors/lazy_tensor_operations.jl @ 469:481e86e77c22 feature/outer_product

Merge in feature/infated_tensormapping
author Jonatan Werpers <jonatan@werpers.com>
date Sat, 24 Oct 2020 20:40:28 +0200
parents a52f38e72258 f270d82fc9ad
children 0c3decc04649
comparison
equal deleted inserted replaced
468:a52f38e72258 469:481e86e77c22
193 D = D_before+D_middle+D_after 193 D = D_before+D_middle+D_after
194 return new{T,R,D,D_before,R_middle,D_middle,D_after, typeof(tm)}(before, tm, after) 194 return new{T,R,D,D_before,R_middle,D_middle,D_after, typeof(tm)}(before, tm, after)
195 end 195 end
196 end 196 end
197 export InflatedTensorMapping 197 export InflatedTensorMapping
198
199 """ 198 """
200 InflatedTensorMapping(before, tm, after) 199 InflatedTensorMapping(before, tm, after)
200 InflatedTensorMapping(before,tm)
201 InflatedTensorMapping(tm,after)
201 202
202 The outer product of `before`, `tm` and `after`, where `before` and `after` are `IdentityMapping`s. 203 The outer product of `before`, `tm` and `after`, where `before` and `after` are `IdentityMapping`s.
204
205 If one of `before` or `after` is left out, a 0-dimensional `IdentityMapping` is used as the default value.
203 """ 206 """
204 InflatedTensorMapping(::IdentityMapping, ::TensorMapping, ::IdentityMapping) 207 InflatedTensorMapping(::IdentityMapping, ::TensorMapping, ::IdentityMapping)
205 # TODO: Implement constructors where one of `before` or `after` is missing 208 InflatedTensorMapping(before::IdentityMapping, tm::TensorMapping{T}) where T = InflatedTensorMapping(before,tm,IdentityMapping{T}())
209 InflatedTensorMapping(tm::TensorMapping{T}, after::IdentityMapping) where T = InflatedTensorMapping(IdentityMapping{T}(),tm,after)
210 # Resolve ambiguity between the two previous methods
211 InflatedTensorMapping(I1::IdentityMapping{T}, I2::IdentityMapping{T}) where T = InflatedTensorMapping(I1,I2,IdentityMapping{T}())
206 212
207 # TODO: Implement syntax and constructors for products of different combinations of InflatedTensorMapping and IdentityMapping 213 # TODO: Implement syntax and constructors for products of different combinations of InflatedTensorMapping and IdentityMapping
208 214
209 # TODO: Implement some pretty printing in terms of ⊗. E.g InflatedTensorMapping(I(3),B,I(2)) -> I(3)⊗B⊗I(2) 215 # TODO: Implement some pretty printing in terms of ⊗. E.g InflatedTensorMapping(I(3),B,I(2)) -> I(3)⊗B⊗I(2)
210 216