  We develop a semidefinite programming method for the optimization of quantum
networks, including both causal networks and networks with indefinite causal
structure. Our method applies to a broad class of performance measures, defined
operationally in terms of interactive tests set up by a verifier. We show that
the optimal performance is equal to a max relative entropy, which quantifies
the informativeness of the test. Building on this result, we extend the notion
of conditional min-entropy from quantum states to quantum causal networks. The
optimization method is illustrated in a number of applications, including the
inversion, charge conjugation, and controlization of an unknown unitary
dynamics. In the non-causal setting, we show a proof-of-principle application
to the maximization of the winning probability in a non-causal quantum game.
