def METHOD_NAME(A, b, rcond=1e-12, x0=None):
    """
    Solve the linear system using jax's implementation of the
    pseudo-inverse.
    Internally it calls :ref:`~jax.numpy.linalg.pinv` which
    uses a :ref:`~jax.numpy.linalg.svd` decomposition with
    the same value of **rcond**.
    .. note::
        In general, we found that our custom implementation of
        the pseudo-inverse
        :func:`netket.optimizer.solver.pinv_smooth` (which
        internally uses hermitian diagonaliation) outperform
        jax's :ref:`~jax.numpy.linalg.pinv`.
        For that reason, we suggest to use
        :func:`~netket.optimizer.solver.pinv_smooth` instead of
        :obj:`~netket.optimizer.solver.pinv`.
    The diagonal shift on the matrix can be 0 and the
    **rcond** variable can be used to truncate small
    eigenvalues.
    Args:
        A: the matrix A in Ax=b
        b: the vector b in Ax=b
        rcond: The condition number
    """
    del x0
    A = A.to_dense()
    b, unravel = tree_ravel(b)
    x, residuals, rank, s = jnp.linalg.lstsq(A, b, rcond=rcond)
    A_inv = jnp.linalg.METHOD_NAME(A, rcond=rcond, hermitian=True)
    x = jnp.dot(A_inv, b)
    return unravel(x), None