def METHOD_NAME(fields, index, length):
    index_obj = index.v_obj[0]
    return fields_to_tensors(
        fields, lambda s: s[0].grid.globalsum(cgpt.lattice_rank_indexed_sum(s, index_obj, length))
    )