Finding Kronecker product of two matrices

Hey guys,

So I am just wondering whether there is an existing function to find the Kronecker product of two matrices? Here is a Chinese article on that:

https://blog.csdn.net/P_LarT/article/details/101066757

in which they used einsum to achieve this. Though direct function would be much faster as tbh I don’t think einsum is efficient. So is there one? Thanks.

Hi,

The article you link has a link to this forum. In particular this discussion Kronecker Product that seem to contain the answer you seek.

I was thinking function based on einsum won’t be efficient?

Why not?

Also the post you sent has a code sample with ger and reshape which does not use einsum.

idk just intuitively I don’t think it’s using vectorization… nvm if it doesn’t matter

It is doing its best to. But it is not perfect indeed.

But ger + reshape will give you what you want :slight_smile: