def __mul__(self, rhs):
if isinstance(rhs, scipy.sparse.spmatrix):<EOL><INDENT>def qIter(qs):<EOL><INDENT>for j in range(qs.shape[<NUM_LIT:1>]):<EOL><INDENT>qi = qs.getcol(j).toarray().ravel()<EOL>yield qi<EOL><DEDENT>return<EOL><DEDENT><DEDENT>else:<EOL><INDENT>def qIter(qs):<EOL><INDENT>for j in range(qs.shape[<NUM_LIT:1>]):<EOL><INDENT>qi = qs[:, j]<EOL>yield qi<EOL><DEDENT>return<EOL><DEDENT><DEDENT>result = np.empty(rhs.shape, dtype=np.complex128)<EOL>for i, q in enumerate(qIter(rhs)):<EOL><INDENT>result[:, i] = self._solve(q)<EOL><DEDENT>return result<EOL>
Carries out the action of solving for wavefields.

Args:
    rhs (sparse matrix): Right-hand side vector(s)

Returns:
    np.ndarray: Wavefields