{'fraction_non_alphanumeric': 0.0712020612426915, 'fraction_numerical': 0.02279258745416708, 'mean_word_length': 3.724485018726592, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Upper bounds for energies of spherical codes of given cardinality and separation

We introduce a linear programming framework for obtaining upper bounds for the potential energy of spherical codes of fixed cardinality and minimum distance. Using Hermite interpolation we construct polynomials to derive corresponding bounds. These bounds are universal in the sense that they are valid for all absolutely monotone potential functions and the required interpolation nodes do not depend on the potentials.


Introduction
Let S n−1 denote the unit sphere in R n and C ⊂ S n−1 be a spherical code; i.e. a finite subset of S n−1 . Given an (extended real-valued) function h : [−1, 1] → [0, +∞], the (unnormalized) potential energy (or h-energy) of C is given by (1) E h (C) := the family of all spherical codes on S n−1 of given cardinality M with maximal inner product s. Note that the set C(n, M, s) can be empty, for example C(n, n + 1, s) is empty for s < −1/n) and C(n, 2n, s) is empty for s < 0.
Given, n, M , s, and h, we are interested in upper bounds on the quantity Many important potential interactions tend to infinity when t tends to 1 − . Therefore, for obtaining finite upper energy bounds, it is necessary to impose restrictions on the separation s since as s tends to 1 − the energy of the code tends to infinity.
One natural restriction is to consider upper energy bounds for codes that minimize h-energy for specified or general h; such upper bounds on the minimal energy for Riesz (0 < α < 2) and logarithmic potentials on S 2 have been considered by Wagner in [34].
Another restriction leads to the class of spherical τ -designs. Energy bounds for the Coulomb energy of spherical designs on S 2 were considered by Hesse and Leopardi [19] (see also [18]). Recently, more general results (including lower and upper bounds) for Riesz and logarithmic energy of spherical designs with relatively small cardinalities were obtained by Grabner and Stepanyuk [17] (see also [32]). Universal upper and lower energy bounds for spherical designs were obtained by the present authors for all absolutely monotone potentials in [6]. In all these cases the spherical designs considered are well-separated (the asymptotic existence of such designs was proved by Bondarenko-Radchenko-Viazovska [4]). We also remark that Leopardi [21] examined bounds on the normalized Riesz energy for a class of spherical codes that is both well-separated and asymptotically (as M → ∞) equidistributed.
In this paper we consider yet another possibility -spherical codes (not necessarily spherical designs of large strength) with prescribed cardinality and maximal inner product (equivalently, minimum distance or separation). We derive a general linear programming approach in the spirit of Delsarte-Yudin for obtaining upper bounds on G h (n, M, s) along with conditions under which these bounds are sharp (see Theorem 3.2). The effectiveness of these bounds relies on the construction of suitable upper bounding polynomials that we show to exist for all potentials from AM([−1, 1]). We then test our estimates on some relevant codes.
Recently, we developed [6,7,9,10,11] linear programming techniques for obtaining universal lower bounds for energy of spherical codes of different classes 1 . With the addition of the upper bounds from this paper we establish an "energy strip" where all energies of codes from C(n, M, s) belong.
The paper is organized as follows. In Section 2 we present a general linear programming upper bound on G h (n, M, s), see Theorem 2.2. In Section 3, with the help of Levenshteintype polynomials, we construct 'feasible' polynomials that provide the energy bound for absolutely monotone potentials. The main result is Theorem 3.2 where a new universal upper bound for G h (n, M, s) is asserted. The bound is universal in the sense that it is a linear combination with positive weights of the values of the potential function on a collection of nodes, where both weights and nodes are independent of the potential function. Theorem 3.10 provides a necessary condition for optimality of the bound from Theorem 3.2. Examples and further discussions are provided in Section 4.   i (1) = 1, which satisfy the following three-term recurrence relation    If f is a continuous function in [−1, 1], then f can be uniquely expanded in terms of the Gegenbauer polynomials as where the convergence is in L 2 ([−1, 1]) and the coefficients f i are given by is a normalizing constant. If the coefficients f i are eventually all of the same sign, then it is a classical result of Schoenberg [29] that the series on the right-hand side of (4) converges uniformly and absolutely to f . For a spherical code C ⊂ S n−1 and a postive integer i, the i-th moment of C is defined by The well known positive definiteness of the Gegenbauer polynomials implies that M i (C) ≥ 0 for every nonnegative integer i. If M i (C) = 0 for every i ∈ {1, 2, . . . , τ }, then C is called a spherical τ -design. Spherical designs were introduced in 1977 by Delsarte, Goethals and Seidel in their seminal paper [15] with the following equivalent definition (among others): C is a spherical τ -design if and only if holds for all polynomials p(x) = p(x 1 , x 2 , . . . , x n ) of total degree at most τ where σ n denotes the normalized (n − 1)-dimensional Hausdorff measure. The largest τ such that C is a spherical τ -design is called the strength of C.
The following Delsarte-Yudin type linear programming theorem is a key tool for obtaining the upper bounds for the quantity G h (n, M, s) given in Theorem 3.2.
with equality holding throughout (7) if and only if both conditions Proof. Although this result can be deduced from the lower bound for energy given in [35] (see also [5,Theorem 5.5.1]), we include a direct proof here for the convenience of the reader.
Let C ⊂ S n−1 be a spherical code. Since f (t) ∈ U n,s h , its Gegenbauer expansion where the right-hand side of (8) is obtained using (6) and interchanging the order of summation.
If C ∈ C(n, M, s) and f ∈ U n,s h , then the condition (F1) together with s(C) = s imply that the left hand side of (8) is at least M f (1) + E h (C). Furthermore, (F2) and the inequalities M i (C) ≥ 0 for i = 1, 2, . . . , deg(f ) yield that the right-hand side is at most M 2 f 0 . Therefore Since these estimations are valid for every code C ∈ C(n, M, s) we conclude that the desired bound follows. (1)) if and only if condition (b) is satisfied. Hence, equality holds in (9) if and only if both (a) and (b) are satisfied.
In the next section, we will construct polynomials in U n,s h for any fixed n, s, and h ∈ AM([−1, 1]) that can be used in conjunction with Theorem 2.2 to provide explicit upper bounds for G h (n, M, s), where M is chosen in accordance with s and n.

Construction of feasible polynomials for Theorem 2.2
In this section we develop methods for constructing polynomials in U n,s h for a given potential h and parameters n and s; we shall refer to such polynomials as feasible polynomials. These methods rely on the Levenshtein framework (reviewed below) used to obtain universal bounds on the cardinality of maximal codes with given separation distance and universal lower bounds on potential energy of codes of given cardinality (see [24], [7], and [11]).

3.1.
Levenshtein framework parameters and ULB spaces. We first recall the definition of the Levenshtein function bounding the quantity A(n, s) := max{|C| : C ⊂ S n−1 , x, y ≤ s, x = y ∈ C} that denotes the maximal possible cardinality of a spherical code on S n−1 of prescribed maximal inner product s.
For every s ∈ I m , using linear programming bounds for special polynomials f For every fixed dimension n, each bound L m (n, s) is smooth with respect to s. The Levenshtein function is defined as It is a function that is continuous and strictly increasing in s, whose values at the endpoints of the intervals I m coincide with the Delsarte-Goethals-Seidel numbers D(n, m) (see [15] for the definition). Next, we introduce the notion of a 1/N -quadrature rule over subspaces consisting of polynomials (see [7]). The classical example of 1/N -quadrature rule is given by Levenshtein's Theorem 5.39 in [24], where a Gauss-Jacobi quadrature formula is defined (see [23] for the origin of this result).
In our terminology, given a code C ∈ C(n, M, s), we associate (uniquely) m := m(n, s) such that s ∈ I m . Then (13) is a 1/L m (n, s)-quadrature rule exact for the subspace of real polynomials of degree at most m. Hereafter L m (n, s), m = 1, 2, . . ., will denote the Levenshtein function (12) on the interval I m as defined in (10).
The nodes in the Levenshtein's 1/L m (n, s)-quadrature rule are the roots of certain polynomial f (n,s) m (t) of degree m (see [24,Theorem 5.39]), called the Levenshtein polynomial, that is used for obtaining the bound (11). The explicit form of f (n,s) m (t) (see [23,] or [24, Eq. (3.82)]) is given by (14) f (n,s) where T is the multiset of cardinality m. The reader may easily verify that for both even and odd m that The numbers α 0 , α 1 , . . . , α k−1+ε are the (simple) roots of the equation (t) are Jacobi polynomials as above, ε ∈ {0, 1} (i.e., (a, b) = (0, ε)), and m = 2k − 1 + ε. Hereafter we use ε ∈ {0, 1} and m = 2k − 1 + ε to distinguish between the cases of odd and even m. Note that s = α k−1+ε and that −1 < α i < α i+1 for each i apart from the case α 0 = −1 which happens if and only if m = 2k. The Levenshtein quadrature now can be stated as (18) f holding true for every real polynomial f (t) of degree at most m = 2k − 1 + ε. Spaces of polynomials where a 1/N -quadrature rule is valid for some N 's (not necessarily integer) and where a solution of a corresponding linear programming problem (about lower energy bounds) exists were called ULB-spaces in [11] (ULB stands for Universal lower bound(s)). Theorem 3.2 below shows that in the ULB-space P m universal upper bounds (UUB) are also featuring.

3.2.
Construction of UUB feasible polynomials. We use the Levenshtein polynomials to construct feasible polynomials. Let n, M , and s be such that the set C(n, M, s) is nonempty (or conjectured to be nonempty). Let m = m(n, s) be as defined in the previous subsection and let h ∈ AM([−1, 1]). We consider the polynomial (19) f (t) := −λf (n,s) where λ > 0 is a parameter (to be determined later) and is the Hermite interpolation polynomial to the function h(t) that agrees with h(t) exactly in the points of a multiset T (counted with their multiplicities); that is, g T interpolates h and h ′ agree at repeated nodes. Note that by the definition of Hermite interpolation the degree of g T (t) is at most |T | − 1 = m − 1. Thus, deg(f ) = m and this, in particular, implies that we need to verify non-positivity of the Gegenbauer coefficients f i for 1 ≤ i ≤ m only. Let (20) f (n,s) be the Gegenbauer expansions of f  For any large enough λ > 0, we have that the polynomial f (t) defined as in (19) belongs to the class U n,s h . In particular, if the corresponding polynomial f   Proof. The Hermite interpolation formula with remainder (e.g., see [14]) states that there is some ξ ∈ [−1, s] such that Using absolute monotonicity of h and (16) then shows g T (t) ≥ h(t) for t ∈ [−1, s] and hence it follows from (19) (again using (16)) that f (t) ≥ h(t) for every t ∈ [−1, s]; i.e. (F1) is satisfied (whatever λ > 0 is).
For (F2), observe that (19) implies that the coefficients f i , i = 1, 2, . . . , m, in the Gegenbauer expansion of f (t) are in fact the linear combinations −λℓ i + g i . Since ℓ i > 0 for every i it follows that large enough λ > 0 will ensure f i ≤ 0 for every i = 1, 2, . . . , m. Obviously, f i = −λℓ i for deg(g T ) + 1 ≤ i ≤ m. Therefore, (F2) is satisfied (for large enough λ) and the proof of f (t) ∈ U n,s h is completed. Since f 0 M − f (1) is a linear function of λ, the conditions −λℓ i + g i ≤ 0 for i = 1, 2, . . . , deg(g T ) imply that the smallest value of λ which works is as in (21).
Equality in (22) implies equality in Theorem 2.2, therefore, such equality holds only if all inner products of distinct points in C are in T and f i M i (C) = 0 for every i ≥ 1.
We now compute the bound produced by f (t). We first note that L m (n, s) ≥ M follows from (11). Indeed, if the converse M > L m (n, s) is true, then the monotonicity of the Levenshtien function implies s(C) > s, which contradicts to C ∈ C(n, M, s).
Expressing f 0 by the Levenshtein's 1/L m (n, s)-quadrature rule we consecutively obtain (the last equality follows by using the interpolation conditions f (α i ) = h(α i ), i = 0, 1, . . . , k − 1 + ε) whence we get (22). The dependence of (22) on λ comes from f (1) only. Since f (1) is linear and increasing with respect to λ, the best bound is obtained when λ is chosen as in (21).
Remark 3.4. We note that that adding an additional interpolation condition, say by adding a node −1 or s to the multiset T in (15), does not improve the UUB. Indeed, suppose m = 2k − 1 and we consider T ′ = {−1, α 0 , α 0 , . . . , α k−1 }. In this case the interpolation polynomial g T ′ (t) = H h,T ′ (t) is of degree 2k − 1 and the interpolation conditions imply that where µ is a real number. Then for any polynomial and this representation says that, in the optimal case, −λ ′ + µ = −λ, where λ is chosen as in (21). Thus we produce the UUB again. The case m = 2k can be dealt analogously.
We next consider the optimality of our bound in a class of feasible polynomials.
m is the polynomial from Theorem 3.2, gives an upper bound by Theorem 2.2 which is not better than (22). (1). As in the proof of Theorem 3.2, we see that m (1) follows; i.e., the bound from F (t) is not better than (22).   Theorem 3.8. In the context of Theorem 2.2, if a code C ⊂ C(n, M, s) attains the bound (22) then its distance distribution with respect to x ∈ C satisfies the system of linear equations Proof. The definition (6) of the moments can be rewritten as Since M i (C) = 0 if and only if x∈C v(x) = 0 for all spherical harmonics v ∈ Harm(i), we may use the addition formula [20] to show that the double sum in (24) splits into |C| sums each one equal to −1. Indeed, for fixed y ∈ C, we consecutively obtain where r i = dim Harm(i) and {v ij (x) : j = 1, 2 . . . , r i } is an orthonormal basis of Harm(i). Thus which completes the proof.
If M i (C) = 0 for each i ∈ {2, 3, . . . , m}, we obtain m − 1 = 2k − 2 + ε linear equations with k + ε unknowns. Of course, we add the trivial equation On the other hand, we apply the 1/L m (n, s)-quadrature for the polynomials P Looking at this as a system with unknowns L m (n, s)ρ j , j = 0, 1, . . . , k − 1 + ε, we obtain again (23) (written for i = 2, 3, . . . , m). It is easy to see that we have at least as many equations as unknowns for k ≥ 2. If the solution is unique, then A α j (x) = ρ j L m (n, s), j = 0, 1, . . . , k − 1 + ε (in particular, it follows that the distance distribution does not depend on x), which leads to M = L m (n, s) by the trivial equations (25) and  An example of attaining codes with k = 1 is given in Section 4.1.

Test functions.
Next we derive a sufficient condition for optimality of the UUB in Theorem 3.2. For s ∈ I m and positive integer j, define test functions where the parameters (ρ i , α i ) k−1+ε i=0 come from the Levenshtein 1/L m (n, s)-quadrature. Proof. Suppose that R (n) j (s) ≥ 0 for every positive integer j. Write F (t) ∈ U n,s h as where u(t) is a polynomial of degree at most 2k −1+ε with zeroth Gegenbauer coefficient m (1). Using the Levenshtein 1/L m (n, s)-quadrature for u(t) and the above relations we consecutively obtain Hence the bound produced by F (t) is not better than (22).
3.5. The energy strip of C(n, M, s). Lower bounds for G h (n, M, s) can be derived, of course, from constructions of good codes (in a sense of having large energies). We present here an analytic approach defining a strip where the energies of all codes from C(n, M, s) lie and, in particular, a lower bound on G h (n, M, s). More precisely, we combine the upper bound from Theorem 3.2 and the universal lower bound from [7] to obtain a strip where all possible energies of codes from C(n, M, s) belong.
To explain the lower bounds we start with setting with M = L m (n, r) for a unique r ∈ I m , where m = 2k − 1 + ε, ε ∈ {0, 1}, as above (the uniqueness follows from the strict monotonicity of the Levenshtein bounds). Note that r ≤ s as equality holds if and only if there exists a universally optimal code of cardinality M = L m (n, s) (see also the comment after the next theorem). Let the Levenshtein polynomial f Theorem 3.11. The energy of any code C ∈ C(n, M, s) is bounded from below and above by It is clear from the above that M = L m (n, s) implies the coincidence of the upper and lower bounds in (27). In this case the corresponding codes are sharp configurations (also universally optimal codes; see [2,13,24]) which means that they attain simultaneously the Levenshtein bound, the ULB [7] and the UUB from Theorem 3.2 (as the last two coincide and the strip (27) becomes a point). Two prominent examples are given by the simplex code C ∈ C(n, n + 1, −1/n) and the cross polytope (also known as bi-orthogonal code) C ∈ C(n, 2n, 0).

4.1.
Orthonormal basis codes and the UUB. First, we now provide an example of a code where the UUB is attained. Moreover, we obtain more than one optimal polynomials.
Suppose C ⊂ S n−1 consists of orthonormal basis vectors in R n and select s = 0. Then M = n and E h (C) = n(n − 1)h(0). Clearly, the constant polynomial f (t) := h(0) provides one solution to the LP problem. We now determine a second one.

4.2.
Bounds for (n, M ) = (n, 2n + 1) codes. It is natural to consider upper bounds for parameters where good codes are known. Here we show how our bound behaves for spherical codes C n ⊂ S n−1 with M = 2n + 1 points constructed in [16]. These codes are conjectured to be optimal (see [3, Section 3.3]) but this is proved in dimensions 3 [30] and 4 [36] only. The maximal inner product of C n is equal to the unique root s ∈ (0, 1/n) of the equation n(n − 2) 2 X 3 − n 2 X 2 − nX + 1 = 0.
These parameters are in the region of the third Levenshtein bound; i.e., we use m = 3. The ULB [7] with parameters coming from L 3 (n, r) = M as in Section 3.5 is To obtain the UUB in this case we consider the corresponding Levenshtein polynomial f (n,s) 3 (t) with zeros α 0 (double) and α 1 = s (simple). Then T = {α 0 , α 0 , α 1 } and g(t) := H h,T (t) is the second degree interpolant to h in the nodes α 0 (doubly) and α 1 . The polynomial from (19) is where λ > 0 has to be chosen to ensure f 1 ≤ 0 and f 2 ≤ 0 (f 3 < 0 follows for every λ > 0).
Then we search for λ to satisfy the conditions f i ≤ 0 for i = 1, 2, 3. The computations show that all λ ≥ 0.661 work as best the upper bound ≈ 41.906 from Theorem 3.2 (also the upper bound in (27)) is obtained with the smallest possible λ = g 1 /ℓ 1 ≈ 0.661. For the representation of the upper bound in (27) Table 1 summarizes our results for n = 2 − 10. We list the dimension, known kissing number intervals, Levenshtein interval m and Levenshtein function value L m (n, 1/2) and the corresponding ULB and UUB intervals. Numbers are rounded to integer parts, rounding being indicated with the decimal point.

4.4.
Conclusion and future work. The conditions for attaining the bound of Theorem 3.2 lead to the usual suspects -the universally optimal configurations defined in [13]. From a broader viewpoint, our upper bounds help provide a range of possible energies (or energy levels) for 'good' spherical codes. Thereby, we obtain restrictions on the structure of codes that can be useful for classification (or nonexistence) purposes. We plan to explore this idea in a future paper that relates to kissing configurations.
Several additional related questions arise quite naturally. For example, whether the optimality condition f 1 = 0 (see Remark 3.6) is true for every absolutely monotone potential function h. A second question is whether effective 'next level' upper bounds can be developed in a manner similar to that derived for lower bounds by the present authors in [11] (see also [13]).