def METHOD_NAME(ndim: int) -> np.ndarray:
    """
    Produces an array with all the 2**ndim possible combinations of 0s and 1s.
    This is used later to generate all the possible combinations of backward and forward differences.
    Parameters
    ----------
    ndim : int
        The number of dimensions.
    Returns
    -------
    np.ndarray
        An array with all the 2**ndim possible combinations of 0s and 1s.
    """
    bits = np.zeros((2**ndim, ndim), dtype=np.int64)
    for i in range(ndim):
        col = (ndim - 1) - i
        for j in range(2**ndim):
            bits[j, col] = (j >> i) & 1
    return bits