gcc m.c mm.c mc.c g3.c g2.c cp.c d.c rdx.c -Wmost -fnested-functions

To embed a brane in the linking space we first embed it in a home vector space with just enough dimensions. We take the icosohedron to represent S2 and endow its vertices with coordinates in R3. Routine g3 in g3.c does this. One extra dimension suffices for each of our cases. A Klein bottle would require 2 extra dimensions but we stick to oriented branes.

Type bp, the ‘brane pack’

Type bp is a ‘brane pack’ represented as a topological complex.
typedef struct {int d; int vc; R * wh; int sc; short * c;} bp;
A bp holds:
d
the dimensionality of the home space of the brane, (d = 3 for S2!)
vc
the vertex count
wh
which locates the vc-by-d array of coordinates of the brane in d space
sc
the number of simplex elements of the brane
c
the sc-by-d array defining the simplexes by providing indexes into the wh array.

Suppose we place an image of Sm centered at the origin and an image of Sn at (1, 0, 0, ...) in Rk space. Recall that k=m+n+1. The m+1 coordinates of points on Sm become the first m+1 components of the points in the image and the rest of those k coordinates are 0. Of the n+1 coordinates of Sn, the first is incremented by 1 and becomes the first coordinate in Rk. The other n coordinates become the last n coordinates of the image of Sn in Rk and the other coordinates of points in the image of Sn are 0. This is the simplest linking of Sm and Sn. We shall need to test less simple mutual orientations of the branes.

This formulation fails to capture the orientation and boundaryness for 0-branes. I could decree alternating orientations for the array c but that would add otherwise unneeded hair to the code.

Type mat

typedef struct{R* a; int m; int n;} mat; // a[m, n]
This describes a matrix including the matrix size. Expressions such as (mat){(R*)cnta, a.sc, k} produce a value of type mat which locates storage to store a a.sc-by-k array of reals. This construct partly ameliorates C’s lack of a first class array type. Type mat is a matrix with dope info.
If w is of type mat and 0≤i<w.m and 0≤j<w.n, then a[i, j] of the matrix may be accessed as w.a[i*w.n + j].

m.c Logic

Identifiers a and b denote brane packs which we embed and link in a common k dimensional Euclidian space.

Routine ob takes a d-by-k matrix and post multiplies it by the vc-by-d array of vertex coordinates to embed the brane in the k space. Argument vo is a vector offset to the embedding. Then the k dimensional coordinates of the centroids of the simplexes are computed and placed in an array of centroids, access to which is passed to ob as parameter cen.

Routine di performs the integral numerically. Its argument, dc, is the amount that the 2nd brane is offset in the host space. For currently defined branes an offset of 1 causes simple linking and 3 leaves branes unlinked.

D is the determinant of the theory. It is filled in by rows from each brane.

vog generates such a vector offset.

mm.c Logic

void mm(mat A, mat B, mat C);
mm(A, B, C) replaces matrix A by the product of B and C.

mc.c (Monte Carlo) Logic

This file defines
R smp(R* w, int a, int b)
The input is the matrix of the determinant whose first a rows are the Grassmann value of the first brane element, and the next b do the same for the second element. The last row is the offset from the origin of the first to that of the second. The matrix holds exacty the necessary floating values and in the most convenient format. smp chooses a random point within each element and returns the distance2 between them. This is how we choose a random point in a simplex.

Various Specific Branes

Each of these routines return a brane pack. The bounding box of each of these branes in their home d-space is [−1, 1]d. The brane is currently chosen by editing file m.c.

g2.c Logic

This file defines two brane generators: g2 for S1 which is the simple unit circle, and g1 for S0 = {−1, 1}. gx generates half of S0 which is convenient for testing and can be said to have a boundary.

g3.c Logic

g3 generates an icosohedron of radius about 1. wh is the array of vertex locations—vertices are designated by indexes into wh. Routine nr serves as a two vertex predicate that tells whether two vertices are neighbors based on the distance between them. To identify the triangles that compose the icosohedron we consider each triple of vertices and demand that they be pairwise neighbors. The determinant’s sign merely provides the orientation. g3t Generates a regular tetrahedron.

cp.c Logic

gcp in cp.c generates a cross polytope in n dimensions.
File b.c is a modification to the original to more closely mimic the logic of m.c for debugging the latter.

Monte Carlo:

0-brane and 1-brane dc= 1.0 calc =    6.283334891, theory =    6.283185307
0-brane and 1-brane dc= 3.0 calc =   -0.000542771, theory =    0.000000000
1-brane and 1-brane dc= 1.0 calc =  -12.566503628, theory =   12.566370614
1-brane and 1-brane dc= 3.0 calc =    0.000156182, theory =    0.000000000
1-brane and 2-brane dc= 1.0 calc =  -19.731063564, theory =   19.739208802
1-brane and 2-brane dc= 3.0 calc =   -0.003278915, theory =    0.000000000
2-brane and 2-brane dc= 1.0 calc =  -26.845032778, theory =   26.318945070
2-brane and 2-brane dc= 3.0 calc =   -0.005318088, theory =    0.000000000
1-brane and 2-brane dc= 1.0 calc =  -19.754757507, theory =   19.739208802
1-brane and 2-brane dc= 3.0 calc =   -0.000109265, theory =    0.000000000
2-brane and 2-brane dc= 1.0 calc =  -26.113799444, theory =   26.318945070
2-brane and 2-brane dc= 3.0 calc =    0.000423140, theory =    0.000000000
3-brane and 1-brane dc= 1.0 calc =   26.338628710, theory =   26.318945070
3-brane and 1-brane dc= 3.0 calc =    0.000034420, theory =    0.000000000
2-brane and 3-brane dc= 1.0 calc =   31.149650639, theory =   31.006276680
2-brane and 3-brane dc= 3.0 calc =    0.000133819, theory =    0.000000000