Unfortunately, terminology is confusing and inconsistent. Created: October-26, 2022 . In this post, we will learn how to calculate the dot product of two vectors in TensorFlow. Dot Product Properties of Vector: Property 1: Dot product of two vectors is commutative i.e. out [i, j] = a [i] * b [j] PyTorch is an optimized tensor library majorly used for Deep Learning applications using GPUs and CPUs. etc.) In mathematics, a dyadic product of two vectors is a third vector product next to dot product and cross product. Let us formally define the tensor product now and dissect it bit by bit, following with some examples. TensorFlow Dot Product. The outer product for general tensors is also called the tensor product. Definitions and constructions. (a) The angle between the two vectors. We need to determine a . then dy equals the scalar (dot) product of these two vectors, . Tensor notation introduces one simple operational rule. . and yet tensors are rarely dened carefully (if at all), and the denition usually has to do with transformation properties, making it dicult to get a feel for these ob- My main confusion is the distinction between some other . Now form the cartesian product of X and Y, so you now have th. For example, an inertia dyadic describes the mass distribution of a body and is the sum of various dyads associated with products and moments of . The scalar product (dot product) of two vectors produces a scalar. T1 1 (V) is a tensor of type (1;1), also known as a linear operator. we cannot add these vectors. can be expressed in terms of rectangular Cartesian base vectors as In fact, that's exactly what we're doing if we think of X X as the set whose elements are the entries of v v and similarly for Y Y . Cx = ay . a : [array_like] First input vector. The outer product is also a related function in some computer programming . There are at most five nonzero elements in each row or column. In mathematics, the tensor product of two vector spaces V and W (over the same field) is a vector space to which is associated a bilinear map that maps a pair (,), , to an element of denoted .. An element of the form is called the tensor product of v and w.An element of is a tensor, and the tensor product of two vectors is sometimes called an elementary tensor or a decomposable tensor. Forming the tensor product vw v w of two vectors is a lot like forming the Cartesian product of two sets XY X Y. Figure 2.27 The scalar product of two vectors. A second-order tensor and its . This simple two-dimensional case is adequate to illustrate the curvature of space (e.g., the surface of a sphere), the di erence between contravariant and covariant vectors, and the metric tensor. For other objects a symbolic TensorProduct instance is returned. 2.28. SECOND-ORDER TENSORS . transpose. Two vectors can be multiplied together through the inner product, also known as a dot product or scalar product. For example, let us have two systems I and II with their corresponding Hilbert spaces H I and H II.Thus, using the bra-ket notation, the vectors I and II describe the states of system I and II with the state of the total system . Yes, that too. The inner product of two tensors is a generalization of the dot product operation for vectors as calculated by dot. VECTORS&TENSORS - 22. Answer (1 of 2): You can start with the Cartesian product and develop this idea (the idea of the Cartesian product) into the tensor product, as follows: 1. Then the trace operator is defined as the unique linear map mapping the tensor . Why not? 2 The Tensor Product The tensor product of two R-modules is built out of the examples given above. TensorProduct [] returns 1. The gradient g = is an example of a covariant tensor, and the differential position d = dx is an example of a contravariant tensor. Notice that example in Fig.1.1(b) is equivalent to a matrix multiplication between matrices A and B, while Fig.1.1(c) produces a rank-3 tensor D via the contraction of a network with three tensors. a.b = b.a = ab cos . A second-order tensor is one that has two basis vectors standing next to each other, and they satisfy the same rules as those of a vector (hence, mathematically, tensors are also called vectors). bx - ax . The operations and have certain affinities with those of addition and multiplication, as the notation, of course, suggest; for example, in their . The tensor product operation, which is denoted by , forms along with and Hom one of the more basic operations on linear spaces. The magnitude of the vector product is given as, Where a and b are the magnitudes of the vector and is the angle between these two vectors. However, \(a_i b_i\) is a completely different animal because the subscript \(i\) appears twice in the term. b : [array_like] Second input vector. The cross product (also known as vector product) of two vectors A and B is . A dyadic is the sum of dyads. These could be, for example, the spins of two spin-1/2 particles. . For example, let v' and w' be non-zero vectors in V and W. How can we show that v'@w' is not zero? Two examples, together with the vectors they operate on, are: The stress tensor It is one of the widely used Machine learning libraries, others . For example, product of inertia is a measure of how far mass is distributed in two directions. . The tensor product of two or more arguments. The tensor product V W of two vector spaces V and W is a vector space, containing a . Tensor product of two representations (by A.I. The matrix representation of the discrete Laplacian operator on a two-dimensional, n-by- n grid is a n*n-by- n*n sparse matrix. Even in this relatively the simple example, we see that the diagrammatic notation is already easier to interpret than the corresponding index equation. 27. They suddenly seem rather hard. Vectors, covectors and the metric Mathematical formulation. 1 When Ris a eld, an R-module is just a vector space over R. . There is no need of a Clifford gate in order to have a multi-qubit system. . That is, in position "1" in the fourth dimension, you would have 2 2 by 2 matrices, one on top of the other: And at the next place in the fourth dimension, we have. In this rule, we always consider the smaller angle that is . The tensor product is a non-commutative multiplication that is used primarily with operators and states in quantum mechanics. 2-dimensional spacetime, with two components and two basis vectors. 3Gibbs chose that label since this product was, in his words, \the most general form of product of two vectors," as it is subject to no laws except bilinearity, which must be satis ed by any operation deserving to Tensor products 27.1 Desiderata 27.2 De nitions, uniqueness, existence 27.3 First examples 27.4 Tensor products f gof maps 27.5 Extension of scalars, functoriality, naturality 27.6 Worked examples In this rst pass at tensor products, we will only consider tensor products of modules over commutative rings with identity. Ask Question Asked 3 years, 4 months ago. Say you have an m \times n matrix \mathbf{A} , and a p \times q matrix \mathbf{B} . The inner product gives the projection of one vector onto another and is invaluable in describing how to express one vector as a sum of other simpler . Input is flattened if not already 1-dimensional. Vector operations are of different types such as mathematical operation, dot product, and linspace. Thus, if. An example of shape matching, if we want to do a tensor dot with the first . out : [ndarray, optional] A location where the result is stored. In general, and hence An example using . So a i = 0 or b j = 0 ,but this not prove that a=0 or b=0. Cross product is a form of vector multiplication, performed between two vectors of different nature or kinds. where are the coordinates in an inertial referential and x the coordinates in a arbitrary referential. The usual notation for the tensor product of two vector spaces V and W is V followed by a multiplication symbol with a circle round it followed by W. . Return : [ndarray] Returns the outer product of two vectors. In other words, xy = xyT. example. In the example below, we define two order-1 tensors (vectors) with and calculate the tensor product. It is to automatically sum any index appearing twice from 1 to 3. Their Kronecker product \mathbf{A} \otimes \mathbf{B} is an mp \times nq matrix. This syntax is equivalent to using one of the previous syntaxes with dimA = dimB = [] or dim = []. For matrices, this uses matrix_tensor_product to compute the Kronecker or tensor product matrix. A vector has both magnitude and direction. The outer product of two coordinate vectors and , denoted , is a matrix such that . For example, for vectors of length 100, the last call is at least 100x slower than the previous one. scalar product of a vector and a tensor as in 1 T = n-T, (A.94) where the vector n is given as n . is the angle between both the vectors b and a. n is a unit vector perpendicular to both vectors a and b. Property 2: If a.b = 0 then it can be clearly seen that either b or a is zero or cos = 0. The tensor product is bilinear, namely linear in V and also linear in W. (If there are more than two vector spaces, it is multilinear.) The tensor product space is also a Hilbert space with the inherited inner product: This is a general property of all second order tensors. In Section5we will show how the tensor product interacts with some other . To calculate the dot product, we will use the tensordot of TensorFlow.. Tensordot is a fantastic tool for tensor operations that may be used in optimization, engineering, machine learning, and any place else multidimensional operations are required. Concisely describing the tensor product structure, or lack thereof, is vital if you want to explain a quantum computation. From this example, we see that when you multiply a vector by a tensor, the result is another vector. Here, |a| and |b| are called the magnitudes of vectors a and b and is the angle between the vectors a and b. Calling outer repeatedly doesn't matter either, since the last call will dominate both speed and memory wise. product construction. We start by dening the tensor product of two vectors. Most consist of defining explicitly a vector space that is called a tensor product, and, generally, the equivalence proof results almost immediately from the basic properties of the vector spaces that are so defined. So a tensor product is like a grown-up version of multiplication. Input is flattened if not already 1-dimensional. operation is called "taking the tensor product of the vectors of A and B", and denoted by A.4.1 Cartesian A.4.2 Cylindrical A.4.3 Spherical . I want to get the tensor product of two column vectors, for example: a = {1, 2, 3}; b = {2, 3, 1}; psi0 = ArrayFlatten[TensorProduct[a, b]]; The size of psi0 is $ 3 \times 3 $, but it should be a . G is a second order tensor. We can multiply two or more vectors by cross product and dot product.When two vectors are multiplied with each other and the product of the vectors is also a vector quantity, then the resultant vector is called the cross product of two vectors . A basis for the tensor product space consists of the vectors: {vi wj: 1 i n,1 j m}, and thus a general element of V W is of the form i,j ijvi wj This denition extends analogously to tensor products with more than two terms. For this operation, the tensors must have the same size. Let be V,W 2 K-vector spaces and a V, b W .a,b are vectors. This example visualizes a sparse Laplacian operator matrix. You can generate the matrix as the Kronecker product of one-dimensional difference operators. Denition 7.1 (Tensor product of vectors). Let us try to illustrate this by the tensor that we have used extensively so far, at least since our article Generalisation of the metric tensor in pseudo-Riemannian manifold, i.e the metric tensor. for all vectors u. Shtern) . The dyadic product is a square matrix that represents a tensor with respect to the same system of axes as to which the components of the vectors are defined that constitute the dyadic product. Thus, if. Cy = az . The function takes as arguments the two tensors to be multiplied and the axis on which to sum the products over, called the sum reduction. then the dyadic product is. This structure is important because in quantum computing, the state vector described by two uncorrelated quantum registers is the tensor products of the two state vectors. 0 (V) is a tensor of type (1;0), also known as vectors. Examples of tensor products are in Section4. Tensor Products are used to describe systems consisting of multiple subsystems. To calculate the tensor product, also called the tensor dot product in NumPy, the axis must be set to 0. More Examples: An an inner product, a 2-form or metric tensor is an example of a tensor of type (0;2) The dyadic product is a square matrix that represents a tensor with respect to the same system of axes as to which the components of the vectors are defined that constitute the dyadic product. For example, when we performed a dot product with axes = 0, the scalar value was broadcasted to each vector or tensor. Mathematically vectors are elements of a vector space over a field , and for use in physics is usually defined with = or .Concretely, if the dimension = of is finite, then, after making a choice of basis, we can view such vector spaces as or .. Consider two sets, X and Y, with elements x1, x2, x3,. 508 USEFUL VECTOR AND TENSOR OPERATIONS V x 3 x 2 x 1 e 3 e 2 e 1 V 3 = n 3e 3 V 1 = n 1e 1 V 2 = n 2e 2 Figure A.1 Vector components in the Cartesian coordinate system. Viewed 587 times 1 $\begingroup$ . Metric tensor example Metric Tensor. Figure A.4 Vector product of two vectors. They will be the products of each of the four entries in the first matrix with each of the four entries in the second matrix. The scalar product (dot product) of two vectors produces a scalar. V \tensor W \to V' \tensor W'$ in the basis consisting of the tensor products of the basis vectors. Tensor product of 2 vectors. The difference between these two kinds of tensors is how they transform under a continuous change of coordinates. Each subsystem is described by a vector in a vector space (Hilbert space). The tensor product of two vectors spaces is much more concrete . The size of the output tensor is [size (A) size (B)]. T0 1 (V) is a tensor of type (0;1), also known as covectors, linear functionals or 1-forms. However, we can multiply them to get a rank-2 tensor: Mij =AiBj = 2 6 6 4 3 1 0 2 6 2 0 4 3 1 0 2 0 0 0 0 3 7 7 5 (3) . 3.2 Vectors We use the same notation for the column vectors as in Section 2.2. in which they arise in physics. The fact that a multi-qubit system is described by the tensor produt of their state vectors comes from the fourth postulate of quantum mechanics, refer to the $94^{th}$ page of Nielsen and Chuang to see the formulation of this postulate. *\rangle \langle w|w*\rangle[/math]. 2. a Plane spanned on two vectors, b spin vector, c axial vector in the right-screw oriented reference frame will be the axial vector. As shown in the above picture, if the tail of vectors b and a begins from the origin (0,0,0), then the product of two vectors can be represented as. It suggests that either of the vectors is zero or they are perpendicular to each other. C = tensorprod (A,B) returns the outer product between tensors A and B. From the figure, we can see that there are two angles between any two vectors, that is, and (360 - ). An elementary example of a mapping describable as a tensor is the dot product, which maps two vectors to a scalar.A more complex example is the Cauchy stress tensor T, which takes a directional unit vector v as input and maps it to the stress vector T (v), which is the force (per unit area) exerted by material on the negative side of the plane orthogonal to v against the material on the . The geometric meaning of dot product says that the dot product between two given vectors a and b is denoted by: a.b = |a||b| cos . We know that a b = 0 V W. Proof that a=0 or b=0. But there are also elements of [math]V\bigotimes W[/math] that are not of the pure tensor form. I think that you misunderstood the concept of tensor product here. For any two vector spaces [math]V[/math] and [math]W[/math], the tensor product [math]V\bigotimes W[/math] is the space of bilinear functions on [math]V\times W[/math] . Let us denote the basis states of A by |A 0 and |A 1, and those of B as |B 0 and |B 1. TENSOR PRODUCT - NUMERICAL EXAMPLE Link to: physicspages home page. Doubt about tensor product of two column vectors. A = AAcos0 = A2. Of course, 2x2x2x2= 16 so this will have 16 entries. Examples: Here are some examples of R-modules. I don't use these scalar like axes modes of tensordot much. and y1, y2, y3,. From definition it will be a matrix with elements a i b j and that have to be equal 0. C = tensorprod (A,B,"all") returns the inner product between tensors A and B, which must be the same size. axes = 0: tensor product :math:a\\otimes b: tensor product a\otimes b; np.einsum('ij,kl',a,b) I can see your desired result, or at least the Out[673] version in your (2,2,2,2) array, as some sort of diagonal subset. The outer product contrasts with the inner product, which takes as input a pair of vectors and produces a scalar. Answer: The tensor product of 2 matrices is the same as their Kronecker product. Created Date: TensorProduct [x] returns x. A tensor is a linear mapping of a vector onto another vector. Modified 2 years ago. then the dyadic product is. 1.3 Tensor Products Going back to the setting of probability, suppose that we have a sample space A and a probability distribution p I was thinking of something simple such as rank-2 dyadic tensor, say in two dimensions, when two 2D vectors are "mixed" together into a 2x2 matrix aka dyadic tensor which then encodes two pieces of information coming from the two vectors, say, an angle and a direction. Magnitude of the vector product. In a previous post or two I've puzzled over them, but I don't have a . What it implies is that ~v w~ = (P n i . It is useful to compare it with these two operations. The tensor product structure implies that you can . The tensor product t 1 t n of arrays and/or symbolic tensors is interpreted as another tensor of rank TensorRank [t 1] + +TensorRank [t n]. bz - az . (b) The orthogonal projection A of vector A onto the direction of vector B. If the two vectors are orthogonal, that is, the angle between them is 90, then a.b = 0 since cos 90 = 0. For example if [math]v_1\otimes w_1+v_2 . A dot product operation (multiply and sum) is performed on all corresponding dimensions in the tensors, so the operation returns a scalar value. In particular x y is a matrix of rank 1, which . One starts defining the tensor product of two vectors in a Euclidean vector space, where a dot product is defined. The order of the vectors in a covariant tensor product is crucial, since, as once can easily verify, it is the case that (9) ab 6= ba and a0 b0 6= b0 a0. The dual space is the space of linear functionals mapping . Then the derivative of f ( v) with respect to v (or at v) is the second order tensor defined through its dot product with any vector u being. Vectors are a one-dimensional tensor, which is used to manipulate the data. Let Mand Nbe two R-modules. As such, \(a_i b_j\) is simply the product of two vector components, the i th component of the \({\bf a}\) vector with the j th component of the \({\bf b}\) vector. An example is the moment of momentum for a mass point m dened by r (mv), where r is the position of the mass point and v is the velocity of the mass point. If x,y are vectors of length M and N,respectively,theirtensorproductxy is dened as the MN-matrix dened by (xy) ij = x i y j. The tensor product of two vector spaces is a vector space that is defined up to an isomorphism.There are several equivalent ways for defining it. bz. notation, the inner product between two vectors jviand jwican be written as the matrix product hvjjwi (where the dot is usually omitted) which is suggestive of the standard notation hv;wi. This is why the word "tensor" is used for this: the basis vectors have two indices. Well, to do so directly from the quotient space definition . (and strain-rate state) at a point in the flow field are represented as a sym- metric second-order tensor, for example, by . by. As the name implies, the result of the inner product of two vectors is a scalar. Here is the formula for MN: . 11M11 = 5 (the other two diagonal elements are zero). The word tensor is ubiquitous in physics (stress ten-sor, moment of inertia tensor, eld tensor, metric tensor, tensor product, etc. It will be hard to beat the performance of outer.This ends up doing a matrix multiplication which is done by the BLAS library. The above dot product yields a vector, and if u is a unit vector gives the direction derivative of f at v, in the directional u . Tensor product of two unitary modules. = 2. In mathematics, a dyadic product of two vectors is a third vector product next to dot product and cross product. The second kind of tensor product of the two vectors is a so-called con-travariant tensor product: (10) ab0 = b0 a = X t X j a tb j(e t e j) = (a tb je j t). Stress is associated with forces and areas (both regarded as vectors). The tensor product a 1 a n of rectangular arrays a i is equivalent to Outer [Times, a 1, , a n]. Properties: If. X Y together through the inner product, and linspace broadcasted to each other that... More concrete and cross product ( dot product of two vectors is third... Of type ( 1 ; 0 ), also called the tensor product by... Be set to 0 set to 0 such as mathematical operation, scalar. The difference between these two operations matter either, since the last call tensor product of two vectors example at 100x! I b j = 0 then it can be clearly seen that either b or a is or! Product or scalar product ( dot product is also a related function in some computer programming and a... B = 0 or b j = 0, the axis must be to! A grown-up version of multiplication is used for this: the basis vectors have two indices nature... Denoted by, forms along with and Hom one of the more basic operations linear...: if a.b = 0 V W. Proof that a=0 or b=0 since the last will... How to calculate the dot product with axes = 0, but not. So directly from the quotient space definition one of the inner product, also known as vector product to. C = tensorprod ( a ) the orthogonal projection a of vector b Date: TensorProduct [ ]. Not prove that a=0 or b=0 of multiple subsystems each subsystem is described by a vector space R.! Structure, or lack thereof, is a third vector product next to product! Product structure, or lack thereof, is a third vector product next dot. Diagrammatic notation is already easier to interpret than the previous one the performance of ends... Could be, for example, the last call is at least 100x than. Product and cross product 0 V W. Proof that a=0 or b=0 same as their product. To calculate the tensor product tensor product of two vectors example and dissect it bit by bit, following with some.... Directly from the quotient space definition from definition it will be a with! Section5We will show how the tensor product - NUMERICAL example Link to: physicspages page... As mathematical operation, dot product and cross product, 2x2x2x2= 16 so this have. Kronecker or tensor, x3, is [ size ( a, b ) the orthogonal projection a of a... Scalar value was broadcasted to each vector or tensor of how far mass is distributed in two directions and.! Examples given above dot product ) of two vectors in TensorFlow of much. Definition it will be a matrix multiplication which is done by the BLAS library this example, product of vectors. Product Properties of vector multiplication, performed between two vectors is a form of multiplication. 1 when Ris a eld, an R-module is just a vector onto another vector of these two.. Euclidean vector space, where a dot product ) of two tensors is also called tensor! As the name implies, the last call is at least 100x than... Viewed 587 times 1 $ & # 92 ; otimes w_1+v_2 value was broadcasted to each vector or tensor the. Beat the performance of outer.This ends up doing a matrix of rank 1, which denoted. 16 so this will have 16 entries explain a quantum computation a product! The angle between the two vectors can be multiplied together through the inner,. Sets, x and Y, so you now have th W of two is! Implies, the last call is at least 100x slower than the corresponding equation. With dimA = dimB = [ ] or dim = [ ], an R-module is just a by... Linear mapping of a vector space ( Hilbert space ) distributed in two directions by dening the tensor of. [ tensor product of two vectors example, optional ] a location where the result is stored, 2x2x2x2= 16 so will! A V, W 2 K-vector spaces and a V, W K-vector. Primarily with operators and states in quantum mechanics.a, b are vectors vector by a space. Set to 0 how the tensor product interacts with some other some computer programming performed a dot product of. A pair of vectors and produces a scalar outer repeatedly doesn & # x27 ; t matter,... And produces a scalar [ ndarray, optional ] a location where the is... Generalization of the vectors b and is the same notation for the column vectors as in Section 2.2. which... Definition it will be a matrix multiplication which is used for this operation, the result is another vector multiplication. Dim = [ ] continuous change of coordinates, with two components and two basis vectors [ ] dim. Two coordinate vectors and, denoted, is vital if you want to explain a quantum computation a. Which takes as input a pair of vectors a and b vectors is zero or they perpendicular... Coordinate vectors and, denoted, is a generalization of the vectors b and is the between. P n i like forming the cartesian product of two vectors in TensorFlow of shape matching, if want... Of different nature or kinds in TensorFlow of 2 matrices is the same notation for the column as... Of different nature or kinds or lack thereof, is a third vector product ) of two vectors is third! Column vectors as in Section 2.2. in which they arise in physics ), called! A measure of how far mass is distributed in two directions operators and states in mechanics! Difference between these two vectors produces a scalar * & # x27 ; t use these like. Two vector spaces V and W is a matrix such that 2x2x2x2= so! Size of the previous one misunderstood the concept of tensor product is a lot forming. Vectors, Asked 3 years, 4 months ago ; 1 ), also the... You now have th calculated by dot dot product or scalar product a! Column vectors as in Section 2.2. in which they arise in physics useful to it. Is commutative i.e either, since the last call will dominate both speed and memory wise implies, the must. Tensorprod ( a ) size ( a, b ) returns the outer product a. Be equal 0 are perpendicular to both vectors a and b V W. Proof that a=0 or b=0 (., an R-module is just a vector onto another vector otimes w_1+v_2 course 2x2x2x2=. Elements a i = 0 example if [ math ] v_1 & # 92 ; begingroup.... Xy x Y t matter either, since the last call is at 100x! Of 2 matrices is the angle between the two vectors is zero or they are perpendicular each! A V, b ) returns the outer product for general tensors is they... A Clifford gate in order to have a multi-qubit system example of shape matching, we! The matrix as the Kronecker product of two vectors produces a scalar BLAS library the trace operator defined! Euclidean vector space over R. each subsystem is described by a vector space R.. Speed and memory wise tensors is also called the magnitudes of vectors a and is! Vector or tensor ; 1 ), also called the magnitudes of vectors a and and. Product V W of two spin-1/2 particles in Section5we will show how the tensor operation! Product interacts with some examples Ris a eld, an R-module is just vector... Is no need of a vector space, where a dot product operation for vectors of length,. Other two diagonal elements are zero ): [ ndarray ] returns x that have be... Definition it will be hard to beat the performance of outer.This ends up doing a matrix of rank,... ( 1 ; 0 ), also known as vector product ) of tensors... Are of different nature or kinds tensors ( vectors ) the result another... Elements are zero ) example Link to: physicspages home page two coordinate vectors and, denoted, is if... There is no need of a vector in a arbitrary referential slower the. Nature or kinds an R-module is just a vector space ( Hilbert space ) in. Vectors is a scalar a ) the angle between the vectors is zero or they are perpendicular each... Vector multiplication, performed between two vectors is a tensor of type ( 1 ; )... [ x ] returns x vector product ) of two vectors of different nature or.. And that have to be equal 0 a vector space over R. of vectors and a!, 2x2x2x2= 16 so this will have 16 entries tensors is how they transform under a continuous change of.! Commutative i.e syntaxes with dimA = dimB = [ ] or dim = [ ] or dim = ]! Computer programming 1 when Ris a eld, an R-module is just a vector space, where a product. Denoted by, forms along with and calculate the tensor product of vectors. Don & # 92 ; rangle & # 92 ; langle w|w * & x27... Otimes w_1+v_2 scalar like axes modes of tensordot much vector b zero or they are perpendicular to other... Syntax is equivalent to using one of the dot product, also known as a dot with... Calculated by dot defined as the Kronecker or tensor product here or cos = 0 then it can clearly. States in quantum mechanics b W.a, b W.a, b are vectors when a! This uses matrix_tensor_product to compute the Kronecker or tensor product, to do a of!