# Definition

The structure metric is a distance function on the notes of a periodic scale within a single period, which give to it the property of being a finite metric space. If s is a periodic scale with quasiperiod P, and if c is an interval s[i+j] - s[i] with 0≤i<P, then we may define the specific interval set S(c, j) to be {i|s[i+j] - s[i] = c} with 0≤i<P, that is, indicies for the set of intervals with specific, chromatic size c and generic, scalar interval j. If #S(c, j) is the cardinality of S(c, j), then we set d(s[a], s[b]), which we will abbreviate as d(a, b), to be P - #S(|s[a] - s[b]|, |a - b|).

# Properties

The structure metric has the following properties:

1. d(a, a) = 0

1. S(|s[a] - s[a]|, |a - a|) = #S(0, 0) = P.

2. d(a, b) ≥ 0

The cardinality of #S(c, j) cannot exceed P, since 0≤i<P.

3. d(a, b) = 0 implies a equals b.

If a ≠ b and d(a, b) = 0 then #S(|s[a] - s[b]|, |a - b|)) = P, so |a - b| is a period, and |s[a] - s[b]| is an interval of repetition. However, P is the smallest period, contradiction.

4. d(a, b) = d(b, a)

d(a, b) equals P - #S(|s[a] - s[b]|, |a - b|) equals P - #S(|s[b] - s[a]|, |b - a|) equals d(b, a).

5. d(a, c) ≤ d(a, b) + d(b, c)

Suppose X is the indicator function (characteristic function) for the set S(|s[a] - s[b]|, |a - b|), Y for the set S(|s[b] - s[c]|, |b - c|), and Z for the set S(|s[a] - s[c]|, |a - c|), which we may regard as vectors in ℝ^P. Let J be the P-dimensional vector [1, 1, ..., 1] of all 1s. Then what we wish to prove may be rewritten P - Z.J ≤ (P - X.J) + (P - Y.J). This may be rewritten again as Z.J ≥ (X + Y - J).J. Every index contributing to X.Y counts as one of Z, and hence Z.J ≥ X.Y. The vector X + Y - J is 1 at an index where both X and Y are 1, is -1 when neither is 1, and 0 otherwise. Hence (X + Y - J).J is X.Y - (J - X).(J - Y), and so is less than or equal to X.Y, and hence less than or equal to Z.J.

These properties mean that the structure metric defines a finite metric space. This is a structure which has gained a certain amount of attention, particularly in terms of applications in fields requiring data analysis with an eye to similarities and differences.

# Isometry

An isometry between two metric spaces is a distance-preserving mapping; a mapping f from metric spaces X and Y such that the distance d(f(a), f(b)) in Y equals d(a, b) in X. If f is a bijection, then the isometry defines an isometric isomorphism between X and Y; in this case X and Y are said to be isometric. A metric space X is always isometric to itself by the identity map, but it may have nontrivial isometries. The isometries of X with itself define a group, the isometry group.

In the case of a finite metric space, the isometry group is defined by a permutation group on the set of points. Any finite metric space is completely characterized by the distance matrix (d(i, j)), where "i" denotes the ith point in some ordering. If S is a permutation matrix on these points, it is an element of the isometry group if and only if S⋅D = D⋅S, where the dot is matrix multiplication. In this case, D is permutation-similar to itself by S. An invariant under similarity, and hence permutation similarity in particular, is the characteristic polynomial, as well as related invariants such as the rank, eigenvalues and minimal polynomial. The characteristic polynomial tends to reflect the symmetries of the metric space and the isometry group.

An interesting example of this is given by the hexany, 1-15/14-5/4-10/7-3/2-12/7-2. This has distance matrix [[0, 4, 4, 4, 4, 5], [4, 0, 4, 4, 5, 4], [4, 4, 0, 5, 4, 4], [4, 4, 5, 0, 4, 4], [4, 5, 4, 4, 0, 4], [5, 4, 4, 4, 4, 0]]. If we set f(1) = 1, f(15/14) = 9/8, f(5/4) = 6/5, f(10/7) = 5/4, f(3/2) = 9/5 and f(12/7) = 15/8, then the distances we get from the new scale 1-9/8-6/5-5/4-9/5-15/8-2 are the same as for the hexany; this scale, the hexagon, is isometric to the hexany. Also, by mapping the hexany to itself we may find the isometry group, which turns out to be the same 48 element group of the octahedron as is also derivable from the octahedron of 7-limit interval relationships; however, in this case it has been found entirely from the structure of the interval classes and without reference to harmonic relationships. The characteristic polynomial, (x-21) (x+3)^2 (x+5)^3, reflects the high degree of symmetry of the hexany. It should be noted, however, that precise JI tuning is not required--both 27edo and 31edo, for example, are well enough in tune to give the same structure of interval classes and hence the same metric space.

Even though the group of the graph is defined entirely in terms of harmonic relationships and the isometry group entirely in terms of interval classes, in the case of the hexany they give the exact same group. Another example of this is Cps([2,3,5,7,11], 2), the 2)5 dekany, where the isometry group and the group of the graph are both 10T13. A more common situation is for the isometry group to be a subgroup of the group of the graph. For instance, star has a group of order 384 as the group of its graph, and a subgroup of order 4, a Klein 4-group, as its isometry group. Nova, which is isometric with star and has an isomorphic graph, is similar. On the other hand, scales with a clear geometric symmetry tend to have isomorphic graph groups and isometry groups. For instance, the Euler genera Euler(15^n) have the group of the square for both groups, Euler(105^n) gives the group of the cube, and the 5-limit diamond the group of the hexagon.

# Invariants

A metric invariant is a property of a metric space which is preserved under isometry. The metric invariants of the structure metric define properites of the scale from which it derives.

## Centrality

The eccentricity of a point x of a metric space (and therefore of a note of our scale) is its maximum distance from any other point in the space. The minimum eccentricity is the radius of the space, and the maximum eccentricity is the diameter. The center of the space is the set of points whose eccentricity equals the radius. This can be the whole space, and hence the whole scale, but more often it singles out some notes as of particular importance in the scale. For instance in John O'Sullivan's scale Blue, 1-15/14-9/8-6/5-5/4-4/3-7/5-3/2-8/5-5/3-9/5-15/8-2, {1, 6/5, 5/4, 3/2} is singled out as the center. A more refined measure than eccentricity is the distance degree of a point, which is the sum of the distances from that point to other points; we can use the minimum of this to define the distance degree center. In the case of Blue, that would be {1, 3/2}. Note that the importance of these notes is not derived from tuning considerations but purely from the structure of the scale.

## Roundness

The Gromov product is a construction in the theory of metric spaces, which depends on a choice of base point. For our purposes that choice won't matter, and we may assume it is the 1/1 of the scale. If x is the base point, and y and z are any points, then the Gromov product is defined to be (y, z)_x = (d(x, y) + d(x, z) - d(y, z))/2. Assuming x is 1, this becomes (y, z) = (d(1, y) + d(1, z) - d(y, z))/2. The Gromov product matrix is then G = ((i, j)) for all points x_i other than 1 (or other than 0, using logarithmic measures such as cents) taken in some order.

If d is a metric, the pth power of d for p ≥ 0 will at least be a distance function, though for some choices of p it might violate the triangle inequality. The pth power transform of the metric d leads to the p distance matrix Dp = (d(i, j)^p). This is an N dimensional symmetric square matrix, where N is the cardinality of the scale within a single period. Corresponding to it is an N-1 dimensional symmetric square matrix Gp = ((i, j)^p), the p Gromov product matrix. If Gp is positive semidefinite, then the metric space is said to have p-negative type. If it is positive definite, the space is of strict p-negative type. The space is embeddable in a Euclidean space if and only if it is of 2-negative type; and if and only if it is embeddable in a Euclidean space of N-1 dimensions but in no lesser number of dimensions, it is of strict 2-negative type. It follows that if Gp is positive semidefinite, the p/2-th power transform d^(p/2) of the metric embeds in Euclidean space, and if it is positive definite, such an embedding requires N-1 dimensions. If the space is of p-negative type, it is of strict q-negative type for any q<p. The supremum of all the exponents q where the space is of strict q-negative type is an exponent p which is of negative type but not strict negative type. This exponent is called the supremal p-negative type (and also the maximal generalized roundness.) A space (and hence for us, a scale) with a higher supremal p-negative type is "rounder", and with a lower one "flatter". Below is a listing of some scales (either JI or in some edo) by increasing roundness.

p = 1.1135814 duodene, novadene, marveldene; these are not isometric

p = 1.1366768 miller7, wilson_class, dekany-cs; these are isometric

p = 1.2651510 zeus8tri, star, nova; these are not isometric

p = 1.3404363 thirteendene

p = 1.3563125 wilson17

p = 1.3652790 centaur

p = 1.5709365 zarlino

p = 1.5865859 Cps([2,3,5,7,9,11], 3), the eikosany

p = 1.6426289 mandala, the stellated hexany.

p = 1.8225500 zeus7tri, diamond5 the 5-limit tonality diamond; these are not isometric

p = 1.8501138 raven

p = 1.9855771 blue

p = 2 exactly all MOS scales, also diamond7 the 7-limit tonality diamond

p = 2.1918973 shell5_3

p = 2.4079115 shell5-2

p = 2.7580875 Cps([2,3,5,7,11], 2) and Cps([2,3,5,7,11], 3), the 2)5 and 3)5 dekanys; these are isometric

p = 3.1062837 hexany, hexagon, isometric

p = 4.4843144 otonal and utonal pentad; isometric

p = 6.9477267 otonal and utonal heptad; isometric

p = ∞ otonal and utonal tetrad; this implies the space is ultrametric

## Sparcity

If D is the distance matrix of a finite metric space of n points, let S be the sum of elements of D. S can also be described as twice the sum of all the distances in the metric since these are counted twice in D. Then, the average distance in the space is S/(2(n-1)(n-2)), and the sparcity of the space is S/(2(n-1)^2(n-2)). The sparcity is 1 when all points are at the same distance, but otherwise less.

Tempering will often shrink distances and so increase density. For example, the duodene has a sparcity of 0.3686. Tempering by srutal, where 2048/2025 is tempered out reduces that to 0.2860, and tempering by meantone to 0.2364. Tempering both gives 12et, and the sparcity becomes 0. To give another example, pentadekany2, which is Cps([2,3,5,7,9,11], 3), has a sparcity of 0.4796; tempering out 3025/3024 lowers that to 0.4772; tempering further to portent (which tempers out 385/384, 441/440 and 1029/1024 as well as 3025/3024) lowers that to 0.4521, miracle tempering brings it down to 0.4286, and 72et brings that down to 0.4282. If A and B are two metric matricies for the same set of points, then A dominates B if A - B has all coefficients greater than or equal to zero. If A dominates B and is not identical with B, then the sparcity of A is greater than that of B. In the situation above, we may regard the notes in the tempered versions as the same points as in the untempered version, and we have chains of domination, where for instance the metric matrix for pentadekany2 dominates its tempering by 3025/3024, which dominates the tempering by portent, and so forth.