def target_far_field(F, scaled, cheb, tree, indices, chunksize=int(1e6)):
    """Calculates the :ref:`far-field contributions <eval>` for each target.

    :param F: the :func:`far_field` contributions for each box.
    :param scaled: the :func:`scale'd` problem. 
    :param cheb: a :class:`~pybbfmm.chebyshev.Chebyshev` object.
    :param tree: a :ref:`tree <presolve>`.
    :param indices: an :ref:`indices <presolve>` dotdict.
    :return: a (n_targets,)-tensor of far-field contributions.
    """
    potentials = scaled.charges.new_zeros(len(scaled.targets))
    # Chunk the far-field calculation to avoid blowing the memory limit
    for i in range(0, len(indices.targets), chunksize):
        idx_chunk = indices.targets[i:i+chunksize]
        tgt_chunk = scaled.targets[i:i+chunksize]
        loc = 2**tree.depths[idx_chunk, None]*(tgt_chunk - tree.centers[idx_chunk])
        S = cheb.similarity(loc, cheb.nodes)
        potentials[i:i+chunksize] = (S*F[idx_chunk]).sum(-1)
    return potentials