def to_scipy_sparse(m, **options):
    dtype = options.get('dtype', 'complex')
    if isinstance(m, (Matrix, Expr)):
        return sympy_to_scipy_sparse(m, dtype=dtype)
    elif isinstance(m, numpy_ndarray):
        if not sparse:
            raise ImportError
        return sparse.csr_matrix(m)
    elif isinstance(m, scipy_sparse_matrix):
        return m
    raise TypeError('Expected sympy/numpy/scipy.sparse matrix, got: %r' % m)
Return a NetworkX MultiGraph or MultiDiGraph from a dot file on path.
dataset/ETHPy150Open sympy/sympy/sympy/physics/quantum/matrixutils.py/to_scipy_sparse--crossover with--dataset/ETHPy150Open networkx/networkx/networkx/drawing/nx_pydot.py/read_dot