#!/usr/bin/env python3from sympy import pprint, symbols, MatrixSymbol
m, n, l, k = symbols('m, n, l, k', integer=True)
A = MatrixSymbol('A', m, n)
B = MatrixSymbol('B', n, l)
C = MatrixSymbol('C', l, k)
X1 = (A * B * C).T
X2 = C.T * B.T * A.T
for t in [A, B, C, X1, X2, X1 == X2]:
pprint(t)
print()
入出力結果(Terminal, Jupyter(IPython))
$ ./sample9.py
A
B
C
T T T
C ⋅B ⋅A
T T T
C ⋅B ⋅A
True
$
0 コメント:
コメントを投稿