The Riemann zeta function and tuning: Difference between revisions

Sintel (talk | contribs)
Zeta integral edos: no it doesn't?
BudjarnLambeth (talk | contribs)
No edit summary
 
(20 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{High priority}}
{{Texops}}
{{Texops}}
{{Wikipedia|Riemann zeta function}}
{{Wikipedia|Riemann zeta function}}
Line 9: Line 7:
If you look for a filter to quickly sort all the equal temperaments into those that approximate JI well and those that do not, the [[#Zeta edo lists|edo lists]] below can be useful. The caveat is that it collapses the variety of characteristics of a temperament to a one-dimensional rating, with little capacity to show the nuances of each system. It is therefore best to keep in mind that judging the temperaments by zeta is no replacement for investigating each temperament in detail.  
If you look for a filter to quickly sort all the equal temperaments into those that approximate JI well and those that do not, the [[#Zeta edo lists|edo lists]] below can be useful. The caveat is that it collapses the variety of characteristics of a temperament to a one-dimensional rating, with little capacity to show the nuances of each system. It is therefore best to keep in mind that judging the temperaments by zeta is no replacement for investigating each temperament in detail.  


There are other metrics besides zeta for other definitions of "approximating well", such as [[mu badness]] and the various [[:Category:Regular temperament tuning|optimised regular temperament tunings]] when applied to [[rank]]-1 (i.e. equal) temperaments.
There are other metrics besides zeta for other definitions of "approximating well", which you can find in: [[:Category:Regular temperament tuning|optimised regular temperament tunings]].


Much of the below is thanks to the insights of [[Gene Ward Smith]]. Below is the original derivation as he presented it, followed by a different derivation from [[Mike Battaglia]] below which extends some of the results.
Much of the below is thanks to the insights of [[Gene Ward Smith]]. Below is the original derivation as he presented it, followed by a different derivation from [[Mike Battaglia]] below which extends some of the results.
Line 38: Line 36:


== Graph links ==
== Graph links ==
A link to the graph of zeta can be found at [https://samuelj.li/complex-function-plotter/#abs(zeta(i*2*pi*real(z)%2Fln(2)%2Bimag(z))) Zeta in Samuelj Plotter]. (In the top left menu, make sure that "Enable Checkerboard" is unticked and "Invert Gradient" and "Continuous Gradient" are ticked.) The function has been reoriented to place EDO size along the horizontal axis and weight along the vertical axis, and also scaled by <math>\tfrac{2\pi}{\ln(2)}</math> to ensure that the real number line aligns with edos. One can see that with higher weights, the function approaches a cyclic function with a period of 1; this corresponds to the prime 2 dominating more and more extremely as other harmonics are weighted less with higher weights. You can see this easier by raising the entire expression to an absurdly high power, such as 100. Note, however, that this visualization is inaccurate beyond a couple hundred: around 146.5, 324.5 and 473.5, and in many cases after, there appear to be zeroes that are not on the critical line; this is an artifact of the way the function is approximated and is the ultimate reason why the Riemann hypothesis remains unsolved. These actually correspond to zeroes that are very close together but on the critical line.   
A link to the graph of zeta can be found at [https://samuelj.li/complex-function-plotter/#abs(zeta(i*2*pi*real(z)%2Fln(2)%2Bimag(z))) Zeta in Samuelj Plotter]. (In the top left menu, make sure that "Enable Checkerboard" is unticked and "Invert Gradient" and "Continuous Gradient" are ticked.) The function has been reoriented to place EDO size along the horizontal axis and weight along the vertical axis, and also scaled by {{sfrac|2π|ln(2)}} to ensure that the real number line aligns with edos. One can see that with higher weights, the function approaches a cyclic function with a period of 1; this corresponds to the prime 2 dominating more and more extremely as other harmonics are weighted less with higher weights. You can see this easier by raising the entire expression to an absurdly high power, such as 100. Note, however, that this visualization is inaccurate beyond a couple hundred: around 146.5, 324.5 and 473.5, and in many cases after, there appear to be zeroes that are not on the critical line; this is an artifact of the way the function is approximated and is the ultimate reason why the Riemann hypothesis remains unsolved. These actually correspond to zeroes that are very close together but on the critical line.   


You may also view the graph of zeta along the critical line on Desmos: [https://www.desmos.com/calculator/dstp7wnidf Zeta in Desmos]. This makes it easier to see peaks, but only works for sigma=1/2.  
You may also view the graph of zeta along the critical line on Desmos: [https://www.desmos.com/calculator/dstp7wnidf Zeta in Desmos]. This makes it easier to see peaks, but only works for {{nowrap|σ {{=}} {{sfrac|1|2}}}}.  


=== Plots ===
=== Plots ===
Line 47: Line 45:
Using the [http://functions.wolfram.com/webMathematica/FunctionPlotting.jsp?name=RiemannSiegelZ online plotter] we can plot Z in the regions corresponding to scale divisions, using the conversion factor {{nowrap|''t'' {{=}} {{sfrac|2π|ln(2)}}''x''}}, for ''x'' a number near or at an edo number. Hence, for instance, to plot 12 plot around 108.777, to plot 31 plot around 281.006, and so forth. An alternative plotter is the applet [http://web.viu.ca/pughg/RiemannZeta/RiemannZetaLong.html here].
Using the [http://functions.wolfram.com/webMathematica/FunctionPlotting.jsp?name=RiemannSiegelZ online plotter] we can plot Z in the regions corresponding to scale divisions, using the conversion factor {{nowrap|''t'' {{=}} {{sfrac|2π|ln(2)}}''x''}}, for ''x'' a number near or at an edo number. Hence, for instance, to plot 12 plot around 108.777, to plot 31 plot around 281.006, and so forth. An alternative plotter is the applet [http://web.viu.ca/pughg/RiemannZeta/RiemannZetaLong.html here].


If you have access to {{w|Mathematica}}, which has Z, zeta and theta as a part of its suite of initially defined functions, you can do even better. Below is a Mathematica-generated plot of Z({{frac|2π''x''|ln(2)}}) in the region around 12edo:
If you have access to {{w|Mathematica}}, which has Z, zeta and theta as a part of its suite of initially defined functions, you can do even better. Below is a Mathematica-generated plot of Z{{pars|{{sfrac|2π''x''|ln(2)}}|1.8}} in the region around [[12edo]]:


[[File:plot12.png|alt=plot12.png|plot12.png]]
[[File:plot12.png|alt=plot12.png|plot12.png]]
Line 53: Line 51:
The peak around 12 is both higher and wider than the local maximums above 11 and 13, indicating its superiority as an approximation of JI. Note also that the peak occurs at a point slightly larger than 12; this indicates the octave is slightly compressed in the zeta tuning for 12. The size of a step in octaves is 1/''x'', and hence the size of the octave in the zeta peak value tuning for ''N''edo is ''N''/''x''; if ''x'' is slightly larger than ''N'' as here with {{nowrap|''N'' {{=}} 12}}, the size of the zeta tuned octave will be slightly less than a pure octave. Similarly, when the peak occurs with ''x'' less than ''N'', we have stretched octaves.
The peak around 12 is both higher and wider than the local maximums above 11 and 13, indicating its superiority as an approximation of JI. Note also that the peak occurs at a point slightly larger than 12; this indicates the octave is slightly compressed in the zeta tuning for 12. The size of a step in octaves is 1/''x'', and hence the size of the octave in the zeta peak value tuning for ''N''edo is ''N''/''x''; if ''x'' is slightly larger than ''N'' as here with {{nowrap|''N'' {{=}} 12}}, the size of the zeta tuned octave will be slightly less than a pure octave. Similarly, when the peak occurs with ''x'' less than ''N'', we have stretched octaves.


For larger edos, the width of the peak narrows, but for strong edos the height more than compensates, measured in terms of the area under the peak (the absolute value of the integral of Z between two zeros.) Note how 270 completely dominates its neighbors:
For larger edos, the width of the peak narrows, but for strong edos the height more than compensates, measured in terms of the area under the peak (the absolute value of the integral of Z between two zeros.) Note how [[270edo]] completely dominates its neighbors:


[[File:plot270.png|alt=plot270.png|plot270.png]]
[[File:plot270.png|alt=plot270.png|plot270.png]]
Line 64: Line 62:


== Gene Smith's original derivation ==
== Gene Smith's original derivation ==
Suppose ''x'' is a variable representing some equal division of the octave. For example, if {{nowrap|''x'' {{=}} 80}}, ''x'' reflects 80edo with a step size of 15 cents and with pure octaves. Suppose that ''x'' can also be continuous, so that it can also represent fractional or "nonoctave" divisions as well. The [[Bohlen–Pierce scale]], 13 equal divisions of 3/1, is approximately 8.202 equal divisions of the "octave" (although the octave itself does not appear in this tuning), and would hence be represented by a value of {{nowrap|''x'' {{=}} 8.202}}.
Suppose ''x'' is a variable representing some equal division of the octave. For example, if {{nowrap|''x'' {{=}} 80}}, ''x'' corresponds to [[80edo]] with a step size of 15 [[cent]]s and with pure octaves. Suppose that ''x'' can also be continuous, so that it can also represent fractional or "nonoctave" divisions as well, so that it ranges over all possible [[equal temperament]]s. The [[Bohlen–Pierce scale]], 13 equal divisions of 3/1, is approximately 8.202 equal divisions of the "octave" (although the octave itself does not appear in this tuning), and would hence be represented by a value of {{nowrap|''x'' {{=}} 8.202}}.


Now suppose that [https://www.desmos.com/calculator/krigk43int {{rr|''x''}}] denotes the difference between ''x'' and the integer nearest to ''x'':
Now suppose that [https://www.desmos.com/calculator/krigk43int {{rr|''x''}}] denotes the difference between ''x'' and the integer nearest to ''x'':
Line 74: Line 72:
For example, {{nowrap|{{rr|8.202}} {{=}} 0.202}}, since it is the difference between 8.202 and the nearest integer, which is 8. Meanwhile, {{nowrap|{{rr|7.95}} {{=}} 0.05}}, which is the difference between 7.95 and the nearest integer, which is 8. This represents the absolute relative error of the octave in equal tuning ''x'', or alternatively how much x is detuned from an edo.
For example, {{nowrap|{{rr|8.202}} {{=}} 0.202}}, since it is the difference between 8.202 and the nearest integer, which is 8. Meanwhile, {{nowrap|{{rr|7.95}} {{=}} 0.05}}, which is the difference between 7.95 and the nearest integer, which is 8. This represents the absolute relative error of the octave in equal tuning ''x'', or alternatively how much x is detuned from an edo.


For any value of ''x'', we can construct a ''p''-limit [[Patent_val|generalized patent val]]. We do so by rounding {{nowrap|''x'' log<sub>2</sub>(''q'')}} to the nearest integer for each prime ''q'' up to ''p''. For example, for {{nowrap|''x'' {{=}} 12}}, we find 2 at 12, 3 at 19, 5 at 28, etc. Now consider [https://www.desmos.com/calculator/4uamhon9tt the function]
For any value of ''x'', we can construct a ''p''-[[limit]] [[val]] by rounding {{nowrap|''x'' log<sub>2</sub>(''q'')}} to the nearest integer for each prime ''q'' up to ''p''. (More technically, this corresponds to what's known as a [[generalized patent val]].) For example, for {{nowrap|''x'' {{=}} 12}}, we find 2 at 12, 3 at 19, 5 at 28, etc. Now consider [https://www.desmos.com/calculator/4uamhon9tt the function]


<math>
<math>
Line 81: Line 79:
</math>
</math>


Here, the numerator represents the relative error on each prime, and the denominator represents a weight factor of the logarithm of each prime, so the function represents a p-limit badness metric.
Here, the numerator represents the relative error on each prime, and the denominator represents a weight factor of the logarithm of each prime*, so the function represents a p-limit badness metric.
 
(<nowiki>*</nowiki> Specifically, the reason we use the weighting 1/log<sub>2</sub>(''p'') is because of certain desirable properties it has that singles it out as of unique interest: if the complexity of a prime ''p'' is {{nowrap| log<sub>2</sub>(''p'') }}, then ''p''<sup>n</sup> is ''n'' times as complex as ''p''. Using {{nowrap| log<sub>2</sub>(''p'') }} as the complexity also means that the complexity of a harmonic, according to its prime factorization, exactly matches where it's found in the harmonic series, so that e.g. {{nowrap| 25 {{=}} 5 × 5 }} is slightly less complex than {{nowrap| 26 {{=}} 2 × 13 }} is slightly less complex than {{nowrap| 27 {{=}} 3 × 3 × 3 }}. Therefore, the {{nowrap| 1/log<sub>2</sub>(''p'') }} weighting is a kind of natural inverse-complexity weighting, that is, a simplicity weighting.)
 
(Also, for those unfamiliar, squaring the error is commonly done because it solves the flaws of two alternative ways of measuring error. Specifically, if you look only at the maximum error, you miss opportunities to make the tuning much better ''overall'' by allowing slightly more damage on the most damaged intervals, while if you look only at the average error, then it may be that you are unnecessarily damaging a few intervals a lot just to get intervals that are already in-tune slightly more in-tune, so both extremes have pathological behaviours, and using the squared error counters both of these behaviours so that it represents a more balanced approach to optimization that is used in a variety of disciplines.)


This function has local minima, corresponding to associated generalized patent vals. The minima occur for values of ''x'' which are the [[Tenney-Euclidean_Tuning|Tenney-Euclidean tuning]]s of the octaves of the associated vals, while ξ<sub>''p''</sub> for these minima is the square of the [[Tenney–Euclidean relative error]] of the val—equal to the TE error times the TE complexity, and sometimes known as "TE simple badness."
This function has local minima, corresponding to associated generalized patent vals. The minima occur for values of ''x'' which are the [[Tenney-Euclidean_Tuning|Tenney-Euclidean tuning]]s of the octaves of the associated vals, while ξ<sub>''p''</sub> for these minima is the square of the [[Tenney–Euclidean relative error]] of the val—equal to the TE error times the TE complexity, and sometimes known as "TE simple badness."
Line 88: Line 90:


<math>\displaystyle \xi_\infty(x) = \sum_{\substack{q \geq 2 \\ q \text{ prime}}} \frac{\lfloor x \log_2 q \rceil^2}{q^s}</math>
<math>\displaystyle \xi_\infty(x) = \sum_{\substack{q \geq 2 \\ q \text{ prime}}} \frac{\lfloor x \log_2 q \rceil^2}{q^s}</math>
Importantly, when {{nowrap|''s'' {{=}} 1}}, the weighting is 1/''p'' for a prime ''p'', so that it's very similar to a {{sfrac|1|''p'' − 1}} weighting. This latter weighting is equal to the average number of times prime ''p'' occurs as a factor in the harmonic series, counting repetition, so is of interest because it represents how many harmonics will feel damage from this prime being mistuned. Therefore, the weighting {{nowrap| 1/''p''  }} corresponds to under-prioritizing small primes slightly (with the effect being less slight the smaller the prime, so that at the most extreme, at prime 2 we have 1/2 instead of 1/1 weighting and at prime 3 we have 1/3 instead of 1/2 weighting).


Seeing that we notate the power as ''s'', it might become apparent where the Riemann zeta function will eventually show up.
Seeing that we notate the power as ''s'', it might become apparent where the Riemann zeta function will eventually show up.


If ''s'' is greater than one, this does converge. However, we might want to make a few adjustments. For one thing, if the error is low enough that the tuning is consistent, then the error of the square of a prime is twice that of the prime, of the cube tripled, and so forth until the error becomes inconsistent. When the weighting uses logarithms and error measures are consistent, then the logarithmic weighting cancels this effect out, so we might consider that prime powers were implicitly included in the Tenney-Euclidean measure - in fact, the primary intuition behind Tenney weighting is that it is the weighting pattern that values 25, 27, and 29 approximately evenly in importance despite being different powers. We can go ahead and include them by adding a factor of {{sfrac|1|''n''}} for each prime power ''p''<sup>''n''</sup>. A somewhat peculiar but useful way to write the result of doing this is in terms of the {{w|von Mangoldt function}}, an {{w|arithmetic function}} on positive integers which is equal to ln(''p'') on prime powers ''p''<sup>''n''</sup>, and is zero elsewhere. This is written using a capital lambda, as Λ(''n''), and in terms of it we can include prime powers in our error function as
If ''s'' is greater than one, this does converge. However, we might want to make a few adjustments. For one thing, if the error is low enough that the tuning is consistent, then the error of the square of a prime is twice that of the prime, of the cube tripled, and so forth until the error becomes inconsistent. When the weighting uses logarithms and error measures are consistent, then the logarithmic weighting cancels this effect out, so we might consider that prime powers were implicitly included in the Tenney-Euclidean measure—in fact, the primary intuition behind Tenney weighting is that it is the weighting pattern that values 25, 27, and 29 approximately evenly in importance despite being different powers. We can go ahead and include them by adding a factor of {{sfrac|1|''n''}} for each prime power ''p''<sup>''n''</sup>. A somewhat peculiar but useful way to write the result of doing this is in terms of the {{w|von Mangoldt function}}, an {{w|arithmetic function}} on positive integers which is equal to ln(''p'') on prime powers ''p''<sup>''n''</sup>, and is zero elsewhere. This is written using a capital lambda, as Λ(''n''), and in terms of it we can include prime powers in our error function as


<math>\displaystyle \xi_\infty(x) = \sum_{n \geq 1} \frac{\Lambda(n)}{\ln n} \frac{\lfloor x \log_2 n \rceil^2}{n^s}</math>
<math>\displaystyle \xi_\infty(x) = \sum_{n \geq 1} \frac{\Lambda(n)}{\ln n} \frac{\lfloor x \log_2 n \rceil^2}{n^s}</math>
Line 109: Line 113:
This new function has the property that {{nowrap|F<sub>s</sub>(''x'') {{=}} F<sub>s</sub>(0) − E<sub>s</sub>(''x'')}}, so that all we have done is flip the sign of E<sub>s</sub>(''x'') and offset it vertically. This now increases to a maximum value for low errors, rather than declining to a minimum.
This new function has the property that {{nowrap|F<sub>s</sub>(''x'') {{=}} F<sub>s</sub>(0) − E<sub>s</sub>(''x'')}}, so that all we have done is flip the sign of E<sub>s</sub>(''x'') and offset it vertically. This now increases to a maximum value for low errors, rather than declining to a minimum.


Of more interest is the fact that it is a known mathematical function. The logarithm of the {{w|Riemann zeta function}} function [[The Riemann zeta function and tuning/Appendix#1a. Dirichlet series for the von Mangoldt function|can be expressed]] in terms of a {{w|Dirichlet series}} involving the von Mangoldt function:
Of more interest is the fact that it is a known mathematical function. The logarithm of the {{w|Riemann zeta function}} function {{subpage|appendix|u|s=Dirichlet series for the von Mangoldt function|text=can be expressed}} in terms of a {{w|Dirichlet series}} involving the von Mangoldt function:


<math>\displaystyle
<math>\displaystyle
Line 136: Line 140:


so that we see that the absolute value of the zeta function serves to measure the relative error of an equal division.
so that we see that the absolute value of the zeta function serves to measure the relative error of an equal division.
There is an open question as to whether the analytic continuation preserves the properties we are interested in, though empirically it seems to. However, if you do not want to trust the analytic continuation, then the {{nowrap| ''s'' {{=}} 1 }} line is of interest for the reasons discussed, as though the infinite sum does not converge, every sum for {{nowrap| ''s'' > 1 }} ''does'' converge, so that we can consider the line at {{nowrap| ''s'' {{=}} 1 }} as being the "limit" as ''s'' approaches 1 from above. This can also be used to sanity-check results at {{nowrap| ''s'' {{=}} 1/2 }} by seeing where they agree, e.g. as done in the section on [[#Absolute zeta peak edos]], which looks at getting more practical tuning information out of the zeta function via an adjustment for considering absolute mistuning rather than relative error.


== Mike Battaglia's expanded results ==
== Mike Battaglia's expanded results ==
Line 181: Line 187:
We'll deal with each of these separately.
We'll deal with each of these separately.


First, in the leftmost summation, we can see that {{nowrap|''n'' {{=}} ''d''}} implies {{nowrap|ln({{frac|''n''|''d''}}) {{=}} 0}}. Since {{nowrap|sin(0) {{=}} 0}}, the sin term in the numerator cancels out, yielding:
First, in the leftmost summation, we can see that {{nowrap|''n'' {{=}} ''d''}} implies {{nowrap|ln{{pars|{{sfrac|''n''|''d''}}|1.8}} {{=}} 0}}. Since {{nowrap|sin(0) {{=}} 0}}, the sin term in the numerator cancels out, yielding:


<math> \displaystyle
<math> \displaystyle
Line 196: Line 202:
\frac{\cos\left(t \ln\left({\tfrac{q}{p}}\right)\right) - i\sin\left(t \ln\left({\tfrac{q}{p}}\right)\right)}{(pq)^{\sigma}}</math>
\frac{\cos\left(t \ln\left({\tfrac{q}{p}}\right)\right) - i\sin\left(t \ln\left({\tfrac{q}{p}}\right)\right)}{(pq)^{\sigma}}</math>


Now, noting that {{nowrap|ln({{frac|''p''|''q''}}) {{=}} −ln({{frac|''q''|''p''}})}} and that sin is an odd function, we can see that the sin terms cancel out, leaving
Now, noting that {{nowrap|ln{{pars|{{sfrac|''p''|''q''}}|1.8}} {{=}} −ln{{pars|{{sfrac|''q''|''p''}}|1.8}}}} and that sin is an odd function, we can see that the sin terms cancel out, leaving


<math> \displaystyle
<math> \displaystyle
Line 222: Line 228:


=== Interpretation of results: "cosine relative error" ===
=== Interpretation of results: "cosine relative error" ===
For every strictly positive rational ''n''/''d'', there is a cosine with period {{nowrap|log<sub>2</sub>({{frac|''n''|''d''}})}}. This cosine peaks at {{nowrap|''x'' {{=}} {{sfrac|''N''|log<sub>2</sub>(''n''/''d'')}}}} for all integers ''N'', or in other words, the Nth-equal division of the rational number {{frac|''n''|''d''}}, and hits troughs midway between.
For every strictly positive rational ''n''/''d'', there is a cosine with period {{nowrap|log<sub>2</sub>{{pars|{{sfrac|''n''|''d''}}|1.8}}}}. This cosine peaks at {{nowrap|''x'' {{=}} {{sfrac|''N''|log<sub>2</sub>(''n''/''d'')}}}} for all integers ''N'', or in other words, the Nth-equal division of the rational number {{frac|''n''|''d''}}, and hits troughs midway between.


Our mysterious substitution above was chosen to set the units for this up nicely. The variable x now happens to be measured in divisions of the octave. (The original variable ''t'', which was the imaginary part of the zeta argument ''s'', can be thought of as the number of divisions of the interval {{nowrap|''e''<sup>2π</sup> ≈ 535.49}}, or what [[Keenan_Pepper|Keenan Pepper]] has called the "[[zetave|natural interval]].")
Our mysterious substitution above was chosen to set the units for this up nicely. The variable x now happens to be measured in divisions of the octave. (The original variable ''t'', which was the imaginary part of the zeta argument ''s'', can be thought of as the number of divisions of the interval {{nowrap|''e''<sup>2π</sup> ≈ 535.49}}, or what [[Keenan_Pepper|Keenan Pepper]] has called the "[[zetave|natural interval]].")
Line 331: Line 337:


=== The Z function: a mathematically convenient version of zeta ===
=== The Z function: a mathematically convenient version of zeta ===
The absolute value of {{nowrap|ζ({{frac|1|2}} + ''ig'')}} at a Gram point corresponding to an edo is near to a local maximum, but not actually at one. At the local maximum, of course, the partial derivative of {{nowrap|ζ({{frac|1|2}} + ''it'')}} with respect to ''t'' will be zero; however this does not mean its derivative there will be zero. In fact, the {{w|Riemann hypothesis}} is equivalent to the claim that all zeros of {{nowrap|ζ′(''s'' + ''it'')}} occur when {{nowrap|''s'' &gt; {{sfrac|1|2}}}}, which is where all known zeros lie. These do not have values of ''t'' corresponding to good edos. For this and other reasons, it is helpful to have a function which is real for values on the critical line but whose absolute value is the same as that of zeta. This is provided by the {{w|''Z'' function}}, which is defined (in terms of the [[The Riemann zeta function and tuning/Appendix#2. Z function and Riemann-Siegel theta function|Riemann-Siegel theta function]]) as:
The absolute value of {{nowrap|ζ{{pars|{{sfrac|1|2}} + ''ig''}}|1.8}} at a Gram point corresponding to an edo is near to a local maximum, but not actually at one. At the local maximum, of course, the partial derivative of {{nowrap|ζ{{pars|{{sfrac|1|2}} + ''it''}}|1.8}} with respect to ''t'' will be zero; however this does not mean its derivative there will be zero. In fact, the {{w|Riemann hypothesis}} is equivalent to the claim that all zeros of {{nowrap|ζ′(''s'' + ''it'')}} occur when {{nowrap|''s'' &gt; {{sfrac|1|2}}}}, which is where all known zeros lie. These do not have values of ''t'' corresponding to good edos. For this and other reasons, it is helpful to have a function which is real for values on the critical line but whose absolute value is the same as that of zeta. This is provided by the {{w|''Z'' function}}, which is defined (in terms of the {{subpage|appendix|u|s=Z function and Riemann-Siegel theta function|text=Riemann-Siegel theta function}}) as:


<math>Z(t) = \exp(i \theta(t)) \zeta\left(\frac{1}{2} + it\right)</math>.
<math>Z(t) = \exp(i \theta(t)) \zeta\left(\frac{1}{2} + it\right)</math>.
Line 346: Line 352:
==== Zeta peak integer edos ====
==== Zeta peak integer edos ====
Alternatively (as [[groundfault]] has found), if we do not allow octave detuning and instead look at only the record {{nowrap|{{abs|Z(''x'')}}}} zeta scores corresponding to exact edos with pure octaves, we get {{EDOs| 1, 2, 3, 5, 7, 10, 12, 19, 22, 31, 41, 53, 87, 118, 130, 171, 224, 270, 311, 472, 494, 742, 1065, 1106, 1395, 1578, 2460, 2684, 3566, 4231, 4973, 5585, 8269, 8539, 14124, 14348, 16808, 28742, 30631, 34691, 36269, 57578, 58973,}} … of '''zeta peak integer edos'''. Edos not present in the previous list but present here include {{EDOs| 87, 311, 472, 1065, 3566, 4231, 4973, 14124, 30631,}} … and edos present in the previous list but not present here include {{EDOs| 4, 27, 72, 99, 152, 217, 342, 422, 441, 764, 935, 954, 1012, 1178, 1236, 1448, 3395, 6079, 7033, 11664,}} … with 72's removal perhaps being the most surprising, showing the strength of 53 in that 72 does not improve on 53's peak. This definition may be better for measuring how accurate edos are without detuned octaves, whereas the previous list assumes that the octave is tempered along with all other intervals. This list can thus also be thought of as "pure-octave zeta peak edos."
Alternatively (as [[groundfault]] has found), if we do not allow octave detuning and instead look at only the record {{nowrap|{{abs|Z(''x'')}}}} zeta scores corresponding to exact edos with pure octaves, we get {{EDOs| 1, 2, 3, 5, 7, 10, 12, 19, 22, 31, 41, 53, 87, 118, 130, 171, 224, 270, 311, 472, 494, 742, 1065, 1106, 1395, 1578, 2460, 2684, 3566, 4231, 4973, 5585, 8269, 8539, 14124, 14348, 16808, 28742, 30631, 34691, 36269, 57578, 58973,}} … of '''zeta peak integer edos'''. Edos not present in the previous list but present here include {{EDOs| 87, 311, 472, 1065, 3566, 4231, 4973, 14124, 30631,}} … and edos present in the previous list but not present here include {{EDOs| 4, 27, 72, 99, 152, 217, 342, 422, 441, 764, 935, 954, 1012, 1178, 1236, 1448, 3395, 6079, 7033, 11664,}} … with 72's removal perhaps being the most surprising, showing the strength of 53 in that 72 does not improve on 53's peak. This definition may be better for measuring how accurate edos are without detuned octaves, whereas the previous list assumes that the octave is tempered along with all other intervals. This list can thus also be thought of as "pure-octave zeta peak edos."
==== Absolute zeta peak edos ====
If we consider that zeta is a measure of relative error (that is, error measured relative to the step size), we realize that plenty of equal temperaments* are excluded simply because, though practically speaking they have great tuning properties, they are not as "efficient" with their number of tones as the last record peak. Arguably what we're interested in is a sequence of edos that generally do increasingly better at tuning JI in terms of lowering the average cent error. Therefore, it suffices to multiply the score by the size of the equal temperament. Surprisingly, the list for ''s'' = 1/2 — which is supposedly where high-limit information is maximized — is ''almost identical'' to the one for ''s'' = 1 — which is the smallest value of ''s'' that we can assume to be meaningful without assuming that the analytic continuation preserves the tuning properties we are interested in — so that we have reassurance from the ''s'' = 1 list that the ''s'' = 1/2 list is meaningful wherever they agree. This is important because surprisingly, the two lists of equal temperament are ''identical up to [[311edo|311et]]'', with only one edo, [[8edo]], omitted from the list for ''s'' = 1. This list is {{EDOs| 1, 2, 3, 4, 5, 7, 9, 10, 12, 14, 15, 17, 19, 22, 24, 26, 27, 31, 34, 41, 46, 53, 58, 65, 68, 72, 84, 87, 94, 99, 111, 118, 130, 140, 152, 171, 183, 198, 212, 217, 224, 243, 270, 311, ... }}.
<nowiki>*</nowiki> Note importantly that we speak of "equal temperaments" rather than "edos" because generally a record peak ''does not'' correspond to an edo, which can have tangible consequences (a significant example is discussed in the next section).
===== Extended list of absolute zeta peak edos =====
If you look at the graph of zeta (for any zeta graph of interest), another issue quickly becomes evident: many equal temperaments of interest fail to have peaks of record height by only small amounts, so that we intuitively want to include them in a more comprehensive list. However, trying to "fix" this issue quickly leads into another issue: how many "nearly record" edos should we include, and why? The smallest alteration we can make is to allow an equal temperament that does better than the second-best-scoring equal temperament so far. But sometimes we have two very strong equal temperaments appear in quick succession, and given the motivation is to find a more comprehensive list anyways, here we'll include any equal temperament that does better than the third-best-scoring equal temperament so far. The motivation for this cutoff is that you intuitively might expect that the three best equal temperaments found so far represent roughly how good we can do in a given range of step sizes, so that they define what is "normal" for that range, that is, it's the heuristic of the "rule of three". Again, the list for ''s'' = 1/2 is almost identical to ''s'' = 1 for equal temperaments up to 311et, though this time the differences are less trivial: [[176edo|176et]] and [[202edo|202et]] only appear for ''s'' = 1/2, so are put in brackets. The list is {{EDOs| 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, 38, 39*, 41, 43, 45, 46, 48, 50, 53, 56, 58, 60, 63, 65, 68, 72, 77, 80, 84, 87, 89, 94, 96, 99, 103, 106, 111, 113, 118, 121, 125, 130, 137, 140, 145, 149, 152, 159, 161, 166, 171, (176,) 183, 190, 193, 198, (202,) 212, 217, 224, 229, 239, 243, 248, 255, 270, 277, 282, 289, 301, 311, ... }}.
The equal temperaments added relative to the non-extended list of only things that are records proper are: {{EDOs| 6, 8, 11, 13, 16, 21, 29, 36, 38, 39*, 43, 45, 48, 50, 56, 60, 63, 77, 80, 89, 96, 103, 106, 113, 121, 125, 137, 145, 149, 159, 161, 166, (176,) 190, 193, (202,) 229, 239, 248, 255, 277, 282, 289, 301 }}. * 39et is a notable example because [[39edo]] corresponds to a zeta valley, so it's surprising that it would be included here; the reason that it is included is because this is ''not'' 39edo, but 39 ''equal temperament'', corresponding to a 3.8{{cent}} flat-tempered octave so that it is actually ~39.124edo, that is, it corresponds to the 173rd zeta peak, known by the shorthand 173zpi (where i stands for index). Therefore, this may prove a good testcase for investigating the effects of zeta-based octave-tempering, though given the size of the stretch, the difference is likely to be subtle, but the fact that it "changes zeta's mind" this much is itself interesting. You can also interpret this result differently, which is as evidence that you should not include equal temperaments worse than the third-best-scoring equal temperament so far, given the somewhat dubious inclusion of 39et, however it should be noted that this is more to do with that at the very beginning of the list there aren't many equal temperaments to "beat" so that beating the third-best-scoring equal temperament so far is easy, though arguably this isn't a flaw because people are often more likely to try a smaller equal temperament. It's also perhaps worth noting that 37et almost makes this extended list, but the omission of 37et is much better addressed by no-3's zeta.


==== Zeta integral edos ====
==== Zeta integral edos ====
Line 550: Line 566:
=== Anti-record edos ===
=== Anti-record edos ===
==== Zeta valley edos ====
==== Zeta valley edos ====
In addition to looking at {{nowrap|{{abs|Z(x)}}}} maxima, we can also look at {{nowrap|{{abs|Z(x)}}}} ''minima'' for integer values of ''x''. These correspond to ''zeta valley edos'', and we get a list of edos {{EDOs| 1, 8, 18, 39, 55, 64, 79, 5941, 8294,}} … These tunings tend to deviate from ''p''-limit JI as much as possible while still preserving octaves, and can serve as "more xenharmonic" tunings. Keep in mind, however, that the ''most'' xenharmonic tunings would not contain octaves at all.
In addition to looking at {{nowrap|{{abs|Z(x)}}}} maxima, we can also look at {{nowrap|{{abs|Z(x)}}}} ''minima'' for integer values of ''x''. These correspond to ''zeta valley edos'', and we get a list of edos {{EDOs| 1, 8, 18, 39, 55, 64, 79, 5941, 8294,}}… Zeta valley EDOs can be thought of as pure-octave tunings that tend to deviate from ''p''-limit JI as much as possible while still preserving octaves, and can serve as "more xenharmonic" tunings. Zeta valley EDOs are only measured with pure octaves, since "tempered-octave zeta valley edos" would simply be any zero of Z(x). Keep in mind, however, that the ''most'' xenharmonic tunings would not contain octaves at all.


Notice the sudden jump from [[79edo]] to [[5941edo]]. We know that {{nowrap|{{abs|Z(x)}}}} grows logarithmically on average. If we assume the scores of integer edos are uniformly distributed on the interval {{nowrap|[0, ''c'' log(''x'')]}}, the probability for the next edo to have a zeta score less than a given small value is also very small, so we would expect valley edos to be rarer than peak edos. So, it would be more productive to find edos which zeta score is simply less than a given threshold.
Notice that there is a very large jump from [[79edo]] to [[5941edo]]. We know that record {{nowrap|{{abs|Z(x)}}}} scores, both with tempered octaves and pure octaves, grow logarithmically on average. If we assume the scores of integer edos are uniformly distributed on the interval {{nowrap|[0, ''c'' log(''x'')]}}, the probability for the next edo to have a zeta score less than a given small value is also very small, so we would expect valley edos to be rarer than peak edos. So, it would be more productive to find edos which zeta score is simply less than a given threshold.
 
Note that "tempered-octave zeta valley edos" would simply be any zero of Z(x).


=== ''k''-ary-peak edos ===
=== ''k''-ary-peak edos ===
Line 602: Line 616:


{{EDOs| 9, 14, 21, 26, 32, 39, 45, 51, 55, 62, 67, 70, 74, 79, 85, 93, 98, }} …
{{EDOs| 9, 14, 21, 26, 32, 39, 45, 51, 55, 62, 67, 70, 74, 79, 85, 93, 98, }} …
=== Further lists ===
See [[The Riemann zeta function and tuning/Record lists|the record lists]].


== Optimal octave stretch ==
== Optimal octave stretch ==
Line 612: Line 629:


== Removing primes ==
== Removing primes ==
An [http://mathworld.wolfram.com/EulerProduct.html Euler product] formula for the Riemann zeta function [[The Riemann zeta function and tuning/Appendix#1. Euler product expression for the zeta function|can be easily derived]]:
An [http://mathworld.wolfram.com/EulerProduct.html Euler product] formula for the Riemann zeta function {{subpage|appendix|u|s=Euler product expression for the zeta function|text=can be easily derived}}:


<math>\displaystyle{
<math>\displaystyle{
Line 620: Line 637:
where the product is over all primes ''p''. The product converges for values of ''s'' with real part greater than one, while at {{nowrap|''s'' {{=}} 1}} it diverges to infinity. We may remove a finite list of primes from consideration by multiplying ζ(''s'') by the corresponding factors {{nowrap|(1 − ''p''<sup>−''s''</sup>)}} for each prime ''p'' we wish to remove. After we have done this, the smallest prime remaining will dominate peak values for ''s'' with large real part, and as before we can track these peaks backwards and, by analytical continuation, into the critical strip. In particular if we remove the prime 2, {{nowrap|(1 − 2<sup>−''s''</sup>)ζ(''s'')}} is now dominated by 3, and the large peak values occur near equal divisions of the "tritave", ie 3.
where the product is over all primes ''p''. The product converges for values of ''s'' with real part greater than one, while at {{nowrap|''s'' {{=}} 1}} it diverges to infinity. We may remove a finite list of primes from consideration by multiplying ζ(''s'') by the corresponding factors {{nowrap|(1 − ''p''<sup>−''s''</sup>)}} for each prime ''p'' we wish to remove. After we have done this, the smallest prime remaining will dominate peak values for ''s'' with large real part, and as before we can track these peaks backwards and, by analytical continuation, into the critical strip. In particular if we remove the prime 2, {{nowrap|(1 − 2<sup>−''s''</sup>)ζ(''s'')}} is now dominated by 3, and the large peak values occur near equal divisions of the "tritave", ie 3.


Along any line of constant <math>\sigma</math>, [[The Riemann zeta function and tuning/Appendix#1b. Conversion factor for removing primes|it can be shown that]]:
Along any line of constant <math>\sigma</math>, {{subpage|appendix|u|s=Conversion factor for removing primes|text=it can be shown that}}:


<math>\displaystyle{
<math>\displaystyle{
Line 634: Line 651:
Multiplying the Z-function by this factor of adjustment gives a Z-function with the prime ''p'' removed from consideration. Zeta peak and zeta integral tunings may then be found as before. Note that multiplying this factor is technically only accurate for sums whose result is related to the Z function rather than the real part of the zeta function.
Multiplying the Z-function by this factor of adjustment gives a Z-function with the prime ''p'' removed from consideration. Zeta peak and zeta integral tunings may then be found as before. Note that multiplying this factor is technically only accurate for sums whose result is related to the Z function rather than the real part of the zeta function.


For example, if we want to find zeta peak [[EDT]]s (division of the [[3/1|{{ordinal|3}}]] harmonic, or "tritave") - noting that here we must substitute <math>t = \frac{2\pi x}{\ln(3)}</math> instead of <math>\frac{2\pi x}{\ln(2)}</math> - in the no-twos subgroup, our modified Z function is:
For example, if we want to find zeta peak [[EDT]]s (division of the [[3/1|{{ordinal|3}}]] harmonic, or "tritave")—noting that here we must substitute <math>t = \frac{2\pi x}{\ln(3)}</math> instead of <math>\frac{2\pi x}{\ln(2)}</math>—in the no-twos subgroup, our modified Z function is:


<math>
<math>
Line 646: Line 663:


== Further information ==
== Further information ==
* [[The Riemann zeta function and tuning/Appendix#3. Black magic formulas|How it can be shown what ETs have a sharp vs. flat tendency]]
* {{subpage|appendix|u|s=Black magic formulas|text=How it can be shown what ETs have a sharp vs. flat tendency}}
* [[The Riemann zeta function and tuning/Appendix#4. Computing zeta|How do you actually compute zeta?]]
* {{subpage|appendix|u|s=Computing zeta|text=How do you actually compute zeta?}}


== Links ==
== Links ==