  The paper addresses an optimal ensemble control problem for nonlocal
continuity equations on the space of probability measures. We admit the general
nonlinear cost functional, and an option to directly control the nonlocal terms
of the driving vector field. For this problem, we design a descent method based
on Pontryagin's maximum principle (PMP). To this end, we derive a new form of
PMP with a decoupled Hamiltonian system. Specifically, we extract the adjoint
system of linear nonlocal balance laws on the space of signed measures and
prove its well-posedness. As an implementation of the designed descent method,
we propose an indirect deterministic numeric algorithm with backtracking. We
prove the convergence of the algorithm and illustrate its modus operandi by
treating a simple case involving a Kuramoto-type model of a population of
interacting oscillators.
