I have a simple issue. I want to shorten the expression of the kronecker product
a=np.matrix('1 0; 0 1')
b=np.matrix('1 0; 0 1')
C=np.kron(a,b)
to something like this
C=a.k(b)
I have been flogging google for a while, but I do not quite find the solution to this. I understand that there are workarounds which work perfectly fine, but I would like to understand how to add a function to a numpy object like this. Or any object. I want to learn, not do.
Any ideas? Thanks in advance!