User:Godtone/zeta

From Xenharmonic Wiki
Jump to navigation Jump to search

Zeta ET rankings (top 20)

I processed (the first part of) the output spam given by #the code on the terminal like this:

zetalist = [eval(x) for x in '''[spam]'''.split('\n')]
zeta_top20 = dict()
for x in zetalist:
  i = 0
  edo = 0
  for entry in x:
    if type(entry)==list:
      edo = entry[0]
      if i in zeta_top20:
        zeta_top20[i].append(edo)
      else:
        zeta_top20[i] = [edo]
    else:
      i += 1

Then I styled the list a bit. B- upwards means zeta considers it top 10 at some point. If worse than F+, it never makes it in the top 20.

tiers = ['zeta','S+','S','S-','A+','A','A-','B+','B','B-',
           'C+','C','C-','D+','D','D-','E+','E','E-','F+']
for i in range(20):
  print( str(i+1)+'.', tiers[i], 'tier:', str(zeta_top20[i])[1:-1] )

Importantly: the smaller the equal temperament and corresponding edo, the more severe it is if it's ranked low, because it had less things it needed to beat (e.g. 104edo, 109edo and 181edo are all interesting tunings in E tier).

Also important: the below list contains seeming "dupes" of small edos corresponding to nonoctave peaks, so dupes are not even remotely like edos!

  1. zeta tier: 1, 2, 3, 3, 4, 4, 5, 5, 7, 7, 10, 10, 12, 12, 19, 22, 27, 31, 41, 53, 72, 99, 118, 130, 152, 171, 217, 224, 270, 342, 422, 441, 494, 742, 764, 935, 954, 1012, 1106, 1178, 1236
  2. S+ tier: 9, 9, 9, 14, 14, 15, 17, 34, 46, 58, 87, 140, 183, 243, 311, 525, 571, 581, 882
  3. S tier: 3, 3, 3, 3, 4, 6, 6, 8, 8, 24, 65, 77, 94, 111, 190, 301, 612, 814, 836, 1205
  4. S- tier: 26, 43, 68, 80, 84, 354, 400, 684, 718, 795
  5. A+ tier: 6, 6, 6, 6, 16, 16, 29, 36, 50, 60, 103, 159, 373, 388, 460, 472, 624, 653, 665, 783
  6. A tier: 193, 198, 323, 711, 1065
  7. A- tier: 5, 5, 5, 11, 11, 11, 13, 13, 38, 63, 106, 113, 121, 149, 282, 364, 1084
  8. B+ tier: 5, 8, 8, 8, 125, 289, 328, 1224
  9. B tier: 11, 11, 21, 39, 62, 239*, 255, 383, 513, 1053
  10. B- tier: 9, 11, 37, 48, 56, 161, 212, 229, 320, 407, 566
  11. C+ tier: 7, 8, 8, 8, 8, 13, 18, 89, 137, 202, 277, 414, 908, 988
  12. C tier: 20, 23, 296, 436, 535, 540, 1075, 1164
  13. C- tier: 20, 20, 25, 32, 49, 166, 205, 552, 894, 1125
  14. D+ tier: 7, 7, 7, 96, 145, 207, 248, 1007
  15. D tier: 9, 9, 9, 9, 9, 9, 45, 82, 176, 692
  16. D- tier: 8, 10, 16, 643
  17. E+ tier: 14, 15, 15, 28, 35, 104, 135, 369, 593, 677, 863
  18. E tier: 12, 21, 21, 109, 144, 181, 431, 597, 631
  19. E- tier: 18, 18, 44, 75, 91, 251, 487
  20. F+ tier: 13, 33, 55, 395, 410, 453

(* Note that 239 is 9th place not 10th place; at some resolutions (like the one used by the code given here), it says it's 10th place, because it's extremely close in score to 193. So its inclusion in the top 9 below is correct. I corrected this manually in the above list after noticing the discrepancy. Perhaps of note then is that 229 is preferred by my code to 239, while zeta prefers 239 to 229. Both are large prime edos a bit over 200 wanting a slightly flat octave, so it feels natural to pair and contrast them.)

Observations

Notably there are some edos known to be significant surprisingly low down, like 202edo (which appears in the optimal_edo_sequences for a large range of odd-limits) is at 11th place (what I labelled "C+"), which is shared by 277edo, which appears in the 41- thru 45-odd-limit and the 113- thru at least 129-odd-limit, which one could argue are not insignificant places to appear either. Even more striking is the placement of 181edo, which is (a large) prime (which is the only thing I have against it), whose significance is explained via 181+183=364 among other val sums. By contrast, 176edo does not appear a single time in those sequences but zeta finds it somewhat noteworthy at 15th, though you could argue that makes a good reason to take a "top 14" as a good cutoff, considering some other strange edos appear at 15th and 16th place too, including a lot of suboptimal peaks corresponding to strong octave tempering of edos 8, 9, 10 and 16, but also, the top 14 barely includes 207edo and 248edo, where the latter has many occurrences and the former has only three (119- thru 123-odd-limit).

Note that 55edo (without octave tempering) is zeta valley so arguably is meaningfully in zeta's "F tier", though the larger tunings are likely to be "F tier" sense (because zeta found them good enough to note among hundreds of edos). (If you're curious, the next zeta valley, 79, is so bad it fails to make a top 20 even with ideal octave-tempering. To me this singles out 80 as of interest as explaining 79's badness as being a mistuning of 80. For the same reason and based on my own analysis, I believe 56edo is interesting as potentially being a factor in 55edo being zeta valley; it does make it 10th place (B- tier) and shares its place with strong nicher systems like 48edo, 161edo, 229edo and 239edo (of which my code pr, of which 161edo appears in the optimal_edo_sequence of the 55- thru at least 131-odd-limit, and also in the 23- and 49-odd-limit specifically. I first noted it as probably the only meaningfully nontrivial tuning of the 1\23 period temperament icositritonic, for which 46edo is a(n important) trivial tuning; reason being, beyond 161edo, the equivalences of icositritonic start to strain the tuning profile too much considering the accuracy that edos of that size are capable of.)

An anecdotal observation is that a lot of edos that people love disproportionately/especially (so that they gain some level of fame and/or infamy, often by association with multiple users (with a single user being more common for larger EDOs ofc)) are in the S+ tier if not already in the zeta tier, obviously up to a max size. Specifically (from what I recognise), in the S+ tier is 9, 15, 17, 34, 46, 58, 87, 140, 311 while in the zeta tier is 10, 12, 19, 22, 31, 41, 53, 72, 99, 171, 217, 224, 270. The S and S- tiers contain their share of such edos too, but have less entries, which brings us to:

A potentially significant observation is that the list of zeta edos is by far the longest. This is not trivial because why should there be generally more "record" edos than "second-to-record" or "nth-to-record" edos? The likely but boring reason is that every time an equal temperament makes "nth place" (or better), it raises the bar for "nth place", so that there is an unexpected strictness required whereby the longer it's been since a record peak, the higher the bars are for nth best. Likely the latter is the main reason, but I suspect the former contributes too. A less likely but more interesting reason that could be contributing to it is because strong edos represent natural points of convergence when making different choices in regards to tempering, so that being "second-best" often implies deviating in some way from those choices in a way that often (but not always) causes suboptimality.

There is also markedly few EDOs in the A tier (6th) and B+ tier (8th), so that "top 5" and "top 7" might be of interest, though in both cases, there are interesting edos (ones liked by optimal_edo_sequences) included one further; for top 6, we include 193 which is paired naturally with 190 while for top 8 we include 125 and 289.

In regards to the presence of 39, it should be noted that 39edo is close to a zeta valley, so that 39 represents a nontrivial improvement in apparent well-tuned-ness by tempering the octave 3.8 ¢ flat (which is more significant than it looks on paper, so that it can be used for investigating the effects of zeta-informed octave-tempering).

Finally, note that most edos here have pages for them already. This is not so surprising for smaller edos, but is perhaps surprising in how few edos in the hundreds (or even thousands) are missing. Either people make too many pages on large edos or they are actually finding large edos that are of interest relative to others of their size (almost certainly both).

Based purely on what edos are and are not included, to me the best cutoffs are top 4, top 10, top 11 and top 14.

Python 3 data

The below is provided for convenience, with no duplicates.

l1 = sorted(list(set([1, 2, 3, 3, 4, 4, 5, 5, 7, 7, 10, 10, 12, 12, 19, 22, 27, 31, 41, 53, 72, 99, 118, 130, 152, 171, 217, 224, 270, 342, 422, 441, 494, 742, 764, 935, 954, 1012, 1106, 1178, 1236])))
l2 = sorted(list(set([9, 9, 9, 14, 14, 15, 17, 34, 46, 58, 87, 140, 183, 243, 311, 525, 571, 581, 882])))
l3 = sorted(list(set([3, 3, 3, 3, 4, 6, 6, 8, 8, 24, 65, 77, 94, 111, 190, 301, 612, 814, 836, 1205])))
l4 = sorted(list(set([26, 43, 68, 80, 84, 354, 400, 684, 718, 795])))
l5 = sorted(list(set([6, 6, 6, 6, 16, 16, 29, 36, 50, 60, 103, 159, 373, 388, 460, 472, 624, 653, 665, 783])))
l6 = sorted(list(set([193, 198, 323, 711, 1065])))
l7 = sorted(list(set([5, 5, 5, 11, 11, 11, 13, 13, 38, 63, 106, 113, 121, 149, 282, 364, 1084])))
l8 = sorted(list(set([5, 8, 8, 8, 125, 289, 328, 1224])))
l9 = sorted(list(set([11, 11, 21, 39, 62, 255, 239, 383, 513, 1053])))
l10 = sorted(list(set([9, 11, 37, 48, 56, 161, 212, 229, 320, 407, 566])))

the code

The below is the code I used provided in case you want to use it; it's a slight modification of the code provided at User:Sintel/Zeta plot python.

import math
import numpy as np
import matplotlib.pyplot as plt
from mpmath import zeta, mp
from scipy.signal import find_peaks

# Set precision for mpmath
mp.dps = 17

# Define the range for t
t_min, t_max = 0.25, 1280.25

# Real part of the variable
# Use 0.5 for critical line
sigma = 0.5

# Create array of t values
num_points = 512*9*7*5 # (i like nice composite numbers)
t_values = np.linspace(t_min, t_max, num_points)

# Calculate zeta function magnitude using s = sigma + 2πit/ln(2)
zeta_magnitudes = np.zeros(num_points)
for i, t in enumerate(t_values):
    s = complex(sigma, 2 * math.pi * t / math.log(2))
    zeta_magnitudes[i] = float(abs(zeta(s)))

# Create the plot
plt.figure(figsize=(16, 9))
plt.plot(t_values, zeta_magnitudes, color="black")

# Add title and labels
plt.title(f"Magnitude of Riemann Zeta function for s = {sigma:.2f} + 2πit/ln(2)", fontsize=14)
plt.xlabel("t", fontsize=12)
plt.ylabel("|ζ(s)|", fontsize=12)

# Add grid lines
# plt.grid(alpha=0.3)

# Find local maxima
peaks, _ = find_peaks(zeta_magnitudes, height=0.5, distance=10)
peak_t_values = t_values[peaks]
peak_magnitudes = zeta_magnitudes[peaks]

# Find record maxima (peaks that are higher than any previous peak)
record_peaks = []
record_t_values = []
record_magnitudes = []
max_magnitudes_so_far = [(0,0)] # ALTERED
better_than_best = 20 # NEW
only_count_records = False

for i, (t, mag) in enumerate(zip(peak_t_values, peak_magnitudes)):
    if any([ mag > last_max[1] for last_max in max_magnitudes_so_far[-better_than_best:] ]): # ALTERED
        if not only_count_records or mag >= max_magnitudes_so_far[-1][1]:
            max_magnitudes_so_far.append( (round(t),mag) ) # ALTERED
            max_magnitudes_so_far.sort(key=lambda edo_score: edo_score[1]) # (so that we don't compare to worse recenter stuff)
            if not only_count_records:
                print([ [edo_score[0]] if edo_score[0]==round(t) else edo_score[0] for edo_score in max_magnitudes_so_far[-better_than_best:] ][::-1])
            else: # if only_count_records:
                print(round(t),'>',max_magnitudes_so_far[-better_than_best])
        record_peaks.append(i)
        record_t_values.append(t)
        record_magnitudes.append(mag)

# Mark all record peaks
plt.plot(record_t_values, record_magnitudes, "ro", markersize=4)

for t, mag in zip(record_t_values, record_magnitudes):
    # Add text label above
    name = f"{round(t)}et"
    plt.text(
        t,
        mag + 0.25,
        name,
        ha="center",
        fontsize=10,
    )
    print(str(round(t))+'et =',str(int(t*100+.5)/100)+'edo')

plt.axhline(y=0, color="black", alpha=0.2)

plt.tight_layout()

ax = plt.gca()
ax.spines["right"].set_visible(False)
ax.spines["top"].set_visible(False)

plt.show()

Top 10

Below is a list of equal temperaments (that is, edos with octave-tempering) that the zeta function considers to be tuned well relative to their size, up to 311et.

We can be confident in their notability because the larger entries appear in a wide range of odd-limits (19 thru 123) according to the optimal_edo_sequences for those odd-limits. (You can calculate them yourself by using my copyleft Python 3 code (which needs no dependencies).)

Specifically, an equal temperament is included if it does better than the 10th-best-scoring equal temperament so far*, and the below details both what is added to the sequence and the top 9 at any given point. These can mostly be thought of as corresponding to edos with the exception of 39 equal temperament, because 39edo is close to a zeta valley so that it isn't meaningfully considered in-tune by zeta without the 3.8 ¢ flat octave that zeta recommends.

* For this reason, we start the list at 10et (corresponding to 10edo) because all previous equal temperaments' inclusion is unsurprising. (The first to be excluded is 18et, corresponding to 18edo being close to a zeta valley.)

The resulting sequence is: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 21, 22, 24, 26, 27, 29, 31, 34, 36, 37, 38, 39, 41, 43, 46, 48, 50, 53, 56, 58, 60, 62, 63, 65, 68, 72, 77, 80, 84, 87, 94, 99, 103, 106, 111, 113, 118, 121, 125, 130, 140, 149, 152, 159, 161, 171, 183, 190, 193, 198, 212, 217, 224, 229, 239, 243, 255, 270, 282, 289, 301, 311.

Top 10 placement data

[[10], 7, 9, 5, 8, 4, 6, 3, 2, 6]

[10, 7, 9, 5, 8, 4, [11], 6, 3, 2]

[10, 7, 9, 5, 8, 4, [11], 6, 3, [11]]

[[12], 10, 7, 9, 5, 8, 4, 11, 6, 3]

[12, 10, 7, 9, 5, 8, [13], 4, 11, 6]

[12, [14], 10, 7, 9, 5, 8, 13, 4, 11]

[12, [15], 14, 10, 7, 9, 5, 8, 13, 4]

[12, 15, 14, 10, [16], 7, 9, 5, 8, 13]

[12, [17], 15, 14, 10, 16, 7, 9, 5, 8]

[[19], 12, 17, 15, 14, 10, 16, 7, 9, 5]

[19, 12, 17, 15, 14, 10, 16, 7, [21], 9]

[[22], 19, 12, 17, 15, 14, 10, 16, 7, 21]

[22, 19, [24], 12, 17, 15, 14, 10, 16, 7]

[22, 19, 24, [26], 12, 17, 15, 14, 10, 16]

[[27], 22, 19, 24, 26, 12, 17, 15, 14, 10]

[27, 22, 19, 24, [29], 26, 12, 17, 15, 14]

[[31], 27, 22, 19, 24, 29, 26, 12, 17, 15]

[31, [34], 27, 22, 19, 24, 29, 26, 12, 17]

[31, 34, 27, 22, [36], 19, 24, 29, 26, 12]

[31, 34, 27, 22, 36, 19, 24, 29, 26, [37]]

[31, 34, 27, 22, 36, 19, [38], 24, 29, 26]

[31, 34, 27, 22, 36, 19, 38, 24, [39], 29]

[[41], 31, 34, 27, 22, 36, 19, 38, 24, 39]

[41, 31, 34, [43], 27, 22, 36, 19, 38, 24]

[41, [46], 31, 34, 43, 27, 22, 36, 19, 38]

[41, 46, 31, 34, 43, 27, 22, 36, 19, [48]]

[41, 46, 31, 34, [50], 43, 27, 22, 36, 19]

[[53], 41, 46, 31, 34, 50, 43, 27, 22, 36]

[53, 41, 46, 31, 34, 50, 43, 27, [56], 22]

[53, [58], 41, 46, 31, 34, 50, 43, 27, 56]

[53, 58, 41, 46, [60], 31, 34, 50, 43, 27]

[53, 58, 41, 46, 60, 31, 34, 50, [62], 43]

[53, 58, 41, 46, 60, 31, [63], 34, 50, 62]

[53, 58, [65], 41, 46, 60, 31, 63, 34, 50]

[53, 58, 65, [68], 41, 46, 60, 31, 63, 34]

[[72], 53, 58, 65, 68, 41, 46, 60, 31, 63]

[72, 53, [77], 58, 65, 68, 41, 46, 60, 31]

[72, 53, 77, [80], 58, 65, 68, 41, 46, 60]

[72, 53, 77, [84], 80, 58, 65, 68, 41, 46]

[72, [87], 53, 77, 84, 80, 58, 65, 68, 41]

[72, 87, [94], 53, 77, 84, 80, 58, 65, 68]

[[99], 72, 87, 94, 53, 77, 84, 80, 58, 65]

[99, 72, 87, 94, [103], 53, 77, 84, 80, 58]

[99, 72, 87, 94, 103, 53, 77, [106], 84, 80]

[99, 72, [111], 87, 94, 103, 53, 77, 106, 84]

[99, 72, 111, 87, 94, 103, [113], 53, 77, 106]

[[118], 99, 72, 111, 87, 94, 103, 113, 53, 77]

[118, 99, 72, 111, 87, 94, [121], 103, 113, 53]

[118, 99, 72, 111, 87, 94, 121, [125], 103, 113]

[[130], 118, 99, 72, 111, 87, 94, 121, 125, 103]

[130, [140], 118, 99, 72, 111, 87, 94, 121, 125]

[130, 140, 118, 99, 72, 111, [149], 87, 94, 121]

[[152], 130, 140, 118, 99, 72, 111, 149, 87, 94]

[152, 130, 140, 118, [159], 99, 72, 111, 149, 87]

[152, 130, 140, 118, 159, 99, 72, 111, 149, [161]]

[[171], 152, 130, 140, 118, 159, 99, 72, 111, 149]

[171, [183], 152, 130, 140, 118, 159, 99, 72, 111]

[171, 183, [190], 152, 130, 140, 118, 159, 99, 72]

[171, 183, 190, 152, 130, [193], 140, 118, 159, 99]

[171, 183, 190, 152, 130, [198], 193, 140, 118, 159]

[171, 183, 190, 152, 130, 198, 193, 140, 118, [212]]

[[217], 171, 183, 190, 152, 130, 198, 193, 140, 118]

[[224], 217, 171, 183, 190, 152, 130, 198, 193, 140]

[224, 217, 171, 183, 190, 152, 130, 198, 193, [229]]

[224, 217, 171, 183, 190, 152, 130, 198, 193, [239]]

[224, [243], 217, 171, 183, 190, 152, 130, 198, 193]

[224, 243, 217, 171, 183, 190, 152, 130, [255], 198]

[[270], 224, 243, 217, 171, 183, 190, 152, 130, 255]

[270, 224, 243, 217, 171, 183, [282], 190, 152, 130]

[270, 224, 243, 217, 171, 183, 282, [289], 190, 152]

[270, 224, [301], 243, 217, 171, 183, 282, 289, 190]

[270, [311], 224, 301, 243, 217, 171, 183, 282, 289]