Skip to contents

Tensor product for LazyTensor objects.

Usage

tensorprod(x, y)

Arguments

x

a LazyTensor or a ComplexLazyTensor.

y

a LazyTensor or a ComplexLazyTensor.

Value

a LazyTensor or a ComplexLazyTensor.

Details

If x and y are LazyTensor objects encoding matrices, respectively of length nx*px and ny*py, then tensorprod(x, y) encodes, symbolically, the tensor product between matrix x and y, which is a symbolic matrix of dimension (nx*ny, px*py).

Author

Chloe Serre-Combe, Amelie Vernay

Examples

if (FALSE) {
x <- matrix(c(1, 2, 3), 2, 3)       # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i')   # LazyTensor from matrix x, indexed by 'i'
y <- matrix(c(1, 1, 1), 2, 3)       # arbitrary R matrix, 200 rows, 3 columns
y_i <- LazyTensor(y, index = 'i')   # LazyTensor from matrix y, indexed by 'i'

tp_xy <- tensorprod(x_i, y_i) # symbolic (4, 9) matrix. 

}