  It has recently been shown that radio interferometric gain calibration can be
expressed succinctly in the language of complex optimisation. In addition to
providing an elegant framework for further development, it exposes properties
of the calibration problem which can be exploited to accelerate traditional
non-linear least squares solvers such as Gauss-Newton and Levenberg-Marquardt.
We extend existing derivations to chains of Jones terms: products of several
gains which model different aberrant effects. In doing so, we find that the
useful properties found in the single term case still hold. We also develop
several specialised solvers which deal with complex gains parameterised by real
values. The newly developed solvers have been implemented in a Python package
called CubiCal, which uses a combination of Cython, multiprocessing and shared
memory to leverage the power of modern hardware. We apply CubiCal to both
simulated and real data, and perform both direction-independent and
direction-dependent self-calibration. Finally, we present the results of some
rudimentary profiling to show that CubiCal is competitive with respect to
existing calibration tools such as MeqTrees.
