This notebook demonstrates the calculation of the Levi-Civita connection of a quadratic surface expressed in cartesian coordinates in the parallel propagated frame based at the origin. 

Given a symmetric matrix , we  can define a height field
 
and a quadratic surface  as the image

(*Define the matrix that will form the quadratic form*)
A = {{a, d},{d,b}};
J = {{0,-1},{1,0}};

(*Define the surface in cartesian coordinates*)
c[x_,y_]:={
x,
y,
({x,y}.A.{x,y})/2
};

DcDx = D[c[x,y],x] //Simplify;
DcDy = D[c[x,y],y] //Simplify;

Now, for this frame we calculate the first fundamental form.

g00=FullSimplify[DcDx.DcDx];
g01 = FullSimplify[DcDx.DcDy];
g11 = FullSimplify[DcDy.DcDy];

FirstFundamentalForm = {{g00,g01},{g01,g11}};

Based on the expression in the supplemental material to our submission “Discrete Torsion of Connection Forms on Simplicial Meshes” we calculate the parallel propagated frame based in the origin. We parallel propagate the standard frame along radial lines leaving the origin.

q = {x,y};
Aq = A.q;
JAq = J.Aq;
qA2q = q.A.A.q;

We showed that given a vector   in the tangent space at the origin, and a direction vector   , the parallel transported vector along the curve    is given by

V(t)==((1/(Sqrt[1+(t^2)(q^T)(A^2)q]))(((Aq)(((Aq))^T))/((q^T)(A^2)q))+(((JAq)(((JAq))^T))/((q^T)(A^2)q)))(Subscript[V, 0]),

PPFMatrix = (1/Sqrt[1+qA2q])*(Outer[Times,Aq,Aq]/qA2q)+(Outer[Times,JAq,JAq]/qA2q);

Therefore, evaluated at a point  , the parallel propagated standard frame is given by

PPFX = PPFMatrix.{1,0};
PPFY = PPFMatrix.{0,1};

Now, we can do a sanity check to ensure the orthonormality of the PPF with respect to the first fundamental form.

OrthoCheck00 = FullSimplify[PPFX.(FirstFundamentalForm.PPFX)];
OrthoCheck10 = FullSimplify[PPFY.(FirstFundamentalForm.PPFX)];
OrthoCheck11 = FullSimplify[PPFY.(FirstFundamentalForm.PPFY)];
{{OrthoCheck00, OrthoCheck10}, {OrthoCheck10, OrthoCheck11}} // MatrixForm

We can express the PPF in cartesian coordinates via
 and 
We are now aiming to find the dual Parallel-Propagated frame 
 and . We will stick to cartesian coordinates, i.e we define scalar functions ,
such that  and  is the dual frame.

The coefficients for the dual frame are given by
 :

{{λ1, μ1}, {λ2, μ2}} = Sqrt[1+qA2q](Outer[Times,Aq,Aq]/qA2q)+(Outer[Times,JAq,JAq]/qA2q);

Now, we can do a sanity check to see ensure that

check00 = FullSimplify[{λ1,μ1}.PPFX];
check10 = FullSimplify[{λ2,μ2}.PPFX];
check01 = FullSimplify[{λ1,μ1}.PPFY];
check11 = FullSimplify[{λ2,μ2}.PPFY];
{{check00, check10}, {check01, check11}} // MatrixForm

Now, we are aiming to solve the Cartan structure equations for the Levi-Civita connection. This means, we are searching for a 1-form   such that 

Here,  denotes the ordinary exterior derivative on 1-forms. It holds

DLambda1Dy = FullSimplify[D[λ1,y]];
DLambda2Dy = FullSimplify[D[λ2,y]];
DMu1Dx = FullSimplify[D[μ1,x]];
DMu2Dx = FullSimplify[D[μ2,x]];

dPPFX = FullSimplify[DMu1Dx - DLambda1Dy];
dPPFY = FullSimplify[DMu2Dx - DLambda2Dy];
dPPF = {dPPFX,dPPFY};

It holds for the wedge product

BforCartanStructure = FullSimplify[{{-μ2,λ2},{μ1,-λ1}}];

We can therefore now solve for the coefficients of the Levi-Civita connection

{ω1,ω2} = FullSimplify[LinearSolve[BforCartanStructure,-dPPF]]

Finally, we verify the simpler form of the solution given in the supplemental material:

{ω1,ω2} - Det[A]/(1 + qA2q + Sqrt[1+qA2q])(-J.q) //FullSimplify