1 | initial version |
Jere is a way to get kernel of the corresponding linear system:
D = A.T*X - X.T*A
M = Matrix(ZZ,0,len(X.list()))
for d in D.list():
if d:
M = M.insert_row(0,[ZZ(d.coefficient(x)) for x in X.list()])
print( M.right_kernel().basis() )
2 | No.2 Revision |
Jere Here is a way to get kernel of the corresponding linear system:
D = A.T*X - X.T*A
M = Matrix(ZZ,0,len(X.list()))
for d in D.list():
if d:
M = M.insert_row(0,[ZZ(d.coefficient(x)) for x in X.list()])
print( M.right_kernel().basis() )
3 | No.3 Revision |
Here is a way to get kernel of the corresponding linear system:
D = A.T*X - X.T*A
M = Matrix(ZZ,0,len(X.list()))
Matrix([[ZZ(d.coefficient(x)) for x in X.list()] for d in D.list():
if d:
M = M.insert_row(0,[ZZ(d.coefficient(x)) for x in X.list()])
D.list()])
print( M.right_kernel().basis() )
4 | No.4 Revision |
Here is a way to get kernel of the corresponding linear system:
D = A.T*X - X.T*A
M = Matrix([[ZZ(d.coefficient(x)) for x in X.list()] for d in D.list()])
print( M.right_kernel().basis() )
ADDED. If in addition one also wants $AX^T-XA^T = 0$, then
D1 = A.T*X - X.T*A
D2 = A*X.T - X*A.T
M = Matrix([[ZZ(d.coefficient(x)) for x in X.list()] for d in D1.list()+D2.list()])
print( M.right_kernel().basis() )
5 | No.5 Revision |
Here is a way to get a basis of the kernel of the corresponding linear system:
D = A.T*X - X.T*A
M = Matrix([[ZZ(d.coefficient(x)) for x in X.list()] for d in D.list()])
print( M.right_kernel().basis() )
ADDED. If in addition one also wants $AX^T-XA^T = 0$, then
D1 = A.T*X - X.T*A
D2 = A*X.T - X*A.T
M = Matrix([[ZZ(d.coefficient(x)) for x in X.list()] for d in D1.list()+D2.list()])
print( M.right_kernel().basis() )
6 | No.6 Revision |
Here is a way to how we get a the basis of the kernel of the corresponding linear system:
D solutions to ${ A^TX = A.T*X - X.T*A
M = Matrix([[ZZ(d.coefficient(x)) for x in X.list()] for d in D.list()])
print( M.right_kernel().basis() )
ADDED. If in addition one also wants $AX^T-XA^T = 0$, thenX^TA, AX^T=XA^T }$:
D1 = A.T*X - X.T*A
D2 = A*X.T - X*A.T
M V = Matrix([[ZZ(d.coefficient(x)) [x for x in X.list()] X.list() if x] # variables
M = Matrix([[d.coefficient(x) for x in V] for d in D1.list()+D2.list()])
print( M.right_kernel().basis() B = [X.subs(zip(V,b)) for b in M.right_kernel().basis()]
assert all( A.T*x == x.T*A and A*x.T == x*A.T for x in B )
print(B)
7 | No.7 Revision |
Here is how we get the basis of the solutions to ${ $\{ A^TX = X^TA, AX^T=XA^T }$:\}$:
D1 = A.T*X - X.T*A
D2 = A*X.T - X*A.T
V = [x for x in X.list() if x] # variables
M = Matrix([[d.coefficient(x) for x in V] for d in D1.list()+D2.list()])
B = [X.subs(zip(V,b)) for b in M.right_kernel().basis()]
assert all( A.T*x == x.T*A and A*x.T == x*A.T for x in B )
print(B)