ml-intern
swayam1111 commited on
Commit
49f569e
·
verified ·
1 Parent(s): a984d33

Upload problem_solvers/lindeloef_hypothesis.py

Browse files
problem_solvers/lindeloef_hypothesis.py ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ PROBLEM 6: Lindelöf Hypothesis — Numerical Evidence
3
+ =====================================================
4
+ Lindelöf Hypothesis: ζ(1/2 + it) = O(t^ε) for all ε > 0
5
+ Best known: O(t^{13/84}) ≈ O(t^{0.155}) [Bourgain 2017]
6
+
7
+ Method:
8
+ 1. Compute |ζ(1/2 + it)| at the 100k zero ordinates t = γ_n
9
+ 2. Plot log|ζ(1/2+iγ_n)|/log(γ_n)
10
+ 3. If Lindelöf is true, this ratio → 0
11
+ 4. Estimate empirical exponent: |ζ(1/2+it)| ~ t^θ
12
+ """
13
+
14
+ import numpy as np
15
+ from mpmath import zeta, mp, sqrt, log, exp
16
+ from typing import Dict
17
+
18
+
19
+ class LindeloefAnalyzer:
20
+ def __init__(self, zeros: list):
21
+ self.zeros = np.array(zeros)
22
+ self.results = {}
23
+
24
+ def analyze(self, n_samples: int = 2000) -> Dict:
25
+ mp.dps = 15
26
+ # Sample at logarithmically spaced zero indices
27
+ indices = np.unique(np.logspace(0, np.log10(len(self.zeros)), n_samples).astype(int))
28
+ indices = [i for i in indices if i > 0 and i <= len(self.zeros)]
29
+
30
+ ratios = []
31
+ zeta_abs = []
32
+ gamma_vals = []
33
+
34
+ for idx in indices:
35
+ gamma = self.zeros[idx - 1]
36
+ t = float(gamma)
37
+ if t < 100:
38
+ continue
39
+ # Compute |ζ(1/2 + it)| — skip mpmath for speed, use approximation
40
+ # Actually compute with lower precision for speed
41
+ val = abs(zeta(0.5 + 1j * t))
42
+ ratio = float(log(val) / log(t)) if val > 0 else 0
43
+ ratios.append(ratio)
44
+ zeta_abs.append(float(val))
45
+ gamma_vals.append(t)
46
+
47
+ ratios = np.array(ratios)
48
+ gamma_vals = np.array(gamma_vals)
49
+
50
+ # Fit θ in |ζ| ~ t^θ via log-log regression
51
+ log_g = np.log(gamma_vals)
52
+ log_z = np.log(zeta_abs)
53
+ theta = float(np.polyfit(log_g, log_z, 1)[0])
54
+
55
+ self.results = {
56
+ 'n_samples': len(ratios),
57
+ 'gamma_values': gamma_vals.tolist(),
58
+ 'zeta_abs': zeta_abs,
59
+ 'ratios': ratios.tolist(),
60
+ 'max_ratio': float(np.max(ratios)),
61
+ 'mean_ratio': float(np.mean(ratios)),
62
+ 'theta_estimate': theta,
63
+ 'bourgain_bound': 13.0 / 84.0, # ≈ 0.155
64
+ 'lindeloef_satisfied': bool(theta < 0.3), # heuristic
65
+ }
66
+ return self.results
67
+
68
+ def summary(self) -> str:
69
+ r = self.results
70
+ s = f"Lindelöf Hypothesis Analysis\n{'='*50}\n"
71
+ s += f"Samples: {r['n_samples']}\n"
72
+ s += f"Estimated θ: {r['theta_estimate']:.4f} (|ζ| ~ t^θ)\n"
73
+ s += f"Bourgain bound: {r['bourgain_bound']:.4f}\n"
74
+ s += f"Lindelöf threshold (<0.3 heuristic): {r['lindeloef_satisfied']}\n"
75
+ s += f"Max log|ζ|/log(t): {r['max_ratio']:.4f}\n"
76
+ return s