'Solves Ax = B efficiently, where A is a diagonal Matrix,
with non-zero diagonal entries.
Examples
>>> from sympy.matrices import Matrix, eye
>>> A = eye(2)*2
>>> B = Matrix([[1, 2], [3, 4]])
>>> A.diagonal_solve(B) == B/2
True
See Also
lower_triangular_solve
upper_triangular_solve
gauss_jordan_solve
cholesky_solve
LDLsolve
LUsolve
QRsolve
pinv_solve'

def diagonal_solve(self, rhs):

    if (not self.is_diagonal):
        raise TypeError('Matrix    should    be    diagonal')
    if (rhs.rows != self.rows):
        raise TypeError('Size    mis-match')
    return self._diagonal_solve(rhs)
