#NEWLINE# @ staticmethod #NEWLINE# def MatMul( expr , assumptions ) : #NEWLINE# #INDENT# ( factor , matrices ) = expr . as_coeff_matrices ( ) #NEWLINE# if all ( ( ask ( Q . diagonal ( m ) , expr ) for m in matrices ) ) : #NEWLINE# #INDENT# return True