Home Online Manual
Top
Back: symmat
Forward: unitmat
FastBack: Linear algebra
FastForward: linalg_lib
Up: matrix_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.3.1.13 tensor

Procedure from library matrix.lib (see matrix_lib).

Usage:
tensor(A,B); A,B matrices

Return:
matrix, tensor product of A and B

Example:
 
LIB "matrix.lib";
ring r=32003,(x,y,z),(c,ds);
matrix A[3][3]=1,2,3,4,5,6,7,8,9;
matrix B[2][2]=x,y,0,z;
print(A);
==> 1,2,3,
==> 4,5,6,
==> 7,8,9 
print(B);
==> x,y,
==> 0,z 
print(tensor(A,B));
==> x, y, 2x,2y,3x,3y,
==> 0, z, 0, 2z,0, 3z,
==> 4x,4y,5x,5y,6x,6y,
==> 0, 4z,0, 5z,0, 6z,
==> 7x,7y,8x,8y,9x,9y,
==> 0, 7z,0, 8z,0, 9z