An Anomaly-free Atlas: charting the space of flavour-dependent gauged $U(1)$ extensions of the Standard Model

Spontaneously broken, flavour-dependent, gauged $U(1)$ extensions of the Standard Model (SM) have many phenomenological uses. We chart the space of solutions to the gauge anomaly cancellation equations in such extensions, for both the SM chiral fermion content and the SM plus (up to) three right-handed neutrinos (SM$\nu_R$). Methods from Diophantine analysis allow us to efficiently index the solutions arithmetically, and produce the complete solution space in particular cases. In order to solve the general case, we build a computer program which cycles through possible $U(1)$ charge assignments, providing all solutions for charges up to some pre-defined maximum absolute charge. Lists of anomaly-free $U(1)$ charge assignments result, which corroborate the results of our Diophantine analysis. We make these lists, which may be queried for further desirable properties, publicly available. This previously uncharted space of anomaly-free charge assignments has been little explored until now, paving the way for future model building and phenomenological studies.


Introduction
Spontaneously broken, gauged U (1) extensions of the Standard Model (SM) are currently enjoying a high level of interest in particle physics, thanks to their ability to answer various phenomenological questions. For example, they have been successfully employed to model dark matter [1][2][3][4][5][6][7], to explain measurements of the anomalous magnetic moment of the muon [8], to provide axions [9] or leptogenesis [10], to explain the stability of the proton in supersymmetric models [11], to break supersymmetry [12], and to provide fermion masses through the Froggatt-Nielsen mechanism [13], to name but a few.
Flavour non-universality: In many of these examples, fermions are given family-dependent U (1) charges. A notable recent impetus comes from LHCb measurements of lepton flavour non-universality in certain rare neutral current B-meson decays [14][15][16]. Prima facie, there are two classes of new particle which might be responsible for such an effect at tree-level: a leptoquark, or a new charge-neutral heavy vector boson (called a Z ). In Z models for the B-meson decays [2,, the Z arises as the new heavy gauge boson from a spontaneously broken U (1) extension to the SM gauge symmetry, under which the charges of chiral fermions are family-dependent.
Rather than focus on a particular Beyond the Standard Model scenario, or a particular realisation of breaking an additional U (1) group, we shall consider the SM as a low-energy Effective Field Theory (EFT) in which the fermions may have (in addition to their usual quantum numbers) a family-dependent charge under this U (1) gauge group. This approach allows us to remain agnostic about the heavy gauge boson which mediates the interaction and therefore captures the relevant low-energy phenomenology of a wide class of different models.
Anomaly cancellation: If such EFTs are to be embedded into a renormalisable, ultraviolet (UV) completion, then the additional gauge symmetry (which we shall call U (1) F from now on) should be non-anomalous. This means that the U (1) F charges of the chiral fermions in the theory must be chosen such that all of the anomaly coefficients cancel, including for the mixed anomalies involving U (1) F , and the gauge-gravity anomaly. The solutions to these highly non-trivial constraints on the possible U (1) F charges of the SM fermions are the subject of this paper. Our central aim is to categorise and list the sets of fermionic charges that solve the anomaly constraints. By doing so, we hope to provide inspiration for model building and aid future phenomenological studies. In addition to the SM fermions, we shall also include the possibility of three heavy right-handed (RH) neutrinos, since it is a popular minimal extension that can explain the size of neutrino masses inferred from neutrino oscillation data. The "anomaly-free atlas" of U (1) F charges is stored on Zenodo at http://doi.org/10.5281/zenodo.3345889 [47].
Wess-Zumino terms: Before we elaborate on the form these constraints take, and sketch how we solve them, we would like to comment on the role of anomaly cancellation in realistic model building, in which low-energy theories are necessarily regarded as "only" EFTs, and are not intended as fundamental theories. In this case, it is of course feasible that anomalies do not cancel in the low-energy EFT, but are cancelled at high energies by new UV physics. For example, heavy chiral fermions may have been integrated out of the fundamental theory at higher energies 1 , whose presence would cancel the apparent low-energy anomaly. Another example is the Green-Schwarz mechanism in string theory [48,49].
Indeed, the presence of an anomaly in the low-energy description can always be cancelled by a Wess-Zumino term [50], which is a higher-dimension operator in the Lagrangian density of topological origin. Given that this is the case, one might think that we should not impose anomaly cancellation as a condition, since we are likely building an EFT only valid at low energies. However, if one were to disregard the constraint of anomaly cancellation, one should explicitly construct the appropriate gauged Wess-Zumino terms to cancel all anomalies in the EFT, and derive the phenomenological consequences of these terms (for example, they will generically entail new interactions of the SM gauge bosons 2 ).
Also, if anomaly cancellation in low-energy EFTs may be ignored, it is at best curious that the SM cancels the anomalies of its gauge groups. We strongly suspect that the SM is at most an EFT description of fundamental physics, since it does not include dark matter, have sufficient baryogenesis, or include gravity, for example. And yet, the SM conspires to be an anomaly-free, perfectly consistent renormalisable gauge field theory in and of itself. Such a conspiracy might suggest that we should take anomaly cancellation seriously when we try to go beyond the SM.
Furthermore, given an anomalous assignment of charges at low energies, it is usually difficult to know for certain that an appropriate set of beyond the SM chiral fermions can indeed be written down and given suitably large masses in a consistent framework 3 . For many charge assignments, this will prove impossible. It is pragmatic, therefore, to ensure anomaly cancellation without the need for Wess-Zumino terms 4 , as this removes a potential obstacle to finding an UV complete description of the EFT.
RH neutrinos: Supposing sufficient knowledge of the heavy fermions at high energies, then specific violations of EFT anomaly cancellation are possible. The example of the SMν R shall prove to be pertinent and pedagogical here: in the low-energy effective theory below some high scale associated with the masses of RH neutrinos 5 , two of the "SM anomaly cancellation equations" (i.e. the equations not including the RH neutrinos' charges) will seem violated, but in a correlated manner. RH neutrinos are a special case because, being chiral fermions but SM singlets, their mass terms are invariant under the SM symmetries. It is hard to 2 A textbook example of this occurs in the chiral Lagrangian describing pions, the physical degrees of freedom of QCD at low energies. There is a topological term in the action for this theory, which is the original Wess-Zumino-Witten (WZW) term [51,52]. Upon gauging electromagnetism, the WZW term contributes a dimension-5 operator in the Lagrangian proportional to π 0 FF , which facilitates the decay of the neutral pion π 0 to a pair of photons, thus playing a crucial rôle in the low-energy phenomenology of the theory. Generically, the addition of Wess-Zumino terms will involve similar operators coupling new scalar fields to the gauge bosons corresponding to the anomalous symmetries which are being matched by the Wess-Zumino terms, invariably changing the phenomenology of the gauge sector in such an EFT. 3 Even though a suite of Wess-Zumino terms can indeed always be written down in the low-energy EFT to cancel all anomalies, this does not guarantee that such operators can in fact arise (with the precise coefficients to cancel anomalies) in the low energy limit of a renormalisable quantum field theory defined in the UV. For instance, the fact that only certain Wess-Zumino terms are allowed is what gives rise to monotonicity theorems along RG flows [53,54]. 4 Thanks to the topological nature of the Wess-Zumino terms, their coefficients are typically not renormalised. In this case, their coefficients can be tuned to zero in the EFT in a radiatively stable way. 5 The RH neutrino masses are often set to be around 10 11 − 10 13 GeV in order to explain the smallness of the neutrino masses (after the see-saw mechanism has made the left-handed neutrinos very light).
imagine how to give non-SM singlet chiral representations a large mass in an UV anomalyfree theory without breaking electroweak symmetry prematurely (i.e. at a scale much above the empirically determined electroweak scale around 100 GeV), since the Dirac mass term will necessarily require left-handed particles and a vacuum expectation value of an electroweak non-singlet.
In the following, we shall take anomaly cancellation as a useful guide for beyond the SM model building. This surely motivates an exploration of the space of solutions to the anomaly cancellation equations. We chart the space of family-dependent anomaly-free charge assignments in the two cases: the SM and the SMν R .
In the following § 2, we define conventions and write down the anomaly cancellation conditions, noting pertinent properties of them that help organise our solutions. Then, in § 3, a Diophantine analysis shows how the solutions to the anomaly cancellation equations may be efficiently indexed and written in a closed form for either one or two families of non-zero U (1) F charges. For the case of three families, certain existence arguments are formulated using modular arithmetic. Next, in § 4, a computer program is described that efficiently solves the anomaly cancellation conditions for all three families, including the more general case of the SMν R . Various checks upon its output are performed. Interesting properties of the solutions are listed along with some examples. A particularly pertinent example case is then treated in detail in § 5, namely the case in which the sets of U (1) F charges permit all Yukawa couplings at the renormalisable level. We conclude in § 6.

Anomaly Cancellation Conditions
In this section we reproduce the system of anomaly cancellation conditions (ACCs) which we shall solve. We consider the SMν R , of which the SM is a special case (all RH neutrino U (1) F charges set to zero). We shall also point out some basic features of these equations which both our solution methods shall exploit. We begin by setting out our conventions.
We write the SM fermionic fields as the following representations of SU In the SMν R , we include RH neutrino fields ν ∼ (1, 1, 0). When discussing Yukawa couplings later, we will consider the Higgs doublet H ∼ (1, 2, −1/2). Each fermionic field comes in three copies (families). We shall discriminate between the different families' U (1) F charges by a family index i ∈ {1, 2, 3} where relevant. It will sometimes be convenient to refer to a generic fermionic irreducible representation of the SM gauge group (e.g. the left-handed quark doublet Q); these we shall refer to as different "species". Here, we consider extending the SM gauge symmetry to SU and i ∈ {1, 2, 3}. While the SM gauge symmetries are flavour universal, this U (1) F symmetry will be allowed to have family-dependent couplings.
There are six ACCs, arising from the six (potentially non-vanishing) triangle diagrams involving at least one whereas the gauge-gravity ACC is In addition to these four linear equations, there are two ACCs which are non-linear in the U (1) F charges, which correspond to triangle diagrams involving more than one and finally the U (1) 3 F ACC is the cubic where we have included the RH neutrinos. These six conditions constrain eighteen U (1) F charges in the SMν R : F X , for each X ∈ {Q i , L i , e i , u i , d i , ν i }, with i ∈ {1, 2, 3}. The SM chiral fermion content is obtained by restricting to the special case F ν i = 0 ∀i ∈ {1, 2, 3} (thus there are fifteen U (1) F charges in the SM case). However, note that the SM ACCs are obtained by the less restrictive pair of conditions i F ν i = i F 3 ν i = 0, which can indeed be satisfied for non-zero RH neutrino charges.
We note that the RH neutrinos do not enter into the ACCS except for the gauge-gravity and the U (1) 3 F ACCs (Eqs. 2.4,2.6) because they are Standard Model singlets. Thus, if one did not know of the existence of the U (1) F -charged RH neutrinos and one used the SM version of the equations, one might be misled by these two ACCs. This should not be an excuse for neglecting the ACCs while setting up one's theory however, since we notice from Eqs. 2.4,2.6 that the violations of their SM limit are specific and correlated. Furthermore, the four other ACCs must still be satisfied for anomaly freedom in the UV.
Some important features of the ACCs and their solutions are: 1. Rational solutions: we shall assume that the solutions to the ACCs are valued in the rationals, Q. In a holographic setting, if the boundary conformal field theory is finitely generated (notationally, has a finite number of fields in the path integral), then the bulk gauge group must be compact 6 [55, Theorem 6.1]. As finite dimensional representations of a compact Lie group have charges on a discrete weight lattice, we are then guaranteed to have rational charge ratios. Put another way, if the ratio of two charges is irrational, they will not fit into a unified, compact, semi-simple, non-abelian group. For instance, we may imagine that the U (1) Y × U (1) F part of the symmetry (which would otherwise suffer from Landau poles in the gauge coupling at some high energy scale) is in fact embedded in a unified gauge-symmetry, corresponding to a semi-simple gauge group G.

2.
Rescaling invariance: since the ACCs, Eqs. 2.1-2.6, are homogeneous polynomials in the eighteen variables, one may rescale all charges that specify a solution by any rational number and arrive at another solution. These rescaled solutions are not independent, because rescaling all charges is equivalent just to an overall rescaling of the gauge coupling. Hence, solutions related by such a rescaling are in an equivalence class. Moreover, this freedom to rescale means that rational solutions may be taken to be in the integers Z without loss of generality 7 . However, one may not be free to rescale charges by changing the gauge coupling to any degree: there is growing evidence that gravity must be the weakest force in a consistent theory of quantum gravity [57]. In practice, this puts a bound on how low one can make any gauge coupling g in units of the charge. The Weak Gravity Conjecture is the claim that the low-energy EFT will always have a cutoff of at least gM P , and there must be at least one charged particle with a mass below this. Applied to our U (1) F gauge coupling g F , if the field with the largest U (1) F mass-to-charge ratio has mass m and U (1) F charge F X , for example if the particle with largest mass-to-charge ratio is a top quark with mass m on the order of 100 GeV, g F F X > O(10 −17 ). If the bound in Eq. 2.8 is not satisfied, then one must introduce additional heavy degrees of freedom charged under the U (1) F group, or else risk the EFT breaking down prematurely from quantum gravity corrections. We also note that there is an upper bound on g F if we require perturbativity. Assuming 6 More precisely, any potentially non-compact groups must be contained within a larger unified gauge group that is compact; much as how the electromagnetic gauge group is not necessarily quantised, but is embedded into the compact SM group, SU (3) × SU (2)L × U (1)Y . 7 We note that irreducible representations of U (1) are labelled by integers anyway because the group transformations are defined to be periodic with period 2π [56].
that there are no fields charged under U (1) F other than SMν R fermions 8 , the U (1) F beta function may be phrased as where X i are SMν R Weyl fermions, F X i are their U (1) F charges and µ is the renormalisation scale in the minimal subtraction scheme. For perturbativity we should have that for the SM case, which is of order 6 5 = 7776). In practice this is implemented by choosing an ordering within each species. In what follows we choose: (2.10) We note that this ordering choice means that F X 1 , F X 2 and F X 3 do not necessarily correspond to the usual families defined by increasing mass of the corresponding fermion within the species X. The usual ordering is then defined by a permutation of {F X 1 , F X 2 , F X 3 }, which will in general be a different permutation for each X.
The ACCs and their solutions are left unchanged by the addition of fermions which are vector-like under the full SM×U (1) F gauge group, since the left-handed and right-handed fermionic components cancel. Although this plays no rôle in our analysis, we note here that arbitrary numbers of such vector-like fermion representations may be added to our solutions and the resulting model will still be anomaly-free.
We note in passing that if one wants to solve simple U (1) systems of ACCs with identical fermions, where one allows the number of fermions to vary, the non-linear ACCs can be reduced to linear equations, quickly yielding solutions [58,59]. Here though, since we have fixed the number of fermions (albeit with different numbers for two different cases: the SM and SMν R ), and since these fermions transform in fixed (and different) representations of the other factors of the gauge group, we must utilise different methods. In the following section, we demonstrate the use of methods often employed to analyse such systems of Diophantine equations. 8 Vector fields charged under U (1)F would weaken the bound, whereas U (1)F -charged scalar fields would strengthen it. 9 A significantly stronger bound may be obtained under the assumption that our model remains a good effective field theory all the way up until the Planck scale. In that case, demanding no Landau pole between the Z scale and the Planck scale results in a bound that is a factor 1/ ln(M 2 P /M 2 Z ) stronger.

Diophantine Analysis
In this section we shall show that integer solutions to the system of ACCs (2.1-2.6) can be efficiently indexed by specifying, For two families, For three families and F ν+ =F ν = 0, We begin by rewriting the linear ACCs Eqs. 2.1-2.4 in terms of the sum of U (1) F charges within a species: For one family, we have F X+ = F X and there is a unique solution for each F Q and F ν . For two families, the sums F X+ = F X 1 + F X 2 of each species are uniquely fixed as in Eq. 3.1, and there are infinitely many solutions for each difference F X− ≡ F X 1 − F X 2 : but as these are in one-to-one correspondence with the set of four positive integers, they are easily enumerated to any desired Q max , as shown in Eqs. 3.9 and 3.10. For three families, the sums F X+ = F X 1 + F X 2 + F X 3 are fixed as in Eq. 3.1, and the nonlinear constraints reduce to a pair of quadratic Diophantine equations for F X 32 = F X 3 − F X 2 , which are known to have finitely many solutions in the range of interest, 0 ≤ F X 32 ≤F X .

One family (or several families with family-universal charges)
If there is only one non-zero U (1) F charge per species, or several families where the charges are all the same within a species 10 , then we have six integers {F Q , F u , F d , F e , F L , F ν } and four linear constraints. Once these linear constraints are imposed, the quadratic and cubic constraints are automatically satisfied. This can be understood physically from the anomalies-if there is only one family, then U (1) Y × U (1) 2 F and U (1) 3 F are not independent of the other anomalies.
All solutions can be specified by two integers, say F Q and F ν , in terms of which the other charges are Using F Q to index the solutions has the advantage that any F Q ∈ Z admits a solution. Had we instead specified, say, F L , and solved the linear equations, we would have found that only F L ∈ 3Z yields integer solutions.
Examples: Note that if we set F ν = 0 and decouple the RH neutrinos, the solution in Eq. 3.2 reduces to gauging an additional hypercharge in a direct product such as in the Third Family Hypercharge model [60]. Alternatively, if we set F ν = −3F Q , the solution in Eq. 3.2 reduces to gauging B − L, baryon number minus lepton number within that family, as has appeared in Refs. [36,61].

Two families
Moving on to the case of two non-trivial charges per species, we now have twelve integers As before, we can immediately apply the four linear constraints to remove four variables, although now the quadratic and cubic constraints are not automatically satisfied. However, there is still a simplification: the cubic equation reduces to a quadratic constraint-i.e. we find that the U (1) 3 F anomaly is only independent if there are RH neutrinos in addition to the SM particles.
Decoupling variables: By going to variables we find that the linear conditions depend only on F X+ , and the nonlinear conditions depend only on F X− . We can therefore fix all F X+ in terms of F Q+ and F ν+ as before, and then solve the remaining conditions: which are now both quadratic.
Solving Diophantine equations: A quadratic Diophantine equation of the form has an infinite number of solutions, which can be parameterised by To see that this parameterisation provides a complete list of all solutions (up to rescalings), consider any particular solution {x j }. This solution will be generated by up to a rescaling by 1/2(x 1 + x N ), and so scanning over all {a j } will generate all possible solutions.
In the present case, this allows us to parameterise the F X− when F ν+ = 0 in terms of four positive integers {a, a e , a d , a u }: and when F ν+ = 0 in terms of four positive integers {a, A, A d , A u }, where the parameterisation is now given by (3.10) Scanning over these positive integers will generate a complete list of the F X − .
Example: One may obtain the well-known L µ − L τ anomaly-free assignment of charges [8,20,28] as a particular solution within this general class of two-family solutions (where we identify the first family fermions with the U (1) F -uncharged family). If one sets all of the quark charges to zero, then Eq. 3.2 implies that the remaining sums of charges all vanish, i.e. F L+ = F e+ = F ν+ = 0, and Eqs. 3.4, 3.5 reduce to a single non-trivial equation, F 2 e− = F 2 L− , with F ν− being unconstrained. Thus, if we insist that the only non-zero charges are for two families of leptons, we obtain solutions of the form ( for any two integers a and b, from which we recover the L µ − L τ assignment either with (b = a) or without (b = 0) the inclusion of RH neutrinos.

Three families
Finally we consider the case of three non-trivial U (1) F charges per species, giving eighteen integers As before, we can apply the four linear constraints to remove four variables, and now the quadratic and cubic constraints Eq. 2.5 and Eq. 2.6 are fully independent.
Decoupling variables: With an analogous change of variables we find that the linear conditions depend only on F X+ , and the nonlinear conditions depend only on F X 32 andF X . We can therefore fix all F X+ in terms of F Q+ and F ν+ as before, and then solve the remaining conditions: Relabelling: Note that in the original variables, we had the freedom to relabel families. In these new variables, this is realised as the freedom to replace 14) or to replace The former of these (together with the removal of cross terms from the quadratic constraint) is the real motivation for our choice of new variables. Crucially, this Z 2 parity of F X 32 means that the cubic equation can only depend on F 2 X 32 and not F 3 X 32 . We need therefore only specify the sixF X , and then we are left with a pair of quadratic Diophantine equations for the F X 32 . These are more difficult to solve than the previous two family case, because in general the combination ofF 2 X in the quadratic constraint andF 3 X in the cubic constraint need not sum into an integer squared, so there need not be a neat parameterisation.
In the new variables, our ordering condition Eq. 2.10 corresponds to for each species. In a finite range, a system of quadratic Diophantine equations has finitely many solutions, so at least each choice of theF X labels a finite family of solutions, which can be found numerically. We can in fact say a little more than this. By applying basic modular arithmetic arguments to this pair of quadratics, we shall show that the sets ofF X charges which admit solutions for the F X 32 can in fact be classified in the case where F ν+ = 0, and fall into two distinct classes. In the case of the SMν R with three families and no other constraints on the charges, we find that the full solution space evades even a classification such as this, at least using our methods.
Existence of solutions: Consider parameterising the charges mod 3. One may deduce thatF which follows the definitions ofF X and F X+ . 11 We now split our analysis into two cases, considering firstly the SM and then the SMν R . 11 We thank Joseph Tooby-Smith for sharing with us this observation, and the resulting classification of Eq.

SM
In the case where F ν+ = 0, Eqs. 3.1 and 3.17 imply that If we parametrise the remainingF variables modulo 3 by defininḡ F X = 3n X + r X , n X ∈ Z and r X ∈ {−1, 0, 1}, (3.19) then the quadratic ACC implies that 20) and the cubic constraint turns out to be automatically satisified modulo 3 (as can be seen by substituting in r 3 X = r X ). Eq. 3.20 then has the following solutions: either r Q = r d = r u = 0, which impliesF Q ≡F d ≡F u ≡ 0 (mod 3), or else each of r Q , r d , and r u are equal to ±1.
In fact, we can go further still and rule out some of these classes by now considering the cubic ACC modulo 9. This implies the constraint This, together with Eq. 3.20, admits only the solutions r Q = r d = r u = 0, r Q = r d = r u = +1, and r Q = r d = r u = −1. We can identify the latter two as corresponding to the same equivalence class of solutions, since it is always possible to perform a rescaling to set (say) r u = +1. Thus, solutions for F X 32 only exist when 12 In terms of efficiency, if we scan the sixF X from 1 to 3N , this has reduced the number of computations from 3 6 N 6 = 729N 6 to only 2N 6 , assuming F ν+ = 0 andF ν ∈ 3Z. • All RH quarks are uncharged, • At least one left-handed and one right-handed lepton is uncharged, • Two left-handed quark doublets have the same non-zero charge. 12 In fact, this proof holds not just in the SM case, but in the slightly more general case that we include three RH neutrinos with charges such that Fν+ = 0 andFν ∈ 3Z. Hence, we have includedFν in Eq. 3.22.
This is straightforward to see in our basis, as setting the RH quark charges to zero amounts to setting F u,d+ =F u,d = 0, which then implies (by the linear constraints, Eq. 3.1) that all F X+ are zero. Then, if we choose (without loss of generality) the zero lepton charges to be F e 3 = F L 3 = 0, we have thatF e = F e+ andF L = F L+ so these vanish as well. This leavesF Q as the only non-zeroF , and consequently the cubic equation simplifies dramatically, tō If two of the left-handed doublets, F Q i , then have the same charge, we can set F Q 32 = 0, and find that the only solution is F Q i = 0-so there can be no non-zero charge assignment as described in the third bullet point above. This is not the only set of conditions which leads to no possible SM solution, but it is a helpful example of how effectively the anomaly cancellation conditions can completely exclude all charge assignments under certain conditions.

SMν R
Including the RH neutrinos, there are now more cases which admit solutions. We no longer have the simplification afforded by Eq. 3.18, with the quadratic ACC now being Together with the cubic ACC (considered both modulo 3 and modulo 9), we obtain the set of constraints: Outside of the special case in which r ν = r e the space of solutions to the full three-family SMν R becomes harder to characterise.
In this generic three-family scenario including RH neutrinos, the problem ultimately reduces to a scan over integer solutions, albeit a scan only up to some maximum charges if we fix the values of theF X 's. It is difficult to make any further progress solving the Diophantine equations. Thus, in the generic situation, the development of an efficient computational search program is well-motivated. We describe such a program in the next section.

Computational Search
In this section, we present a computational search over integers whose magnitudes are bounded by some user-defined Q max ∈ N.

Efficient computation
Blindly searching over all sets of integers within this range and checking Eqs. 2.1-2.6 would be extremely inefficient: in the SMν R , we would need to check six equations for (2Q max + 1) 18 sets of U (1) F charges. If we take U (1) Y as an example, we can rescale the gauge coupling such that the smallest hypercharge is one, in which case the maximum absolute value of hypercharge is 6. Setting Q max to be the same value (6) would then require checking the Eqs. 2.1-2.6 1.0 × 10 20 times in order to find solutions to the ACCs. In order to make things more efficient, our computer program searches over automatically ordered U (1) F charges and explicitly uses the four linear ACCs Eqs. 2.1-2.4, to reduce the number of sets to be searched over by a factor of 7776(2Q max + 1) 4 for the SM, with an extra reduction by a factor of 6 for the SMν R . Further reductions result from scanning over only one representative from each equivalence class of solution, and from choosing the order of cycling through species in order to reduce the number of operations.
Sometimes in the cycling, the charge assignment of a species X exhibits U (1) F "charge inversion symmetry" (CIS) where {F X 1 , F X 2 , F X 3 } = {−F X 1 , −F X 2 , −F X 3 } taking into account the fact that the ordering does not matter. CIS charge assignments are of the form {−a, 0, a}. If, in the cycling, all species' U (1) F charges set so far are CIS (or indeed no charges have yet been set), the next species' charges are chosen such that the number of positive charges is less than or equal to the number of negative charges. This avoids cycling over both F X = {−3, −2, −1} and F X = {1, 2, 3} for instance, which are in the same equivalence class. Also, if the middle ordered charge is zero, then the magnitude of the third charge should be smaller or equal to the magnitude of the first. This avoids cycling over both F X = {−1, 0, 2} and F X = {1, 0, −2}, which are again in the same equivalence class. Once all the F X i have been set, those assignments with a greatest common divisor larger than 1 are identified by checking whether all charges divide by the same prime number less than Q max : if they do, they are removed from the list, since they are in the same equivalence class as an existing solution with smaller U (1) F charge magnitudes (which we take to be the representative of the equivalence class).
Bearing these considerations in mind, F Q 1 is chosen first to cycle through the range [−Q max , 0]. Thus, F Q 1 is chosen in these sets to be negative semi-definite. Solutions with positive F Q 1 can be obtained from these by multiplying all U (1) F charges in the solution by the same -1 factor because of the rescaling invariance of the ACCs and they are thus in the same equivalence class. Next, F Q 2 is chosen in the interval [Q 1 , 0] (the upper bound is fixed by our requirement that the number of positive U (1) F charges should not be greater than the number of negative ones, as explained above). Then F Q 3 ∈ [Q 2 , Q max ], checking that |F Q 3 | < |F Q 1 | if F Q 2 = 0. Next, if the SM case is desired, all RH neutrino U (1) F charges are set to zero. Otherwise, F ν i are cycled 13 . F e 1 and F e 2 are cycled next, but is fixed, as implied by Eq. 3.1. If |F e 3 | > Q max or if F e 3 < F e 2 , the program reverts to the next inner-most cycling (i.e. F e 2 ). The rest of the cycling proceeds in a similar manner to that of {F e 1 , F e 2 , F e 3 } (in the species order u, L, d) until the program tests the quadratic ACC Eq. 2.5. If the quadratic ACC is not satisfied, the inner-most cycling is continued (i.e. F d 2 ). When the quadratic is satisfied, only then is the cubic ACC Eq. 2.6 tested. The design of the program thus reduces the amount of computation by not calculating further when the U (1) F charges set so far are not consistent in some way; either because the magnitude of a charge set is necessarily larger than Q max , or because the charges set are inconsistent with the ACCs, or because they are in the same equivalence class as some other set of charges that has already been tested (or will be tested).
At the end of the process thus outlined, we are left with a list of all inequivalent solutions with U (1) F charge magnitudes up to Q max . Finally, successful sets of charges are output as well as other data such as the number of ACC quadratics and cubics evaluated.

Results
We now list some example results and their properties. The full lists are available in the form of labelled, easily read ASCII files for public use on Zenodo at http://doi.org/10.5281/ zenodo.3345889 [47] for Q max ≤ 10 in the SM and Q max ≤ 10 in the SMν R . The program itself is also made available there if a larger value of Q max is desired by the user.
As an example, we display all eight solutions to the SM ACCs with Q max = 1 in Table 1. Remembering that we have yet to identify each U (1) F charge with a particular family, we note that solution 3 of the table may correspond to L µ − L τ , which has been the subject of some phenomenological interest recently [8,20,28,63]. All of the solutions in the table are totally CIS (i.e. every species is CIS). For these CIS solutions, since i F X i = 0 for each species X, they automatically satisfy all four linear ACCs, Eqs. 2.1-2.4. Also, since i F 3 X i = 0, they automatically satisfy the cubic Eq. 2.6, and so the only non-trivial constraint on such a CIS charge assignment is that it solves the quadratic ACC, Eq. 2.5. A priori, one may therefore suspect that the majority of solutions will be CIS, since five out of the six ACCs are then solved "for free", but in fact we find that such CIS solutions become much less frequent as Q max is increased, at least until Q max = 10. 13 The way in which the cycling is performed is much more detailed than our exposition. We refer interested readers to the source code of the computer program, which is available on http://doi.org/10.5281/zenodo. 3345889 [47].  Table 1. Inequivalent solutions to the anomaly equations for SM fermion content and Q max = 1. Each row shows an anomaly-free U (1) F charge assignment. Note that the charges within a species are labelled in increasing order from left to right and so the ordering does not reflect the family assignment.
Even with Q max = 1, we already notice a new solution of interest for explaining the neutral current in B-decay data in the solution 5 of Table 1: i.e. the charge assignment (now listing the indices as actual family indices in the weak eigenbasis) with all other U (1) F charges vanishing. Once the U (1) F symmetry is spontaneously broken, provided there is some quark mixing between b L and s L , this will result in a Z boson coupling to (μγ µ P L µ), and to (bγ µ P L s). These couplings are of the correct type [64] to explain the neutral current B-meson decay data, which disagrees at the 4σ level with SM predictions. It remains for future work to see whether the model has otherwise viable parameter space but if it does, this will constitute a very simple model (going only slightly beyond the simplified Z models introduced in Refs. [44,45]) that explains the data and is free of anomalies.
For Q max > 1 in the SM, or even for Q max = 1 for the SMν R , the solutions are too numerous to list in this paper. We do, however, list the number of solutions and some other properties in Tables 2, 3. As previously advertised, we see that CIS solutions become relatively less frequent in the list of solutions as Q max increases. Also listed are the number of times the program checked the quadratic ACC and the number of times it checked the cubic ACC. We see that the program runs quickly for low values of Q max on a modern laptop. The time taken to run fits a T (Q max )/secs = exp A + BQ max + CQ . For the particular pair of non-linear Diophantine equations that need to be solved in these cases, the use of look-up tables contained within special Mathematica TM functions may expedite the calculation. If Q max > 10 is desired in the SMν R , for which we have not found analytic simplifications analogous to Eq. (3.22), it may be advantageous to adapt the program to run in parallel on many cores. Fig. 1 Table 3. Number of inequivalent solutions to the anomaly equations for SMν R fermion content and different maximum U (1) F charges Q max . Each row contains the all-zero charge solution, as well as the solutions indicated in the rows above. The column marked "Symmetry" shows how many of the solutions are CIS. We also list the number of quadratic and cubic anomaly equations checked by the program, as well as the real time taken for computation in seconds on a modern DELL TM XPS 13-9350 laptop.
the number of solutions as a function of Q max graphically, along with some approximate numerical fits, for the SM and the SMν R .
We note that, since the solutions for SMν R contain the solutions where only one or two  Table 4. U (1) F charges as output by the program for some example solutions present in the literature. "TFHM" refers to the Third Family Hypercharge Model and B 3 − L 3 to third family baryon minus lepton number. Note that the charges within a species are labelled in increasing order from left to right and so the ordering does not reflect the family assignment. Also note that the charges are multiplied by a rational constant in each case in order to get the traditional U (1) F charge assignments: -1/6 for the TFHM and -1/3 for B 3 − L 3 . of the ν U (1) F charges are non-zero, these solutions also correspond to the case of the SM plus only one or two RH neutrinos (respectively).

Testing against known solutions
As a test of our program, we have checked our atlas of solutions for several anomaly-free U (1) F charge assignments that have been previously identified and used in the literature: for example, L µ − L τ [8,20,28] is present in two forms: both in the SM as in Table 1 and in the SMν R with non-zero ν R U (1) F charges. Third family baryon number minus (second or third family) lepton number [36,61] is also present in the SMν R , as is the Third Family Hypercharge Model [60] in the SM. The U (1) F charges of these example charge assignments are shown in Table 4. Several more solutions in the literature were found in the output (all of the valid solutions sought for were found), but here we omit them for brevity. On the other hand, as we discussed from an analytic perspective in § 3.3.1, and as originally shown by Ellis, Fairbairn, and Tunney in Ref. [62], there are no SM solutions when (i) two of the F Q L are non-zero and equal, (ii) there is at least one zero U (1) F charge for both LH and RH leptons, and (iii) all RH quarks are uncharged under U (1) F . Searching our SM lists, we confirm that such solutions are absent, providing another test of the program. We also confirm that when condition (iii) is relaxed to "all RH down quarks are chargeless", there are still no non-trivial solutions found, agreeing with another result of Ref. [62]: that there are no rational solutions.
As a further test of our program (and, indeed, as a cross-check on the results from our Diophantine analysis), we check that Eq. 3.22 applies for the subset of solutions with F ν+ = 0. For the SMν R with Q max = 6, out of the 435 305 solutions, 33 410 have F ν+ = 0 and, indeed, we confirm that all of these solutions fall into one of the two classes identified analytically in Eq. 3.22 (once any solutions with r u = −1 have been rescaled such that r u is +1).
While the full atlas of anomaly-free solutions which we list on Zenodo [47] might be intimidating for some readers, we point out that imposing various phenomenology-motivated constraints on the possible U (1) F charges is easy and fast. It will result in a cull of a large number of solutions (e.g. 435305 for SMν R with Q max = 6), often down to a much smaller list. We now demonstrate this further through additional examples in § 4.3.2 and § 5.

A few selected new solutions
If we apply the less stringent Ellis, Fairbairn, and Tunney conditions [62] where, of the RH quarks, only RH down quarks are fixed to be uncharged under U (1) F to the SMν R (they did not consider this case), we find that there are 20 solutions for Q max = 6, in all of which the RH neutrinos are U (1) F charged. These solutions therefore present a new example use case for our publicly available lists of solutions. They are reproduced in Table 5. The phenomenology of the models in the table can be checked for desirable properties: with suitable weak eigenbasis family assignments and assumptions about fermion mixing (e.g. that b L and s L mix when going to the mass eigenbasis and some other assumptions involving lepton mixing), the first solution can be made to generate the necessary couplings of a Z to explain egregious neutral current B-meson decay data, for instance. We note that only solution 14 satisfies the more stringent conditions where all RH quarks are set to be uncharged under U (1) F in a non-trivial way.
Some of the other solutions correspond to models which provide candidate solutions to both the neutral current B−meson decay data and aspects of the fermion mass problem. For example, consider the following SM×U (1) F solution, that appears in our atlas with Q max = 4: where now the indices on the fields indicate family assignment in the weak eigenbasis. Provided b L and s L mix, this model (once U (1) F is spontaneously broken and the resulting Z is integrated out) will generate an (b L γ µ s L )(µ L γ µ µ L ) effective coupling of the kind indicated by fits to the neutral current B−meson decay data [64]. If we set the Higgs U (1) F charge Table 5. U (1) F charges output by the program for solutions satisfying Ellis, Fairbairn, and Tunney's less stringent conditions [62] applied to the SMν R with Q max = 6. Note that the charges within a species are labelled in increasing order from left to right and so the ordering does not reflect family assignment.
equal to +2 in these units, then the only renormalisable Yukawa coupling permitted by this pattern of charges is that of the top quark. Presuming that the other Yukawa couplings arise as higher dimensional operators after integrating out some UV physics (involving, say, vector-like fermions), then the banning of all other Yukawa couplings at the renormalisable level would naturally explain the fact that only the top Yukawa coupling is of order one, as we will discuss more at the end of § 5. This is yet another model of interest for further phenomenological study. In the following section, we discuss the implications of anomaly cancellation if we require that all of the electrically-charged fermion Yukawa couplings are permitted at the renormalisable level.

Constraints from a Renormalisable Yukawa Sector
An especially well-motivated constraint on the U (1) F charges that one might like to impose, which we have until now ignored, comes from the Yukawa sector. Naturally, the vast major-ity of our anomaly-free solutions forbid the presence of SM-like Yukawa interactions at the renormalisable level by U (1) F gauge invariance (even if we exploit the freedom to give the Higgs a non-zero U (1) F charge F H , which does not spoil the ACCs because the Higgs is a scalar). So, a natural question to ask is the following: which solutions in our anomaly-free atlas permit all of the SM Yukawa couplings at the renormalisable level? In such models, the fermions of the SM can acquire their masses in the same way as in the SM.
In this section, we will show that the constraints from a renormalisable Yukawa sector turn out to be strong enough that we can identify the subspace of such solutions completely analytically, using similar methods to § 3, without the need to query the results of our computer program. Nonetheless, even in this case, we find that our computer program is a useful tool, because it efficiently organises the solutions by maximum absolute charge. This "simple ordering" is difficult to arrive at using the analytic parametrisation of the solution space.

SM Yukawa interactions
In the SM, one should generically allow all entries in each of the complex three-by-three Yukawa matrices, Y e , Y u , and Y d , including all of their off-diagonal matrix elements (whose presence leads to the CKM and PMNS mixing matrices). Requiring U (1) F gauge invariance then tells us that: 1. The U (1) F charges for the SM fields Q, u, d, L, and e must all be flavour universal in order for the off-diagonal terms to be U (1) F invariant. Hence, the U (1) F charges for SM fields are fixed by the five variables F X+ ≡ 3F X , with each F X 32 andF X being zero. In the case where F H = 0, this reduces to requiring F Q = F u = F d , and F L = F e . For all of the SM fermion fields, the U (1) F charges are fixed by Eq. 3.1, which implies Hence, there are indeed anomaly-free solutions which permit all renormalisable Yukawa couplings, provided the Higgs has U (1) F charge where recall F Q+ = 3F Q in this scenario, and F ν+ = F ν 1 + F ν 2 + F ν 3 . Hence, such solutions exist for any pair of integers (F Q+ , F ν+ ).
If we further wish that the SM Higgs doublet field be uncharged under U (1) F (for example, we may wish to avoid the contribution from the Higgs vacuum expectation value to tree-level  Z − Z mixing that results otherwise), the sum of the RH neutrino U (1) F charges is fixed to be F ν+ = −3F Q+ . In other words, with F H = 0, such solutions only exist (with the exception of the trivial F X i = 0 solution) in the SMν R with non-zero U (1) F charges for ν R , not in the SM alone. In this simpler case, each lepton (including ν R ) has U (1) F charge −3F Q , where F Q is the charge of each quark. Conversely, if one seeks an anomaly-free U (1) F extension of the SM without RH neutrinos (or, more precisely, an extension where F ν+ = 0), but with all renormalisable Yukawa couplings, then one is forced to give the Higgs a non-zero U (1) F charge, and the charges of the SM fermions must be proportional to their hypercharges.

Non-universal RH neutrino charges
In any of these cases, the U (1) F charges for ν R don't necessarily also have to be flavouruniversal, since ν R non-universality has no effect on the electrically-charged lepton Yukawa couplings 14 . If we allow non-universality in the RH neutrinos, then the possible solutions allowing all SM Yukawa couplings are no longer classified solely by the integer pair (F Q+ , F ν+ ), but require in addition two more variablesF ν and F ν 32 , whose values are constrained by the cubic ACC: Eq. 5.3 has rational solutions for F ν 32 if and only if the two brackets, have the property that A/B is an integer. As any irrational factor of A must be compensated by an identical factor in B, it follows that AB is an integer also. Using our freedom to relabel families, we can take A and B to be the positive roots without loss of generality. Before giving a closed form expression for the solutions, let us comment on a few obvious branches of solutions 15 , Putting these aside, there are no further solutions in which either F ν 32 or A or B are zero.
The cubic equation has one remaining branch 16 , Demanding that the right hand side is an integer requires that A 2 is divisble by three 17 . Every remaining solution can then be given in terms of two integers, c 1 and c 2 , F ν+ = c 3 1 − 9c 1 c 2 2 ,F ν = 6(c 3 1 + 3c 1 c 2 2 ), F ν 32 = 6c 2 (c 2 1 + 3c 2 2 ) (5.10) To prove that this generates all of the solutions, it suffices to show that any desired solution, {F ν+ ,F ν , F ν 32 }, can be written in this form. This is achieved by setting, which reproduces the desired solution up to a rescaling of all neutrino charges by 8A 3 B . This closed form therefore does not capture solutions in which A or B vanishes, which is 14 We assume that neutrino mass generation requires further model building. 15 As described above, we use our freedom to relabel the families to set 0 ≤ F32 <F . 16 Again, the positive root can be taken without loss of generality-the negative root corresponds to sending why we separated those cases out explicitly. The set of Eqs. 5.5-5.10 is the complete list of solutions to Eq. 5.3.
The disadvantage of this analytic solution is that it doesn't generate charge assignments in a way which is ordered simply, in terms of maximum absolute charge value. For instance, while c 1 = c 2 = 1 gives the simple assignment F 1 = F 2 = −4, F 3 = 5, the neighbouring c 2 = 2c 1 = 2 gives F 1 = −113, F 2 = −230, F 3 = 238 (up to rescaling). For this reason, it is still often more convenient to work with the results of the computer program, even when full analytic solutions are known.
Our analytic results are borne out by the lists of solutions in our atlas for solutions with U (1) F charge magnitudes up to Q max . Filtering the SMν R Q max = 6 solutions in our atlas with the conditions 1-4 yields eighteen solutions, which are shown in Table 6. There are just three equivalence classes of solutions with F H = 0 (i.e. those avoiding tree-level Z − Z mixing after spontaneous U (1) F breaking). The only one of these three with non-trivial charges for the SM fermions indeed has all quark charges equal to F Q and all lepton charges equal to −3F Q . Of the other solutions, seven have the SM fermion U (1) F charges being proportional to their hypercharges, as follows from the F ν R charges being in the pattern {−a, 0, a} (since then F ν+ = 0). The remaining solutions are labelled by different values of F ν+ (relative to F Q+ ), with the pair (F Q+ , F ν+ ) determining the other U (1) F charges in each case. Note that there may be multiple solutions given such a pair, corresponding to different charge assignments for the RH neutrinos which satisfy Eq. 5.3 (solutions 13 and 16 of Table 6 are examples).
It is worth emphasising that allowing all of the Yukawa couplings to be present at the renormalisable level, as they are in the SM, is not essential for beyond the SM model building. For example, it is reasonable (and for some purposes desirable) to suppose that there is in fact no mixing in the electrically-charged leptons, and that the PMNS mixing thus comes entirely from the neutrinos. In such a set-up, in which the individual charged lepton numbers U (1) e , U (1) µ , and U (1) τ would then be individually conserved, one no longer has to require that the off-diagonal couplings in the charged lepton Yukawa matrix Y e be U (1) F invariant. This means that one could relax the flavour-universality constraint in the lepton fields X i ∈ {L i , e i } (but not in the quark fields). Relaxing this assumption opens up many more anomaly-free solutions in our atlas, including the L µ −L τ solution (in which all of the quarks are chargeless) [8,20,28].
Another more generic possibility, which has been extensively explored, is that not all fermions acquire their masses directly from renormalisable Yukawa couplings. After all, while the top quark has an order-one Yukawa coupling, the other fermions have much smaller couplings. Indeed, it is in many ways attractive to explain the power-suppressed Yukawa couplings of all of the lighter SM fermions by suggesting they arise from higher-dimensional operators in the SM EFT, which can be achieved by banning these couplings at the renormalisable level. This idea dates back to Froggatt and Nielsen [13], and is an important part of many models that seek to explain aspects of the flavour problem.

Conclusions
We have analysed the six anomaly cancellation equations for the SM gauge group in a direct product with a gauged U (1) F group, both with SM fermion content and with SM content plus (up to) three RH neutrinos. The fermionic U (1) F charges may depend upon the family, a model building construct which is recently popular given its potential to explain some interesting data in neutral current rare B meson decays that is in tension with SM predictions. Many other uses of such U (1) F gauge extensions have been employed in the literature. We have used Diophantine analysis to index the solutions, and indeed these methods can produce the complete solution space in particular cases. It is clear from the analysis that there is an infinite number of inequivalent (i.e. up to rescalings and permutations) integer solutions to this set of equations. In the case of the SM content with generic non-universal U (1) F charges, we find that the space of anomaly-free solutions is divided into two distinct classes which we have identified in Eq. 3.22.
To complement this Diophantine analysis, a computer program has been developed which scans over candidate solutions and provides lists of successful ones up to some maximum absolute U (1) F charge Q max , in order to explicitly generate the solutions for the most general case. The fact that a computer program can be written to perform such a task is, perhaps, not surprising. The surprising fact (at least to the authors) was the speed with which such a program can be made to produce exhaustive lists considering the fact that one is potentially scanning over 18 integers between −Q max and Q max , where Q max = 10. All runs took less than a day on a currently modern laptop, even for the computationally most intensive run (e.g. 7 hours for SMν R with Q max = 10).
To the best of our knowledge, an anomaly-free atlas such as we have provided has not appeared in the literature before, although some handful of the individual solutions have been found and examined. The solutions are legion (e.g. 435 305 for SMν R with Q max = 6) and so we find it likely that the majority of solutions found have not appeared in the literature before.
In addition to its use as a look-up table which allows model builders to check that their desired U (1) charge assignments are anomaly-free, the anomaly-free atlas can also inform the development of models in which only some of the SM fermions have assigned charges, or in which only qualitative features of the list is known. This is shown in our examples: one where we require a renormalisable Yukawa sector and one where we demand the phenomenologically motivated assignments of Ref. [62]. The anomaly-free atlas provides an efficient way to complete partial charge assignments in any gauged U (1) extension of the SM or SMν R .
There are various useful extensions to the atlas that one can envisage. One could chart the anomaly-free solution space of other popular chiral fermion field contents beyond SMν R . For example, in the minimal supersymmetric standard model, fermionic partners of the two Higgs doublets are included, and if these had non-zero U (1) F charges this would change the anomaly cancellation equations and therefore change their solution space. Models with "sterile neutrinos" may warrant the introduction of additional ν R fields beyond the three considered here, each with associated U (1) F charges. One could also construct different anomaly-free atlases for different symmetry breaking patterns, for example SU (3) × SU (2) L × U F 1 (1) × U F 2 (1) → SU (3)×SU (2) L ×U (1) Y , where F 1 and F 2 are (generically) different family charges for chiral fermions.
The atlas of solutions is publicly available as an aid and an inspiration to model builders and others, being particularly easy to automatically scan through, looking for desirable properties. Various solutions that have already been found in the literature are present, which provides a positive validation check on the results. Another check comes from the absence of two classes of rational U (1) F charge assignments in the SM which previous work has shown to be anomalous [62]. In the SMν R however, the analysis of Ref. [62] does not apply and we find new solutions within the same class. In general, there are a huge number of new solutions, and already at first glance several of them appear to be worthy of further phenomenological study.