It would be nice to automatically generate appropriate tangents / cotangents for vectors when writing tests. We could achieve this compositionally -- define how to generate for Reals, Complexs, Arrays etc, and build from there. It would probably be as simple as a pair of functions along the lines of
rand_tangent(rng, x) # Generate an element of the tangent space of x
rand_cotangent(rng, x) # Generate an element of the cotangent space of x