# Are qudit graph states well-defined for non-prime dimension?

Qudit graph states are $d$-dimension generalisations of qubit graph states such that each state is represented by a weighted graph $G$ (with no self-loops) such that each edge $(i, j)$ is assigned a weight $A_{i, j} = 0,\ldots,d-1$. The graph state associated with $G$ is then given by $$|G⟩ = \prod_{i>j} \textrm{CZ}_{i,j}^{A_{i,j}} |+⟩^{\otimes n},$$ where $|+⟩ = F^\dagger|0⟩$ and $F$ is the Fourier gate $$F = \frac{1}{\sqrt{d}}\sum_{k=0}^{d-1} \omega^{kl}|k⟩⟨l|.$$

In the literature on qudit graph states, there does not seem to be a consistency as to whether such states are defined only for $d$ prime or not. For example, some sources only give the above definition for $d$ prime, such as

whereas some do not specify any such restriction, such as

So which is correct? Are qudit graph states (well-)defined when the dimension is non-prime?

Also, if so, are they uniquely defined?

The definition you give for a graph state, and in particular the quantum Fourier transform $F$ and the controlled-$Z$ operator — where we take $Z$ to be the unitary generalisation of the Pauli $Z$ operator, satisfying $Z = F XF^\dagger$ for $X$ a shift-by-one permutation operation — are all well-defined even in composite dimension. The Fourier transform is certainly an operation of interest for arbitrary definition; the controlled-$Z$ operation is still diagonal and unitary, and still has the relevant connections to $F$ as a tensor; there is nothing about the mathematical objects themselves which become troublesome in composite dimension.
The reason why you see so much emphasis on prime dimension is essentially that composite dimension qudits are inconvenient to analyse. The reasons for this arise from number theory: particularly in the fact that in composite dimension one must worry about zero divisors. Frankly, there aren't many in the field who think of themselves as number theorists, and very few researchers (either among the authors or the readers of articles) have much patience for number systems which are not fields such as the well-loved examples of $\mathbb C$, $\mathbb R$, $\mathbb Q$, and of course the integers modulo a prime $p$, $\mathbb Z_p$. For this reason, you will rarely see references to qudits of composite dimension anywhere in the field. Even when you do, the major concern of mathematical convenience will usually motivate some other restriction.