wavefunction 0.0.1__py3-none-any.whl → 0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
wavefunction/__init__.py CHANGED
@@ -1,6 +1,8 @@
1
1
  from .wavefunction import Wavefunction
2
+ from .wavefunction import SpectralMode
2
3
 
3
4
 
4
5
  __all__ = [
5
- "Wavefunction"
6
+ "Wavefunction",
7
+ "SpectralMode",
6
8
  ]
@@ -614,62 +614,3 @@ class Wavefunction:
614
614
  f"ℏ_id={self.hbar_identified:.3e})"
615
615
  )
616
616
 
617
-
618
- # ---------------------------------------------------------------------------
619
- # Demo
620
- # ---------------------------------------------------------------------------
621
-
622
- if __name__ == "__main__":
623
- print(__doc__)
624
- print("=" * 65)
625
- print("Demo")
626
- print("=" * 65)
627
-
628
- # 1. Gaussian packet — few dominant modes, low C_s
629
- gp = Wavefunction.gaussian_packet(N=256, x0=12.8, sigma=2.0, k0=2.0, dx=0.1)
630
- print("\n[1] Gaussian wave packet")
631
- gp.spectral_complexity(verbose=True)
632
- print(gp)
633
-
634
- # 2. Two-component superposition — moderate C_s
635
- sp = Wavefunction.plane_wave_superposition(
636
- N=256, amplitudes=[0.6, 0.8],
637
- wavenumbers=[1.0, 5.0], phases=[0.0, np.pi / 4], dx=0.1)
638
- print("\n[2] Two-component superposition")
639
- sp.spectral_complexity(verbose=True)
640
- print(sp)
641
-
642
- # 3. Random state — all modes active, high C_s
643
- rnd = Wavefunction.random_state(N=256, seed=0, dx=0.1)
644
- print("\n[3] Random (high-entropy) state")
645
- print(f" C_s = {rnd.spectral_complexity():.2f} (verbose suppressed)")
646
- print(rnd)
647
-
648
- # 4. Solomonoff weights — exponential ordering
649
- print("\nSolomonoff weights 2^{{-C_s}}:")
650
- for label, wf in [("Gaussian", gp), ("Superposition", sp), ("Random", rnd)]:
651
- print(f" {label:>16s}: {wf.solomonoff_weight():.4e}")
652
-
653
- # 5. Interference economy
654
- gp2 = Wavefunction.gaussian_packet(N=256, x0=20.0, sigma=2.0, k0=2.0, dx=0.1)
655
- combined = gp + gp2
656
- print(f"\n[5] Interference economy:")
657
- print(f" C_s(ψ₁) = {gp.spectral_complexity():.2f}")
658
- print(f" C_s(ψ₂) = {gp2.spectral_complexity():.2f}")
659
- print(f" C_s(ψ₁ + ψ₂) = {combined.spectral_complexity():.2f}")
660
- print(" Superposition is cheaper than two independent descriptions.")
661
-
662
- # 6. Fidelity engine: weak modes don't inflate C_s
663
- x = np.arange(64)
664
- psi_clean = sum(np.exp(1j * 2*np.pi*k*x/64) for k in [2, 7, 13])
665
- rng = np.random.default_rng(0)
666
- psi_noisy = psi_clean + 0.01 * sum(
667
- np.exp(1j * (2*np.pi*k*x/64 + rng.uniform(0, 2*np.pi)))
668
- for k in range(20, 50))
669
- wf_clean = Wavefunction(psi_clean, dx=0.1)
670
- wf_noisy = Wavefunction(psi_noisy, dx=0.1)
671
- print(f"\n[6] Fidelity engine — weak modes ignored:")
672
- print(f" C_s(clean, 3 modes) = {wf_clean.spectral_complexity():.3f}")
673
- print(f" C_s(+ 30 weak noise modes) = {wf_noisy.spectral_complexity():.3f}")
674
- print(f" Modes retained (clean/noisy) = "
675
- f"{len(wf_clean.retained_modes())} / {len(wf_noisy.retained_modes())}")
@@ -0,0 +1,105 @@
1
+ Metadata-Version: 2.4
2
+ Name: wavefunction
3
+ Version: 0.0.2
4
+ Summary: Quantum Wavefunction with Spectral Complexity measure
5
+ Author-email: Juha Meskanen <juha@meskanen.com>
6
+ Maintainer-email: Juha Meskanen <juha@meskanen.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/juhakm/wavefunction
9
+ Project-URL: Bug Reports, https://github.com/juhakm/wavefunction
10
+ Project-URL: Say Thanks!, https://github.com/juhakm/wavefunction
11
+ Project-URL: Source, https://github.com/juhakm/wavefunction
12
+ Keywords: quantum,quantum-field-theory,information-theory,wavefunction,spinor,emergent-physics,minimal-spectral-length,computational-physics
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Intended Audience :: Education
16
+ Classifier: Topic :: Scientific/Engineering
17
+ Classifier: Topic :: Scientific/Engineering :: Physics
18
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
19
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
20
+ Classifier: Programming Language :: Python
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.9
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Typing :: Typed
26
+ Classifier: Operating System :: OS Independent
27
+ Requires-Python: >=3.9
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: numpy<1.27,>=1.25
31
+ Requires-Dist: scipy>=1.10
32
+ Requires-Dist: numba>=0.59
33
+ Requires-Dist: matplotlib
34
+ Dynamic: license-file
35
+
36
+ # Wavefunction
37
+
38
+ Quantum Mechanical complex valued wavefunction with Spectral Complexity measure.
39
+
40
+ ## Install
41
+
42
+ ```bash
43
+ pip install wavefunction
44
+ ```
45
+
46
+ ## Introduction
47
+
48
+ Spectral Complexity measure for complex-valued wavefunctions.
49
+
50
+ ## Theory background (Meskanen 2026 — "The Wavefunction as Compression")
51
+
52
+ The central hypothesis is that the quantum wavefunction is the universe's data-compression codec. Internal observers — themselves composed of compressed structures — perceive their constituent degrees of freedom as wave-like because they are observing *compressed information*. The codec that produces this compression is the Fourier / spectral decomposition.
53
+
54
+ ### Spectral Complexity $ C_s $
55
+
56
+ A wavefunction $ \psi(x) $ can always be written as a superposition of spectral modes, each characterised by two attributes:
57
+
58
+ - **frequency** $ \omega $ — the rate of oscillation, unbounded above zero
59
+ - **phase** $ \phi $ — the offset of the oscillation, bounded in $[0, 2\pi)$
60
+
61
+ The *spectral complexity* $ C_s(\psi) $ is the total continuous information cost needed to specify the set of modes that materially compose $ \psi $:
62
+
63
+ $$
64
+ C_s(\psi) = \sum_i \left[ \frac{\omega_i}{\Delta \omega} + \phi_{\text{cost}}(\phi_i) \right]
65
+ $$
66
+
67
+ #### Frequency cost (dominant term)
68
+
69
+ $ \frac{\omega_i}{\Delta \omega} $ is the number of resolution steps $ \Delta \omega $ needed to locate frequency $ \omega_i $. It is unbounded, continuous, and grows linearly with frequency. This term *dominates* $ C_s $ and is the reason the measure exponentially suppresses high-frequency (rough, chaotic) states.
70
+
71
+ The identification $ \Delta \omega = \hbar \ln 2 $ connects the minimum frequency resolution to Planck's constant (Meskanen 2026, §3.1).
72
+
73
+ #### Phase cost (subdominant, bounded)
74
+
75
+ Each phase $ \phi_i \in [0, 2\pi) $ requires a finite amount of information to specify. The cost is *global* over all modes: it measures how much information is needed to distinguish the phases from one another.
76
+
77
+ With only two modes at phases 0 and $ \pi $, very little is needed; with many modes at crowded, uneven phases, somewhat more is required. In practice this term is bounded by $ \log_2(N_{\text{modes}}) $ and is a second-order correction.
78
+
79
+ The current implementation uses a simple uniform fixed cost per non-reference mode as a tractable proxy; the reference mode (highest amplitude) is exempt because only *relative* phases are observable — a global phase shift leaves $ |\psi(x)|^2 $ unchanged.
80
+
81
+ #### Amplitude and the fidelity engine
82
+
83
+ Amplitude does not appear as a separate encoding cost. Instead it determines *which modes are included* in the description via a power-ranked fidelity engine: modes are added in descending power order until the accumulated power reaches a target fraction of the total. Modes below this threshold are simply absent from the description — they are not part of the codec output and contribute zero complexity cost.
84
+
85
+ This correctly handles the case where many weak modes coexist with a few dominant ones: the dominant modes determine $ C_s $; the weak modes are free.
86
+
87
+ #### Solomonoff suppression and the probability profile
88
+
89
+ Under Solomonoff-like induction the prior probability of a configuration is $ P(\psi) \propto 2^{-C_s(\psi)} $. Because $ C_s $ is a *sum* over independent modes, the probability *factorises*:
90
+
91
+ $$
92
+ P(\psi) \propto \prod_i 2^{-\omega_i / \Delta \omega}
93
+ $$
94
+
95
+ Each mode is suppressed independently and exponentially by its frequency. The resulting probability profile is Boltzmann-like with inverse temperature $ \beta = \ln(2)/\Delta \omega $:
96
+
97
+ $$
98
+ P(\text{mode } i \text{ present}) \propto \exp(-\ln(2) \cdot \omega_i / \Delta \omega)
99
+ $$
100
+
101
+ Smooth, low-frequency, compressible states dominate the measure. Boltzmann brains, random fluctuations, and chaotic configurations are exponentially suppressed — not by fine-tuning, but because they require many high-frequency modes to describe.
102
+
103
+ ### The conjecture $ C_s \propto S_{\text{Euclidean}} $
104
+
105
+ The central open conjecture (Meskanen 2026, §4) is that the minimum spectral complexity path through configuration space coincides with the minimum Euclidean action path of standard quantum gravity. If true, quantum gravity is Solomonoff induction over compressed descriptions of geometry, and $ \hbar $ is the minimum spectral resolution of a finite informational universe.
@@ -0,0 +1,8 @@
1
+ wavefunction/__init__.py,sha256=4ISrMO8n1UYw5DKdVXWNQNKz5qNKn97HbsFmjtvPHQk,134
2
+ wavefunction/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ wavefunction/wavefunction.py,sha256=TFzeomqEUQfoaH9zC7MwBJOAxEhiEQQJ4uYtMVDCoPQ,24682
4
+ wavefunction-0.0.2.dist-info/licenses/LICENSE,sha256=QkF5gU3HNy3Ek--9PhaJbddYiWn8S2PVAlFexu32_4w,1079
5
+ wavefunction-0.0.2.dist-info/METADATA,sha256=40Lxa9UIJZpMcNmfmVqkgL_c-jiDrgGHI8-qbwGqQ_E,5900
6
+ wavefunction-0.0.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
7
+ wavefunction-0.0.2.dist-info/top_level.txt,sha256=W36sqLDN8lGSNPBypdxnYZ0tydKfv0h7Uc7RGE8Mj3M,13
8
+ wavefunction-0.0.2.dist-info/RECORD,,
@@ -1,47 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: wavefunction
3
- Version: 0.0.1
4
- Summary: Quantum Wavefunction with Spectral Complexity measure
5
- Author-email: Juha Meskanen <juha@meskanen.com>
6
- Maintainer-email: Juha Meskanen <juha@meskanen.com>
7
- License-Expression: MIT
8
- Project-URL: Homepage, https://github.com/juhakm/wavefunction
9
- Project-URL: Bug Reports, https://github.com/juhakm/wavefunction
10
- Project-URL: Say Thanks!, https://github.com/juhakm/wavefunction
11
- Project-URL: Source, https://github.com/juhakm/wavefunction
12
- Keywords: quantum,quantum-field-theory,information-theory,wavefunction,spinor,emergent-physics,minimal-spectral-length,computational-physics
13
- Classifier: Development Status :: 4 - Beta
14
- Classifier: Intended Audience :: Science/Research
15
- Classifier: Intended Audience :: Education
16
- Classifier: Topic :: Scientific/Engineering
17
- Classifier: Topic :: Scientific/Engineering :: Physics
18
- Classifier: Topic :: Scientific/Engineering :: Mathematics
19
- Classifier: Topic :: Scientific/Engineering :: Information Analysis
20
- Classifier: Programming Language :: Python
21
- Classifier: Programming Language :: Python :: 3
22
- Classifier: Programming Language :: Python :: 3.9
23
- Classifier: Programming Language :: Python :: 3.10
24
- Classifier: Programming Language :: Python :: 3.11
25
- Classifier: Typing :: Typed
26
- Classifier: Operating System :: OS Independent
27
- Requires-Python: >=3.9
28
- Description-Content-Type: text/markdown
29
- License-File: LICENSE
30
- Requires-Dist: numpy<1.27,>=1.25
31
- Requires-Dist: scipy>=1.10
32
- Requires-Dist: numba>=0.59
33
- Requires-Dist: matplotlib
34
- Dynamic: license-file
35
-
36
- # Wavefunction
37
-
38
- Quantum Mechanical complex valued wavefunction with Spectral Complexity measure.
39
-
40
- ## Install
41
-
42
- ```
43
- pip install wavefunction
44
- ```
45
-
46
- [https://pypi.org/project/wavefunction/](https://pypi.org/project/wavefunction/)
47
-
@@ -1,8 +0,0 @@
1
- wavefunction/__init__.py,sha256=crpFhdKJnmLbqzzFmwvXUwP3A_FJ2LBfCpBD5Rkddb4,74
2
- wavefunction/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- wavefunction/wavefunction.py,sha256=U4reN_Oe_uRDuman8amlT7WWAOgvlsfRHmA-58DqKnE,27221
4
- wavefunction-0.0.1.dist-info/licenses/LICENSE,sha256=QkF5gU3HNy3Ek--9PhaJbddYiWn8S2PVAlFexu32_4w,1079
5
- wavefunction-0.0.1.dist-info/METADATA,sha256=Sjm3grkXaduxxtH84jnNrYdcJkC3wmupbDptikFqryA,1763
6
- wavefunction-0.0.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
7
- wavefunction-0.0.1.dist-info/top_level.txt,sha256=W36sqLDN8lGSNPBypdxnYZ0tydKfv0h7Uc7RGE8Mj3M,13
8
- wavefunction-0.0.1.dist-info/RECORD,,