@staticmethod
def flatten_dim(dim):
    """Given a `dim` for a single index that may be divided between
        sectors, return a flattened dim, that has just the total dimension of
        the index.
        """
    try:
        return sum(dim)
    except TypeError:
        return dim
