This is a Mathematica notebook designed to allow us to compute the MTW tensor for various cost functions. Following the work of Ma, Trudinger, Wang, and many others, this tensor is important to determining if the transport maps are smooth for these cost functions.
For this, we will start with a cost function (the default uses the logarithmic cost), with an eye to building a more general notebook that can handle a greater variety of cost functions.
First clear any values that may already have been assigned to the names of the various objects to be calculated. The names of the coordinates that you use are also cleared.
First we set the dimension. We will assume that dim X=dim Y, which is necessary for our analysis.
Note that it is important not to use the symbols, i, j, k, l,p, q, r, s or n as constants or coordinates in the costs and coordinates. The reason is that the first five of those symbols are used as summation or table indices in the calculations done below, and n is the dimension of the space.
Here we define the cost function. As an example, we will use the free energy for an exponential family.
In order to prove regularity of optimal transport, one must show that for all x and y (respectively), costx and costy are injective as functions of y and x, respectively. One must also be able to invert these in order to understand the notion of cost-convexity.
This notebook was written by Gabriel Khan. It is adapted from James B. Hartle’s notebook for computing curvature of a Riemannian metric.