# The Z-relation in music

This (long overdue) post will introduce an important concept in mathematical music theory, which has connections to pure mathematics and crystallography, namely the Z-relation, otherwise known as homometry.

Introducing interval vectors

Before giving a general description of musical homometry, we will focus on the specific case of pitch-class sets, which was historically studied by David Lewin and Allen Forte (see below).

Let’s say we have a C major triad: we know it’s composed of the pitch classes C, E, and G. If instead we had be given a E major triad, we would have found the pitch classes E, G#, and B, in other words completely different pitch classes. However, both sound like a major triad because, obviously, they are both made of a root with stacked major and minor thirds.

So, if one focuses on the ‘major triad’ aspect of these pitch-class sets, one could say that they are less characterized by individual pitch classes than by the intervals between them. This prompted the introduction of the interval vector for a pitch-class set, an array of numbers describing the intervals present in it.

More precisely, for a given pitch-class set $S$, the interval vector $\text{iv}(S)$ of $S$ is an array of twelve coefficients $p_i$, each one describing the number of times an interval of $i$ semitones appear in $S$. Note that the definition of Wikipedia for the interval vector is slightly different as it considers an array of six coefficients instead. In fact, both definitions are equivalent since, in $\mathbb{Z}_{12}$, for any interval of $i$ semitones there will be an interval of $-i \pmod{12}$ semitones. Additionally, the definition of Wikipedia does not take into account null intervals. The definition given here makes more sense if one considers group algebras in the general definition (see below).

Thus, for the C major triad, the interval vector will be

$(3,0,0,1,1,1,0,1,1,1,0,0)$,

and of course it will be the same for the E major triad. We thus see one of the first property of the interval vector: it it is invariant by translation of the pitch-class set.

Another property follows quite intuitively. Consider minor triads: they are also made of a root and stacked major and minor thirds, but in the reverse order. This does not change anything on the interval vector though, and thus the interval vector of a C minor triad is identical to that of a C major triad. Thus we see that the interval vector is also invariant by inversion of the pitch-class set (beware, as we will soon discover, this is only valid because $\mathbb{Z}_{12}$ is an abelian group).

The Z-relation

We have just seen that the interval vector of pitch-class sets is invariant by transposition and inversion. It is natural to ask the reverse question: given two pitch-class sets which have identical interval vectors, are they transpositionally or inversionally related ?

The answer is no, and, as far as I know, it was David Lewin who first identified such cases, in an article of Journal of Music Theory:

• Lewin, David. “Re: The Intervallic Content of a Collection of Notes, Intervallic Relations between a Collection of Notes and Its Complement: An Application to Schoenberg’s Hexachordal Pieces.” Journal of Music Theory, vol. 4, no. 1, 1960, pp. 98–101

As an example, take the two pitch-class sets $S_1=\{C,C\sharp,E,F\sharp\}$ and $S_2=\{C,C\sharp,E\flat,G\}$, and try to calculate the interval vector.

Answer: for both these pitch-class sets, the interval vector is

$\text{iv}(S_1)=\text{iv}(S_2)=(4,1,1,1,1,1,2,1,1,1,1,1)$.

Whenever two pitch-class sets have the same interval vector, we say that they are Z-related, or equivalently that they are homometric. This is an interesting relation because in a sense the two sets are ‘made of the same things’ (the intervals), and thus will be somewhat perceptually similar, and yet are different in the actual pitch classes. The term Z-relation seems to have been coined by Allen Forte, and he discusses it in his book

• The Structure of Atonal Music‘, Forte, A. Yale University Press, 1973

In Forte’s notation of set classes, homometric set classes are indicated with a ‘Z’ (Forte indicates that the ‘Z’ bears no particular significance). For example, the pitch-class set $S_1$ is an instance of set class 4-Z15, while the pitch-class set $S_2$ is an instance of set class 4-Z29.

In fact, these two Z-related set classes figure proeminently in Elliott Carter‘s music, especially in his String Quarter n°2. Carter explicitly described the two Z-related chords which form the harmonic basis of his work in a postcard sent to Michael Steinberg. If you’d like more information, here are some useful references:

• Bernard, Jonathan W. “Problems of Pitch Structure in Elliott Carter’s First and Second String Quartets.” Journal of Music Theory, vol. 37, no. 2, 1993, pp. 231–266, available on JSTOR. It contains a reproduction of the above mentionned postcard.
• Elliott Carter Studies, Marguerite Boland, John Link, Cambridge University Press, 2012.
• Childs, Adrian P. “Structural and Transformational Properties of All-Interval Tetrachords“, Music Theory Online, vol. 12, no. 4, 2006, available here.

Homometry outside music theory

The name ‘Z-relation’ is specific to music theory: the general term ‘homometry’ has been actually used for the same concept in domains outside music such as crystallography and pure mathematics.

As we will see below, the Z-relation has close connections to Fourier analysis. On the other hand, crystallography also makes extensive use of Fourier analysis: the structure of crystals is often deduced from the diffraction pattern observed and measured in Fourier space.

Perhaps the oldest mention of homometry in crystallography is an article of Patterson, which also gives explicitly homometric sets in $\mathbb{Z}_n$:

• Patterson A.L. “Ambiguities in the X-Ray Analysis of Crystal Structures”, Physical Review, 65 (5-6) (1944) 195-201

The problem was later studied by crystallographers

• Bullough R.K. “On Homometric Sets. I. Some General Theorems”, Acta Crystallographica 14: 257-268,

and was finally given an extensive mathematical treatment in an article of Rosenblatt:

• Rosenblatt J. “Phase Retrieval”, Communications in Mathematical Physics 95 (1984) 317- 343

Finding the sets corresponding to a given interval vector in $\mathbb{Z}_n$ is sometimes called the ‘beltway problem‘. If the group is $\mathbb{Z}$ instead, it is then called the ‘turnpike problem‘. Both are difficult problems, and there are no exact solutions known to this date, which makes the enumeration of Z-related sets difficult as well. Brute-force approaches only gets you so far, due to combinatorial explosion.

The hexachord theorem

This is one of the oldest theorem in mathematical music theory, and was first proved in the 60s by Milton Babbitt, probably with the help of David Lewin. The theorem goes as follows.

Theorem: An hexachord in $\mathbb{Z}_{12}$ and its complement (the set of pitch-classes which do not belong to it) are Z-related.

The theorem has been proved then multiple times in various ways, and given a very short and general proof recently in a paper of Mandereau et al.:

• Mandereau, J., Ghisi, D., Amiot, E., Andreatta, M., Agon, C. ‘Z-relation and homometry in musical distributions‘, Journal of Mathematics and Music: Mathematical and Computational Approaches to Music Theory, Analysis, Composition and Performance, 5:2, 83-98, 2011.

As noticed by Amiot in his book:

• Music Through Fourier Space: Discrete Fourier Transform in Music Theory, Amiot, E., Springer, 2016.

this result is in fact known in physics from the XIXth century as Babinet’s theorem or Babinet’s principle.

Homometric tuples

From the above discussion, one might get the impression that homometric sets come in pairs. In fact, in cyclic groups $\mathbb{Z}_n$ with $n \geq 12$, one can find tuples of homometric sets.

For example, in $\mathbb{Z}_{16}$, the sets {0,1,3,5,7,8}, {0,5,7,8,9,11}, and {0,3,5,7,8,9} are homometric. This example was noticed by Lewin in a short article:

• Lewin, D. “ON EXTENDED Z-TRIPLES.” Theory and Practice, vol. 7, no. 1, 1982, pp. 38–39.

In a more recent paper by Franck Jedrzejewski and Tom Johnson,

• Jedrzejewski, F., Johnson, T., “The Structure of Z-Related Sets“, Proceedings of MCM 2013, Mathematics and Computation in Music, Springer Berlin Heidelberg, pp. 128–137

an octuple of homometric sets in $\mathbb{Z}_{24}$ is presented:

{0,1,2,4,6,9,12,16,17}    {0,1,2,4,6,9,14,17,18}    {0,1,2,4,8,9,12,14,17}
{0,1,2,4,9,10,14,17,22}    {0,1,2,4,9,14,16,17,20}    {0,1,2,6,9,10,12,14,17}
{0,1,3,5,7,8,13,16,17}    {0,1,3,5,8,9,13,15,16}

General description of the Z-relation – group algebras

So far, we have mainly seen the Z-relation for pitch-class sets in $\mathbb{Z}_{12}$, but it can be defined in any group $G$ acting simply transitively on a set $X$. In this case, the elements of $X$ can be identified bijectively with the elements of $G$ for a given choice of the element corresponding to the identity. We will not assume that the group is abelian; however we will assume that it is discrete. For a more complete treatment on continuous groups equipped with a Haar measure, see the article above by Mandereau et al.

Thanks to Lewin and his theory of Generalized Interval Systems (GIS, see the previous posts in this blog for more information), we have a well-defined notion of interval between elements in $X$. Let $g$ and $h$ be two such elements (by an abuse of notation and since the group acts simply transitively, from now on I will identify implicitly elements of $X$ to elements of $G$). If the group acts on the left, then the left interval from $g$ to $h$ is $h \cdot g^{-1}$, whereas if the group acts on the right, then the corresponding right interval is $g^{-1} \cdot h$.

So far, since we worked in the abelian group $\mathbb{Z}_{12}$, we have only seen a single definition of the Z-relation. However, in the general, non-abelian case, there are two different flavors, namely left homometry, and right homometry, depending on whether we consider left intervals or right intervals.

This is where group rings and group algebras are particularly useful. Let $K$ be a ring or a field, such as $\mathbb{R}$, and consider the group algebra $K[G]$. An multiset in $X$ can be unambiguously identified with an element of $K[G]$. For example, given the group $\mathbb{Z}_{12} = \langle z \mid z^{12}=1 \rangle$, the C major triad can be identified with the element $1+z^4+z^7$ of $\mathbb{R}[\mathbb{Z}_{12}]$.

Consider now the function which sends an element $s = \sum s_i g_i$ of $K[G]$ (where the $s_i$ are coefficients in $K$) to the element $\bar{s} = \sum \bar{s_i} g_i^{-1}$ of $K[G]$, where $\bar{s_i}$ is the complex conjugate of $s_i$ (if $K$ is not $\mathbb{C}$, this is simply $s_i$). Then the left interval vector of $s$ is given by the left interval vector function $\text{iv}_l \colon K[G] \to K[G]$ such that

$\text{iv}_l(s) = s \cdot \bar{s}$.

Similarly, the right interval vector of $s$ is given by the right interval vector function $\text{iv}_r \colon K[G] \to K[G]$ such that

$\text{iv}_r(s) = \bar{s} \cdot s$.

Obviously, if $G$ is abelian, these two notions coincide.

For example, given our C major triad $s=1+z^4+z^7$, we have

$\text{iv}(s) = (1+z^4+z^7)(1+z^{-4}+z^{-7})$,

which is

$\text{iv}(s) = 1+z^4+z^7+z^8+1+z^3+z^5+z^9+1$,

which corresponds to the interval vector introduced previously.

The left translate of an element $s$ of $K[G]$ by an element $h$ of $G$ is the element $hs$ of $K[G]$. Similarly, the right translate of an element $s$ of $K[G]$ by an element $h$ of $G$ is the element $sh$ of $K[G]$. It can be quickly verified that we have the following properties.

$\text{iv}_l(sh) = \text{iv}_l(s)$ and $\text{iv}_r(hs) = \text{iv}_r(s)$.

In the non-abelian case, we will thus say that two elements of $K[G]$ are non-trivially left homometric, if they have identical left interval vectors and if they are not right translate of each other. Similarly, we will say that two elements of $K[G]$ are non-trivially right homometric, if they have identical right interval vectors and if they are not left translate of each other.

In the abelian case, observe additionally that $s \bar{s} = \bar{s} s$. In other words, the inversion of an element $s$ of $K[G]$ has the same interval vector as $s$. Thus, we will say that two elements of $K[G]$ are non-trivially homometric, if they have identical interval vectors and if they are not translate or inversion of each other. We thus recover the properties introduced above.

As an example of left- and right-homometry in non-abelian groups, we can take the case of our well-known dihedral group $D_{24}$ acting simply transitively on the set of major and minor triads. Consider the set consisting of the chords C minor, D flat major, E flat major, E minor, and A flat minor on one hand, and the set consisting of the chords C minor, E flat major, E minor, F major, and A flat minor on the other hand. As one can verify from the diagram below, the interval vector for the action of $D_{24}$ corresponding to that of the $T\text{/}I$ group (the left action of $D_{24}$) is the same for both sets, i.e. these two sets of chords are left-homometric.

It so happens that these two sets of chords are also right-homometric for the right action of $D_{24}$, i.e. the action of the $PRL$ group (the neo-Riemannian group) on the set of major and minor triads, as one can check from the diagram below.

These examples, and the general consideration of homometry in the dihedral groups were the subject of a recent paper by Grégoire Genuys and I, that we presented at the MCM 2017 conference last year.

• Genuys G., Popoff A. , “Homometry in the Dihedral Groups: Lifting Sets from Zn to Dn“, In: Agustín-Aquino O., Lluis-Puebla E., Montiel M. (eds) Mathematics and Computation in Music. MCM 2017. Lecture Notes in Computer Science, vol 10527, pp. 38-49, Springer.

The fact that these sets are both left- and right-homometric is not a generality: there are sets which are only left homometric. Through brute-force computations, we gave a partial enumeration of homometric sets of cardinality $p$ in the dihedral groups $D_{2n}$, for $k$ from 4 to 7, and $n$ from 8 to 18.

Note that we are not restricted to chords: Lewin studied a group acting simply transitively on time-spans, named (appropriately) the time-span group. A time-span, as defined by Lewin, is a couple $(t,\Delta)$, with $t \in \mathbb{R}$, and $\Delta \in \mathbb{R}_{>0}$. The group $G = (\mathbb{R},+) \rtimes (\mathbb{R}_{>0},x)$ acts simply transitively on the set of time-spans, either on the left, by the action of a group element $(u,\delta)$ given by

$(u,\delta).(t,\Delta) = (u+\delta t, \delta \Delta),$

or on the right, by

$(t,\Delta).(u,\delta) = (t+\Delta u, \Delta \delta).$

The two rhythms given below are right-homometric for the right action of the time-span group.

However, these two sets of time-spans are not left-homometric. In fact, I propose the following open problem.

Conjecture: there is no simultaneous left and right non-trivial homometric sets of time-spans for the action of the time-span group.

Fourier transforms

As I mentionned many times above, the notion of homometry is closely related to that of the Fourier transform. To see this in the general case, assume we have a unitary representation $\rho \colon G \to \text{GL}(V)$ of the group $G$, where $V$ is a vector space on $K$.

For a given element $s$ of $K[G]$, define $\widehat{s}(\rho) \in \text{End}(V)$  as

$\widehat{s}(\rho) = \sum s_i \rho(g_i)$.

Then we can observe that we have

$\widehat{\text{iv}_l(s)}(\rho) = \sum_{i,j} s_i s_j \rho(g_i g_j^{-1}) = \sum_i s_i \rho(g_i) \sum_j s_j \rho(g_j^{-1})$,

and since $\rho$ is unitary, we have

$\widehat{\text{iv}_l(s)}(\rho) = \sum_i s_i \rho(g_i) \sum_j s_j \rho^{-1}(g_j) = \sum_i s_i \rho(g_i) \sum_j s_j \rho^{*}(g_j)$,

or equivalently

$\widehat{\text{iv}_l(s)}(\rho) = \widehat{s}(\rho) \widehat{s}(\rho)^{*}$.

Similarly, we have

$\widehat{\text{iv}_r(s)}(\rho) = \widehat{s}(\rho)^{*} \widehat{s}(\rho)$.

If $G$ is a cyclic group, this coincides with the discrete Fourier transform, and we thus obtain the following theorem.

Theorem: two subsets of $\mathbb{Z}_n$ are homometric iff they have the same magnitude on all their Fourier coefficients.

With Fourier analysis in hand, it seems that the question of finding homometric subsets might have an easier answer. In particular, we have the following result due to Rosenblatt. Let’s denote by $\widehat{S_1}$ and $\widehat{S_2}$ the Fourier transforms of two elements $S_1$ and $S_2$ of $K[\mathbb{Z}_n]$ where $K$ is a subfield of $\mathbb{C}$. We start with a definition.

Definition: an element $U$ of $K[\mathbb{Z}_n]$ is called a spectral unit iff the magnitude of all its Fourier coefficients is equal to 1.

The theorem of Rosenblatt then asserts the following result.

Theorem: Two elements $S_1$ and $S_2$ of $K[\mathbb{Z}_n]$ are homometric iff there is a spectral unit $U$ of $K[\mathbb{Z}_n]$ such that $\widehat{S_2} =\widehat{U}\widehat{S_1}$.

When enumerating homometric subsets of $\mathbb{Z}_n$, the only problem with this approach comes from the fact that

• spectral units are not necessarily of finite order
• applying a spectral unit of finite order does not necessarily gives an element of $K[\mathbb{Z}_n]$ with 0-1 coefficients, in other words a subset of $\mathbb{Z}_n$.

For more information about spectral units and their use in music theory, I invite you to read the above references by Amiot, as well as this recent paper which is a very good introduction:

• Amiot E., “Strange Symmetries“. In: Agustín-Aquino O., Lluis-Puebla E., Montiel M. (eds) Mathematics and Computation in Music. MCM 2017. Lecture Notes in Computer Science, vol 10527, pp. 135-150, Springer.

As an example of a spectral unit, take the element of $\mathbb{R}[\mathbb{Z}_n]$ whose Fourier coefficients are all equal to -1, except for the first one which is equal to 1. This is the element of $\mathbb{R}[\mathbb{Z}_n]$ whose coefficients are equal to $2/n$ except for the first one, which is equal to $2/n-1$. Obviously, this spectral unit is of order 2. Applying this spectral unit to any subset of $\mathbb{Z}_n$ takes it to its complement, thus providing another (convoluted (!)) demonstration of the hexachord theorem.

Enumeration of homometric sets – cyclic and dihedral groups

As stated above, the enumerate of homometric sets for a given group is a difficult problem and no general solution is currently known. As a partial result, Rosenblatt gave a classification of all homometric subsets of $\mathbb{Z}_n$ of cardinality 4. Though recipes are known to build homometric sets, these do not guarantee that all will be found, and for such a goal we have to resort to brute-force computations.

One could wonder whether the equivalence classes of the Z-relation could be the orbits of some group action. Of course, one can take the direct sum of the permutation groups of the equivalence classes, which supposes that one has already computed these classes, and leads to huge and not so interesting groups. On the other hand, if we try to find a more ‘reasonable’ group action, an interesting theorem by Mandereau in this paper

• Mandereau, J., Ghisi, D., Amiot, E., Andreatta, M., Agon, C. ‘Discrete phase retrieval in musical structures‘, Journal of Mathematics and Music: Mathematical and Computational Approaches to Music Theory, Analysis, Composition and Performance, 5:2, 99-116, 2011.

is the following one.

Theorem. Let $n \in \mathbb{N}$ with $n \geq 2$. If $n=8$, $n=10$ or $n \geq 12$, then for every field $K$ and for every subgroup $H$ of the linear group $\text{GL}_n(K)$ such that the natural group action of $n$ on $\mathcal{P}(\mathbb{Z}_n)$ identified with $\{0,1\}^n$ is well-defined, the orbits of this group action are not identical with the equivalence classes of the Z-relation.

In his paper,

• Jedrzejewski, F., Johnson, T., “The Structure of Z-Related Sets”, Proceedings of MCM 2013, Mathematics and Computation in Music, Springer Berlin Heidelberg, pp. 128–137,

Franck Jedrzejewski gave an enumeration of homometric sets in cyclic groups $\mathbb{Z}_n$ for all cardinalities, for $n$ from 8 to 23 (and partial enumeration for $n=24$), and mentions that Jon Wild has enumerated them for $n$ up to 31, but I have been unable to find the corresponding paper. I coded my own program in C to perform the enumeration, and managed to get all homometric sets fro $n$ up to 27 (and partial enumeration for $n=28$). The C code is available on this GitHub repository, along with the results of the enumeration.

As I mentionned earlier, I have also worked with Grégoire Genuys on the enumeration of homometric sets in dihedral groups: we gave a partial enumeration of homometric sets of cardinality $p$ in the dihedral groups $D_{2n}$, for $k$ from 4 to 7, and $n$ from 8 to 18. The code for this brute-force enumeration is available on this GitHub repository, along with the corresponding results.

Reference

This was a rapid overview of the Z-relation in music, with only the basic results. I recapitulate below the references given, and add new ones, for those interested in the subject.

• Lewin, David. “Re: The Intervallic Content of a Collection of Notes, Intervallic Relations between a Collection of Notes and Its Complement: An Application to Schoenberg’s Hexachordal Pieces.” Journal of Music Theory, vol. 4, no. 1, 1960, pp. 98–101
• Lewin, D. “ON EXTENDED Z-TRIPLES.” Theory and Practice, vol. 7, no. 1, 1982, pp. 38–39.
• Rosenblatt J. “Phase Retrieval”, Communications in Mathematical Physics 95 (1984) 317- 343
• Soderberg S. “Z-Related Sets as Dual Inversions”, Journal of Music Theory, 39 (1) (1995) 77-100.
• O’Rourke J., Taslakian, P., Toussaint G., “A pumping lemma for homometric rhythms”, Proceedings of the 20th Canadian Conference on Computational Geometry (2008) 121–123.
• Mandereau, J., Ghisi, D., Amiot, E., Andreatta, M., Agon, C. ‘Z-relation and homometry in musical distributions‘, Journal of Mathematics and Music: Mathematical and Computational Approaches to Music Theory, Analysis, Composition and Performance, 5:2, 83-98, 2011.
• Mandereau, J., Ghisi, D., Amiot, E., Andreatta, M., Agon, C. ‘Discrete phase retrieval in musical structures‘, Journal of Mathematics and Music: Mathematical and Computational Approaches to Music Theory, Analysis, Composition and Performance, 5:2, 99-116, 2011.
• The z-relation in theory and practice, Goyette, J., Ph.D. dissertation, University of Rochester, 2012.
• Jedrzejewski, F., Johnson, T., “The Structure of Z-Related Sets“, Proceedings of MCM 2013, Mathematics and Computation in Music, Springer Berlin Heidelberg, pp. 128–137.
• Johnson T., Jedrzejewski F. Looking at Numbers, Birkhauser, 2013
• Music Through Fourier Space: Discrete Fourier Transform in Music Theory, Amiot, E., Springer, 2016.
• Amiot E., “Strange Symmetries“. In: Agustín-Aquino O., Lluis-Puebla E., Montiel M. (eds) Mathematics and Computation in Music. MCM 2017. Lecture Notes in Computer Science, vol 10527, pp. 135-150, Springer.
• Genuys G., Popoff A. , “Homometry in the Dihedral Groups: Lifting Sets from Zn to Dn“, In: Agustín-Aquino O., Lluis-Puebla E., Montiel M. (eds) Mathematics and Computation in Music. MCM 2017. Lecture Notes in Computer Science, vol 10527, pp. 38-49, Springer.