sigma-c-framework 1.0.0__tar.gz
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.
- sigma_c_framework-1.0.0/DOCUMENTATION.md +155 -0
- sigma_c_framework-1.0.0/LICENSE.txt +29 -0
- sigma_c_framework-1.0.0/MANIFEST.in +23 -0
- sigma_c_framework-1.0.0/PKG-INFO +138 -0
- sigma_c_framework-1.0.0/QUICKSTART.md +162 -0
- sigma_c_framework-1.0.0/README.md +89 -0
- sigma_c_framework-1.0.0/examples_v4/debug_quantum.py +11 -0
- sigma_c_framework-1.0.0/examples_v4/demo_climate.py +81 -0
- sigma_c_framework-1.0.0/examples_v4/demo_finance.py +86 -0
- sigma_c_framework-1.0.0/examples_v4/demo_gpu.py +85 -0
- sigma_c_framework-1.0.0/examples_v4/demo_magnetic.py +73 -0
- sigma_c_framework-1.0.0/examples_v4/demo_quantum.py +91 -0
- sigma_c_framework-1.0.0/examples_v4/demo_seismic.py +80 -0
- sigma_c_framework-1.0.0/license_AGPL.txt +22 -0
- sigma_c_framework-1.0.0/license_COMMERCIAL.txt +21 -0
- sigma_c_framework-1.0.0/pyproject.toml +56 -0
- sigma_c_framework-1.0.0/setup.cfg +4 -0
- sigma_c_framework-1.0.0/setup.py +50 -0
- sigma_c_framework-1.0.0/sigma_c/__init__.py +5 -0
- sigma_c_framework-1.0.0/sigma_c/adapters/__init__.py +6 -0
- sigma_c_framework-1.0.0/sigma_c/adapters/climate.py +99 -0
- sigma_c_framework-1.0.0/sigma_c/adapters/factory.py +53 -0
- sigma_c_framework-1.0.0/sigma_c/adapters/financial.py +105 -0
- sigma_c_framework-1.0.0/sigma_c/adapters/gpu.py +136 -0
- sigma_c_framework-1.0.0/sigma_c/adapters/magnetic.py +82 -0
- sigma_c_framework-1.0.0/sigma_c/adapters/quantum.py +258 -0
- sigma_c_framework-1.0.0/sigma_c/adapters/seismic.py +150 -0
- sigma_c_framework-1.0.0/sigma_c/core/__init__.py +3 -0
- sigma_c_framework-1.0.0/sigma_c/core/base.py +54 -0
- sigma_c_framework-1.0.0/sigma_c/core/engine.py +82 -0
- sigma_c_framework-1.0.0/sigma_c/core/orchestrator.py +108 -0
- sigma_c_framework-1.0.0/sigma_c/stats/__init__.py +3 -0
- sigma_c_framework-1.0.0/sigma_c/stats/tests.py +129 -0
- sigma_c_framework-1.0.0/sigma_c_core/include/sigma_c/stats.hpp +18 -0
- sigma_c_framework-1.0.0/sigma_c_core/include/sigma_c/susceptibility.hpp +35 -0
- sigma_c_framework-1.0.0/sigma_c_core/src/bindings.cpp +35 -0
- sigma_c_framework-1.0.0/sigma_c_core/src/stats.cpp +41 -0
- sigma_c_framework-1.0.0/sigma_c_core/src/susceptibility.cpp +87 -0
- sigma_c_framework-1.0.0/sigma_c_framework.egg-info/PKG-INFO +138 -0
- sigma_c_framework-1.0.0/sigma_c_framework.egg-info/SOURCES.txt +45 -0
- sigma_c_framework-1.0.0/sigma_c_framework.egg-info/dependency_links.txt +1 -0
- sigma_c_framework-1.0.0/sigma_c_framework.egg-info/not-zip-safe +1 -0
- sigma_c_framework-1.0.0/sigma_c_framework.egg-info/requires.txt +19 -0
- sigma_c_framework-1.0.0/sigma_c_framework.egg-info/top_level.txt +2 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Sigma-C Framework Documentation / Dokumentation
|
|
2
|
+
|
|
3
|
+
**Version:** 1.0.0
|
|
4
|
+
**Date:** November 2025
|
|
5
|
+
**Copyright:** (c) 2025 ForgottenForge.xyz
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## š¬š§ English
|
|
10
|
+
|
|
11
|
+
### 1. Introduction
|
|
12
|
+
**Sigma-C Framework** is a high-performance framework for detecting **critical phase transitions** in complex systems. Unlike traditional metrics (like standard deviation or simple thresholds), Sigma-C uses **Critical Susceptibility ($\chi$)** theory to identify the precise scale or parameter value where a system undergoes a fundamental structural change.
|
|
13
|
+
|
|
14
|
+
**Why is it superior?**
|
|
15
|
+
* **Sensitivity:** Detects precursors to instability (crashes, failures) *before* they happen.
|
|
16
|
+
* **Universality:** The same math works for Quantum Noise, GPU Thrashing, Financial Crashes, and Seismic Activity.
|
|
17
|
+
* **Robustness:** Uses bootstrap and permutation testing to filter out false positives.
|
|
18
|
+
|
|
19
|
+
### 2. Installation
|
|
20
|
+
|
|
21
|
+
**Prerequisites:** Python 3.8+, C++17 compiler (MSVC, GCC, or Clang).
|
|
22
|
+
|
|
23
|
+
#### Windows
|
|
24
|
+
```powershell
|
|
25
|
+
# 1. Clone the repository
|
|
26
|
+
git clone https://github.com/forgottenforge/sigmacore.git
|
|
27
|
+
cd sigmacore/sigma_c_framework
|
|
28
|
+
|
|
29
|
+
# 2. Install dependencies and build C++ core
|
|
30
|
+
pip install .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### Linux / macOS
|
|
34
|
+
```bash
|
|
35
|
+
# 1. Clone the repository
|
|
36
|
+
git clone https://github.com/forgottenforge/sigmacore.git
|
|
37
|
+
cd sigmacore/sigma_c_framework
|
|
38
|
+
|
|
39
|
+
# 2. Install dependencies and build C++ core
|
|
40
|
+
pip install .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 3. Integration
|
|
44
|
+
|
|
45
|
+
#### Python (Recommended)
|
|
46
|
+
The `Universe` class is your single entry point.
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from sigma_c import Universe
|
|
50
|
+
|
|
51
|
+
# Initialize an adapter
|
|
52
|
+
gpu = Universe.gpu()
|
|
53
|
+
|
|
54
|
+
# Run analysis
|
|
55
|
+
result = gpu.auto_tune(alpha_levels=[0.1, 0.5, 0.9])
|
|
56
|
+
print(f"Critical Point: {result['sigma_c']}")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### C++ (High Performance)
|
|
60
|
+
Link against `sigma_c_core.lib` / `libsigma_c_core.so`.
|
|
61
|
+
|
|
62
|
+
```cpp
|
|
63
|
+
#include <sigma_c/susceptibility.hpp>
|
|
64
|
+
|
|
65
|
+
std::vector<double> x = { ... };
|
|
66
|
+
std::vector<double> y = { ... };
|
|
67
|
+
auto result = sigma_c::compute_susceptibility(x, y);
|
|
68
|
+
std::cout << "Sigma-C: " << result.sigma_c << std::endl;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 4. Domain Examples
|
|
72
|
+
|
|
73
|
+
See the `examples_v4/` directory for runnable scripts.
|
|
74
|
+
|
|
75
|
+
* **Quantum:** `demo_quantum.py` - Detects when noise breaks Grover's algorithm.
|
|
76
|
+
* **Finance:** `demo_finance.py` - Identifies market regimes and crash risks.
|
|
77
|
+
* **GPU:** `demo_gpu.py` - Auto-tunes kernels to avoid cache thrashing.
|
|
78
|
+
* **Climate:** `demo_climate.py` - Finds characteristic scales of weather systems.
|
|
79
|
+
* **Seismic:** `demo_seismic.py` - Detects critical stress correlation lengths.
|
|
80
|
+
* **Magnetic:** `demo_magnetic.py` - Finds Curie temperature in 2D Ising model.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## š©šŖ Deutsch
|
|
85
|
+
|
|
86
|
+
### 1. Einführung
|
|
87
|
+
**Sigma-C Framework** ist ein Hochleistungs-Framework zur Erkennung von **kritischen Phasenübergängen** in komplexen Systemen. Im Gegensatz zu herkömmlichen Metriken (wie Standardabweichung) nutzt Sigma-C die Theorie der **Kritischen Suszeptibilität ($\chi$)**, um den genauen Punkt zu identifizieren, an dem sich die Struktur eines Systems grundlegend ändert.
|
|
88
|
+
|
|
89
|
+
**Warum ist es überlegen?**
|
|
90
|
+
* **Sensitivität:** Erkennt Vorboten von Instabilität (Abstürze, Ausfälle), *bevor* sie eintreten.
|
|
91
|
+
* **Universalität:** Die gleiche Mathematik funktioniert für Quantenrauschen, GPU-Thrashing, Finanzcrashs und Erdbeben.
|
|
92
|
+
* **Robustheit:** Nutzt Bootstrap- und Permutationstests, um Fehlalarme auszuschlieĆen.
|
|
93
|
+
|
|
94
|
+
### 2. Installation
|
|
95
|
+
|
|
96
|
+
**Voraussetzungen:** Python 3.8+, C++17 Compiler.
|
|
97
|
+
|
|
98
|
+
#### Windows
|
|
99
|
+
```powershell
|
|
100
|
+
# 1. Repository klonen
|
|
101
|
+
git clone https://github.com/forgottenforge/sigmacore.git
|
|
102
|
+
cd sigmacore/sigma_c_framework
|
|
103
|
+
|
|
104
|
+
# 2. Installieren
|
|
105
|
+
pip install .
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
#### Linux / macOS
|
|
109
|
+
```bash
|
|
110
|
+
# 1. Repository klonen
|
|
111
|
+
git clone https://github.com/forgottenforge/sigmacore.git
|
|
112
|
+
cd sigmacore/sigma_c_framework
|
|
113
|
+
|
|
114
|
+
# 2. Installieren
|
|
115
|
+
pip install .
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 3. Integration
|
|
119
|
+
|
|
120
|
+
#### Python (Empfohlen)
|
|
121
|
+
Die `Universe`-Klasse ist der zentrale Einstiegspunkt.
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
from sigma_c import Universe
|
|
125
|
+
|
|
126
|
+
# Adapter initialisieren
|
|
127
|
+
gpu = Universe.gpu()
|
|
128
|
+
|
|
129
|
+
# Analyse starten
|
|
130
|
+
result = gpu.auto_tune(alpha_levels=[0.1, 0.5, 0.9])
|
|
131
|
+
print(f"Kritischer Punkt: {result['sigma_c']}")
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### C++ (Hochleistung)
|
|
135
|
+
Gegen `sigma_c_core.lib` / `libsigma_c_core.so` linken.
|
|
136
|
+
|
|
137
|
+
```cpp
|
|
138
|
+
#include <sigma_c/susceptibility.hpp>
|
|
139
|
+
|
|
140
|
+
std::vector<double> x = { ... };
|
|
141
|
+
std::vector<double> y = { ... };
|
|
142
|
+
auto result = sigma_c::compute_susceptibility(x, y);
|
|
143
|
+
std::cout << "Sigma-C: " << result.sigma_c << std::endl;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 4. Anwendungsbeispiele
|
|
147
|
+
|
|
148
|
+
Siehe `examples_v4/` für ausführbare Skripte.
|
|
149
|
+
|
|
150
|
+
* **Quantum:** `demo_quantum.py` - Erkennt, wann Rauschen den Grover-Algorithmus bricht.
|
|
151
|
+
* **Finance:** `demo_finance.py` - Identifiziert Marktregimes und Crash-Risiken.
|
|
152
|
+
* **GPU:** `demo_gpu.py` - Optimiert Kernel, um Cache-Thrashing zu vermeiden.
|
|
153
|
+
* **Climate:** `demo_climate.py` - Findet charakteristische Skalen von Wettersystemen.
|
|
154
|
+
* **Seismic:** `demo_seismic.py` - Erkennt kritische Spannungskorrelationen.
|
|
155
|
+
* **Magnetic:** `demo_magnetic.py` - Findet Curie-Temperatur im 2D-Ising-Modell.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# License Notice
|
|
2
|
+
|
|
3
|
+
This software is licensed under a **dual-license model**:
|
|
4
|
+
|
|
5
|
+
1. **For Open Source and Non-Commercial Use**
|
|
6
|
+
- Licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)**.
|
|
7
|
+
- You may use, modify, and distribute this software **provided that any derivative works are also licensed under the AGPL-3.0**.
|
|
8
|
+
- See `LICENSE-AGPL.txt` for full license terms.
|
|
9
|
+
|
|
10
|
+
2. **For Commercial Use**
|
|
11
|
+
- Companies, organizations, and other commercial entities **must obtain a commercial license**.
|
|
12
|
+
- The commercial license allows proprietary use without the copyleft requirements of the AGPL.
|
|
13
|
+
- See `LICENSE-COMMERCIAL.txt` for details and contact information.
|
|
14
|
+
|
|
15
|
+
By using this software, you agree to these terms.
|
|
16
|
+
For commercial licensing inquiries, please visit: **[www.theqa.space]**
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Summary of Key Terms
|
|
21
|
+
|
|
22
|
+
| License Type | Permitted Uses | Restrictions |
|
|
23
|
+
|---------------|----------------|---------------|
|
|
24
|
+
| **AGPL-3.0** (for open-source / non-commercial use) | Free use, modification, redistribution under AGPL | Must disclose source code of modified versions and networked services |
|
|
25
|
+
| **Commercial License** (for companies) | Proprietary use, closed-source integration, internal business use | Requires commercial agreement, no resale without consent |
|
|
26
|
+
|
|
27
|
+
For full details, see:
|
|
28
|
+
- `LICENSE-AGPL.txt`
|
|
29
|
+
- `LICENSE-COMMERCIAL.txt`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE.txt
|
|
3
|
+
include license_AGPL.txt
|
|
4
|
+
include license_COMMERCIAL.txt
|
|
5
|
+
include DOCUMENTATION.md
|
|
6
|
+
include QUICKSTART.md
|
|
7
|
+
include pyproject.toml
|
|
8
|
+
|
|
9
|
+
# Include C++ source and headers
|
|
10
|
+
recursive-include sigma_c_core/src *.cpp *.hpp
|
|
11
|
+
recursive-include sigma_c_core/include *.hpp
|
|
12
|
+
|
|
13
|
+
# Include Python package
|
|
14
|
+
recursive-include sigma_c *.py
|
|
15
|
+
|
|
16
|
+
# Include examples (only v4)
|
|
17
|
+
recursive-include examples_v4 *.py
|
|
18
|
+
|
|
19
|
+
# Exclude unwanted files
|
|
20
|
+
global-exclude __pycache__
|
|
21
|
+
global-exclude *.py[cod]
|
|
22
|
+
global-exclude *.so
|
|
23
|
+
global-exclude .DS_Store
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sigma-c-framework
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Critical Susceptibility Framework for Quantum, GPU, Financial, Climate, Seismic, and Magnetic analysis
|
|
5
|
+
Author-email: ForgottenForge <nfo@forgottenforge.xyz>
|
|
6
|
+
License: AGPL-3.0-or-later OR Commercial
|
|
7
|
+
Project-URL: Homepage, https://github.com/forgottenforge/sigmacore
|
|
8
|
+
Project-URL: Documentation, https://github.com/forgottenforge/sigmacore/blob/main/DOCUMENTATION.md
|
|
9
|
+
Project-URL: Repository, https://github.com/forgottenforge/sigmacore
|
|
10
|
+
Project-URL: Issues, https://github.com/forgottenforge/sigmacore/issues
|
|
11
|
+
Keywords: critical-phenomena,phase-transitions,quantum-computing,gpu-optimization,financial-analysis,climate-science,seismology,susceptibility
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
|
16
|
+
Classifier: License :: Other/Proprietary License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: C++
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
|
+
Requires-Python: >=3.8
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE.txt
|
|
30
|
+
License-File: license_AGPL.txt
|
|
31
|
+
License-File: license_COMMERCIAL.txt
|
|
32
|
+
Requires-Dist: numpy>=1.20.0
|
|
33
|
+
Requires-Dist: scipy>=1.7.0
|
|
34
|
+
Requires-Dist: pandas>=1.3.0
|
|
35
|
+
Requires-Dist: tqdm>=4.60.0
|
|
36
|
+
Requires-Dist: matplotlib>=3.4.0
|
|
37
|
+
Requires-Dist: seaborn>=0.11.0
|
|
38
|
+
Requires-Dist: requests>=2.25.0
|
|
39
|
+
Requires-Dist: yfinance>=0.1.63
|
|
40
|
+
Provides-Extra: quantum
|
|
41
|
+
Requires-Dist: amazon-braket-sdk>=1.9.0; extra == "quantum"
|
|
42
|
+
Provides-Extra: gpu
|
|
43
|
+
Requires-Dist: cupy>=9.0.0; extra == "gpu"
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
46
|
+
Requires-Dist: black>=21.0; extra == "dev"
|
|
47
|
+
Requires-Dist: mypy>=0.900; extra == "dev"
|
|
48
|
+
Dynamic: license-file
|
|
49
|
+
|
|
50
|
+
[](https://badge.fury.io/py/sigma-c-framework)
|
|
51
|
+
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
52
|
+
[](https://www.python.org/downloads/)
|
|
53
|
+
|
|
54
|
+
# Sigma-C Framework v1.0.0
|
|
55
|
+
|
|
56
|
+
**Copyright (c) 2025 ForgottenForge.xyz**
|
|
57
|
+
|
|
58
|
+
**Critical Susceptibility Framework** for Quantum, GPU, Financial, Climate, Seismic, and Magnetic analysis.
|
|
59
|
+
|
|
60
|
+
## š Quick Start
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Install the package
|
|
64
|
+
pip install sigma-c-framework
|
|
65
|
+
|
|
66
|
+
# Run examples
|
|
67
|
+
python -m sigma_c.examples.demo_quantum
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Or clone and install from source:
|
|
71
|
+
```bash
|
|
72
|
+
git clone https://github.com/forgottenforge/sigmacore.git
|
|
73
|
+
cd sigmacore/sigma_c_framework
|
|
74
|
+
pip install .
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## šÆ What is Sigma-C?
|
|
78
|
+
|
|
79
|
+
Sigma-C detects **critical phase transitions** in complex systems using Critical Susceptibility (Ļ) theory. Unlike traditional metrics, it identifies the precise scale where systems undergo fundamental structural changes.
|
|
80
|
+
|
|
81
|
+
**Use Cases:**
|
|
82
|
+
- š¬ **Quantum Computing**: Find noise thresholds that break quantum algorithms
|
|
83
|
+
- š® **GPU Optimization**: Auto-tune kernels to avoid cache thrashing
|
|
84
|
+
- š° **Finance**: Predict market crashes before they happen
|
|
85
|
+
- š **Climate Science**: Identify characteristic scales of weather systems
|
|
86
|
+
- š **Seismology**: Detect critical stress states in earthquake catalogs
|
|
87
|
+
- š§² **Magnetism**: Analyze phase transitions (Curie temperature)
|
|
88
|
+
|
|
89
|
+
## š¦ Features
|
|
90
|
+
|
|
91
|
+
- **6 Domain Adapters** ready for production use
|
|
92
|
+
- **High-Performance C++ Core** with Python bindings
|
|
93
|
+
- **Statistical Robustness** via bootstrap and permutation tests
|
|
94
|
+
- **Comprehensive Documentation** in English and German
|
|
95
|
+
- **Dual License**: AGPL-3.0 or Commercial
|
|
96
|
+
|
|
97
|
+
## š Documentation
|
|
98
|
+
|
|
99
|
+
- **Quick Start**: See [QUICKSTART.md](QUICKSTART.md) (5 minutes)
|
|
100
|
+
- **Full Documentation**: See [DOCUMENTATION.md](DOCUMENTATION.md) (English + German)
|
|
101
|
+
- **Release Guide**: See [RELEASE.md](RELEASE.md) (for contributors)
|
|
102
|
+
- **Changelog**: See [CHANGELOG.md](CHANGELOG.md)
|
|
103
|
+
|
|
104
|
+
## š” Example
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
from sigma_c import Universe
|
|
108
|
+
|
|
109
|
+
# Detect GPU performance critical point
|
|
110
|
+
gpu = Universe.gpu()
|
|
111
|
+
result = gpu.auto_tune(alpha_levels=[0.1, 0.5, 0.9])
|
|
112
|
+
|
|
113
|
+
print(f"Critical threshold: {result['sigma_c']:.3f}")
|
|
114
|
+
print(f"Stability score: {result['statistics']['kappa']:.2f}")
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## š License
|
|
118
|
+
|
|
119
|
+
Dual-licensed under AGPL-3.0 or Commercial License.
|
|
120
|
+
|
|
121
|
+
- **Open Source**: See [license_AGPL.txt](license_AGPL.txt)
|
|
122
|
+
- **Commercial**: Contact nfo@forgottenforge.xyz
|
|
123
|
+
|
|
124
|
+
For commercial licensing without AGPL-3.0 obligations, contact: **nfo@forgottenforge.xyz**
|
|
125
|
+
|
|
126
|
+
## š¤ Contributing
|
|
127
|
+
|
|
128
|
+
Contributions are welcome! Please read our contributing guidelines and submit pull requests.
|
|
129
|
+
|
|
130
|
+
## š§ Contact
|
|
131
|
+
|
|
132
|
+
- **Email**: nfo@forgottenforge.xyz
|
|
133
|
+
- **GitHub**: [github.com/forgottenforge/sigmacore](https://github.com/forgottenforge/sigmacore)
|
|
134
|
+
- **Issues**: [github.com/forgottenforge/sigmacore/issues](https://github.com/forgottenforge/sigmacore/issues)
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
**Made with ā¤ļø by ForgottenForge**
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Sigma-C Framework - Quick Start Guide
|
|
2
|
+
|
|
3
|
+
**Version 1.0.0** | **Copyright (c) 2025 ForgottenForge.xyz**
|
|
4
|
+
|
|
5
|
+
## For Developers: Getting Started in 5 Minutes
|
|
6
|
+
|
|
7
|
+
### 1. Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Clone and install
|
|
11
|
+
git clone https://github.com/forgottenforge/sigmacore.git
|
|
12
|
+
cd sigmacore/sigma_c_framework
|
|
13
|
+
pip install .
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 2. Your First Analysis
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from sigma_c import Universe
|
|
20
|
+
|
|
21
|
+
# Example: Detect GPU performance critical point
|
|
22
|
+
gpu = Universe.gpu()
|
|
23
|
+
result = gpu.auto_tune(alpha_levels=[0.1, 0.3, 0.5, 0.7, 0.9])
|
|
24
|
+
|
|
25
|
+
print(f"Critical threshold: {result['sigma_c']:.3f}")
|
|
26
|
+
print(f"Stability score: {result['statistics']['kappa']:.2f}")
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 3. Available Domains
|
|
30
|
+
|
|
31
|
+
| Domain | Use Case | Method |
|
|
32
|
+
|--------|----------|--------|
|
|
33
|
+
| **Quantum** | Noise resilience in quantum circuits | `Universe.quantum()` |
|
|
34
|
+
| **GPU** | Kernel optimization, cache tuning | `Universe.gpu()` |
|
|
35
|
+
| **Financial** | Market regime detection, crash prediction | `Universe.finance()` |
|
|
36
|
+
| **Climate** | Spatial scaling in weather data | `Universe.climate()` |
|
|
37
|
+
| **Seismic** | Earthquake criticality analysis | `Universe.seismic()` |
|
|
38
|
+
| **Magnetic** | Phase transitions (Ising model) | `Universe.magnetic()` |
|
|
39
|
+
|
|
40
|
+
### 4. Run the Examples
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# All examples are in examples_v4/
|
|
44
|
+
python examples_v4/demo_quantum.py
|
|
45
|
+
python examples_v4/demo_gpu.py
|
|
46
|
+
python examples_v4/demo_finance.py
|
|
47
|
+
python examples_v4/demo_climate.py
|
|
48
|
+
python examples_v4/demo_seismic.py
|
|
49
|
+
python examples_v4/demo_magnetic.py
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Each demo generates a plot showing the critical point detection.
|
|
53
|
+
|
|
54
|
+
### 5. Core Concept: Critical Susceptibility
|
|
55
|
+
|
|
56
|
+
**What it does:** Finds the exact parameter value (Ļ_c) where a system transitions from stable to unstable.
|
|
57
|
+
|
|
58
|
+
**Why it's better than traditional metrics:**
|
|
59
|
+
- Detects **precursors** to failure, not just the failure itself
|
|
60
|
+
- Works across completely different domains (quantum, finance, physics)
|
|
61
|
+
- Statistically robust (bootstrap + permutation tests)
|
|
62
|
+
|
|
63
|
+
**Key outputs:**
|
|
64
|
+
- `sigma_c`: The critical scale/threshold
|
|
65
|
+
- `kappa`: Stability score (higher = more critical)
|
|
66
|
+
- `p_value`: Statistical significance
|
|
67
|
+
|
|
68
|
+
### 6. Typical Workflow
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from sigma_c import Universe
|
|
72
|
+
import numpy as np
|
|
73
|
+
|
|
74
|
+
# 1. Initialize adapter
|
|
75
|
+
adapter = Universe.gpu()
|
|
76
|
+
|
|
77
|
+
# 2. Prepare your data
|
|
78
|
+
# x = control parameter (e.g., noise level, cache size)
|
|
79
|
+
# y = observable (e.g., performance, success rate)
|
|
80
|
+
|
|
81
|
+
# 3. Compute susceptibility
|
|
82
|
+
result = adapter.compute_susceptibility(x, y)
|
|
83
|
+
|
|
84
|
+
# 4. Interpret results
|
|
85
|
+
if result['kappa'] > 10:
|
|
86
|
+
print(f"ā ļø Critical behavior detected at Ļ_c = {result['sigma_c']}")
|
|
87
|
+
else:
|
|
88
|
+
print("ā System is stable")
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 7. Advanced: Custom Observables
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
class MyAdapter(SigmaCAdapter):
|
|
95
|
+
def get_observable(self, data, **kwargs):
|
|
96
|
+
# Your custom metric here
|
|
97
|
+
return np.std(data) / np.mean(data)
|
|
98
|
+
|
|
99
|
+
# Use it
|
|
100
|
+
from sigma_c.adapters.factory import AdapterFactory
|
|
101
|
+
AdapterFactory.register('custom', MyAdapter)
|
|
102
|
+
my_adapter = AdapterFactory.create('custom')
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 8. C++ Integration (High Performance)
|
|
106
|
+
|
|
107
|
+
```cpp
|
|
108
|
+
#include <sigma_c/susceptibility.hpp>
|
|
109
|
+
|
|
110
|
+
std::vector<double> x = {1.0, 2.0, 3.0, 4.0, 5.0};
|
|
111
|
+
std::vector<double> y = {0.1, 0.3, 0.8, 1.5, 2.0};
|
|
112
|
+
|
|
113
|
+
auto result = sigma_c::compute_susceptibility(x, y);
|
|
114
|
+
std::cout << "Critical point: " << result.sigma_c << std::endl;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Link with: `-lsigma_c_core`
|
|
118
|
+
|
|
119
|
+
### 9. Licensing
|
|
120
|
+
|
|
121
|
+
**Dual License:**
|
|
122
|
+
- **Open Source:** AGPL-3.0 (see `license_AGPL.txt`)
|
|
123
|
+
- **Commercial:** Proprietary use without copyleft (contact: nfo@forgottenforge.xyz)
|
|
124
|
+
|
|
125
|
+
### 10. Support & Documentation
|
|
126
|
+
|
|
127
|
+
- **Full Docs:** See `DOCUMENTATION.md` (English + German)
|
|
128
|
+
- **Examples:** `examples_v4/` directory
|
|
129
|
+
- **Issues:** GitHub Issues
|
|
130
|
+
- **Contact:** nfo@forgottenforge.xyz
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Common Use Cases
|
|
135
|
+
|
|
136
|
+
### Quantum Computing
|
|
137
|
+
```python
|
|
138
|
+
qpu = Universe.quantum(device='simulator')
|
|
139
|
+
result = qpu.run_optimization(
|
|
140
|
+
circuit_type='grover',
|
|
141
|
+
noise_levels=np.linspace(0, 0.1, 20)
|
|
142
|
+
)
|
|
143
|
+
# Finds the noise threshold where Grover's algorithm fails
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Financial Markets
|
|
147
|
+
```python
|
|
148
|
+
fin = Universe.finance()
|
|
149
|
+
result = fin.detect_regime(symbol='SPY')
|
|
150
|
+
# Detects if market is approaching a critical transition
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### GPU Optimization
|
|
154
|
+
```python
|
|
155
|
+
gpu = Universe.gpu()
|
|
156
|
+
result = gpu.auto_tune(alpha_levels=[0.1, 0.5, 0.9])
|
|
157
|
+
# Finds optimal cache/memory configuration
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
**Ready to use? Start with the examples and adapt them to your data!** š
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
[](https://badge.fury.io/py/sigma-c-framework)
|
|
2
|
+
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
3
|
+
[](https://www.python.org/downloads/)
|
|
4
|
+
|
|
5
|
+
# Sigma-C Framework v1.0.0
|
|
6
|
+
|
|
7
|
+
**Copyright (c) 2025 ForgottenForge.xyz**
|
|
8
|
+
|
|
9
|
+
**Critical Susceptibility Framework** for Quantum, GPU, Financial, Climate, Seismic, and Magnetic analysis.
|
|
10
|
+
|
|
11
|
+
## š Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Install the package
|
|
15
|
+
pip install sigma-c-framework
|
|
16
|
+
|
|
17
|
+
# Run examples
|
|
18
|
+
python -m sigma_c.examples.demo_quantum
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or clone and install from source:
|
|
22
|
+
```bash
|
|
23
|
+
git clone https://github.com/forgottenforge/sigmacore.git
|
|
24
|
+
cd sigmacore/sigma_c_framework
|
|
25
|
+
pip install .
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## šÆ What is Sigma-C?
|
|
29
|
+
|
|
30
|
+
Sigma-C detects **critical phase transitions** in complex systems using Critical Susceptibility (Ļ) theory. Unlike traditional metrics, it identifies the precise scale where systems undergo fundamental structural changes.
|
|
31
|
+
|
|
32
|
+
**Use Cases:**
|
|
33
|
+
- š¬ **Quantum Computing**: Find noise thresholds that break quantum algorithms
|
|
34
|
+
- š® **GPU Optimization**: Auto-tune kernels to avoid cache thrashing
|
|
35
|
+
- š° **Finance**: Predict market crashes before they happen
|
|
36
|
+
- š **Climate Science**: Identify characteristic scales of weather systems
|
|
37
|
+
- š **Seismology**: Detect critical stress states in earthquake catalogs
|
|
38
|
+
- š§² **Magnetism**: Analyze phase transitions (Curie temperature)
|
|
39
|
+
|
|
40
|
+
## š¦ Features
|
|
41
|
+
|
|
42
|
+
- **6 Domain Adapters** ready for production use
|
|
43
|
+
- **High-Performance C++ Core** with Python bindings
|
|
44
|
+
- **Statistical Robustness** via bootstrap and permutation tests
|
|
45
|
+
- **Comprehensive Documentation** in English and German
|
|
46
|
+
- **Dual License**: AGPL-3.0 or Commercial
|
|
47
|
+
|
|
48
|
+
## š Documentation
|
|
49
|
+
|
|
50
|
+
- **Quick Start**: See [QUICKSTART.md](QUICKSTART.md) (5 minutes)
|
|
51
|
+
- **Full Documentation**: See [DOCUMENTATION.md](DOCUMENTATION.md) (English + German)
|
|
52
|
+
- **Release Guide**: See [RELEASE.md](RELEASE.md) (for contributors)
|
|
53
|
+
- **Changelog**: See [CHANGELOG.md](CHANGELOG.md)
|
|
54
|
+
|
|
55
|
+
## š” Example
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from sigma_c import Universe
|
|
59
|
+
|
|
60
|
+
# Detect GPU performance critical point
|
|
61
|
+
gpu = Universe.gpu()
|
|
62
|
+
result = gpu.auto_tune(alpha_levels=[0.1, 0.5, 0.9])
|
|
63
|
+
|
|
64
|
+
print(f"Critical threshold: {result['sigma_c']:.3f}")
|
|
65
|
+
print(f"Stability score: {result['statistics']['kappa']:.2f}")
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## š License
|
|
69
|
+
|
|
70
|
+
Dual-licensed under AGPL-3.0 or Commercial License.
|
|
71
|
+
|
|
72
|
+
- **Open Source**: See [license_AGPL.txt](license_AGPL.txt)
|
|
73
|
+
- **Commercial**: Contact nfo@forgottenforge.xyz
|
|
74
|
+
|
|
75
|
+
For commercial licensing without AGPL-3.0 obligations, contact: **nfo@forgottenforge.xyz**
|
|
76
|
+
|
|
77
|
+
## š¤ Contributing
|
|
78
|
+
|
|
79
|
+
Contributions are welcome! Please read our contributing guidelines and submit pull requests.
|
|
80
|
+
|
|
81
|
+
## š§ Contact
|
|
82
|
+
|
|
83
|
+
- **Email**: nfo@forgottenforge.xyz
|
|
84
|
+
- **GitHub**: [github.com/forgottenforge/sigmacore](https://github.com/forgottenforge/sigmacore)
|
|
85
|
+
- **Issues**: [github.com/forgottenforge/sigmacore/issues](https://github.com/forgottenforge/sigmacore/issues)
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
**Made with ā¤ļø by ForgottenForge**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
|
4
|
+
|
|
5
|
+
from sigma_c.adapters.quantum import QuantumAdapter
|
|
6
|
+
import inspect
|
|
7
|
+
|
|
8
|
+
print(f"QuantumAdapter file: {inspect.getfile(QuantumAdapter)}")
|
|
9
|
+
qpu = QuantumAdapter()
|
|
10
|
+
print(f"Has run_optimization: {hasattr(qpu, 'run_optimization')}")
|
|
11
|
+
print(f"Dir: {dir(qpu)}")
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Sigma-C Climate Demo
|
|
4
|
+
==========================================================
|
|
5
|
+
Copyright (c) 2025 ForgottenForge.xyz
|
|
6
|
+
|
|
7
|
+
Demonstrates how to use the ClimateAdapter to analyze spatial scaling properties
|
|
8
|
+
of temperature fields (ERA5 data).
|
|
9
|
+
|
|
10
|
+
For commercial licensing without AGPL-3.0 obligations, contact:
|
|
11
|
+
[nfo@forgottenforge.xyz]
|
|
12
|
+
|
|
13
|
+
SPDX-License-Identifier: AGPL-3.0-or-later OR Commercial
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
import sys
|
|
17
|
+
import os
|
|
18
|
+
import pandas as pd
|
|
19
|
+
import numpy as np
|
|
20
|
+
import matplotlib.pyplot as plt
|
|
21
|
+
|
|
22
|
+
# Ensure we can import sigma_c from local source
|
|
23
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
|
24
|
+
|
|
25
|
+
from sigma_c import Universe
|
|
26
|
+
|
|
27
|
+
def main():
|
|
28
|
+
print("š Starting Climate Spatial Analysis...")
|
|
29
|
+
|
|
30
|
+
# 1. Initialize Climate Adapter
|
|
31
|
+
clim = Universe.climate()
|
|
32
|
+
print("ā Climate Adapter initialized")
|
|
33
|
+
|
|
34
|
+
# 2. Generate Mock Data (for demo purposes)
|
|
35
|
+
# In production, you would load real ERA5 parquet files.
|
|
36
|
+
print("ā Generating synthetic temperature field...")
|
|
37
|
+
n_points = 5000
|
|
38
|
+
data = pd.DataFrame({
|
|
39
|
+
'lat': np.random.uniform(35, 70, n_points),
|
|
40
|
+
'lon': np.random.uniform(-10, 40, n_points),
|
|
41
|
+
# Create a synthetic field with a specific correlation length
|
|
42
|
+
'value': np.sin(np.random.uniform(35, 70, n_points)/5) * 10 + 15 + np.random.normal(0, 2, n_points)
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
# 3. Run Spatial Scaling Analysis
|
|
46
|
+
print("ā Computing gradient variance across scales...")
|
|
47
|
+
res = clim.analyze_spatial_scaling(data)
|
|
48
|
+
|
|
49
|
+
sigma_c = res['sigma_c']
|
|
50
|
+
kappa = res['kappa']
|
|
51
|
+
|
|
52
|
+
print("\nš Climate Status:")
|
|
53
|
+
print(f" Critical Spatial Scale: {sigma_c:.1f} km")
|
|
54
|
+
print(f" Organization Strength (Īŗ): {kappa:.2f}")
|
|
55
|
+
|
|
56
|
+
# 4. Visualize
|
|
57
|
+
try:
|
|
58
|
+
plt.figure(figsize=(10, 5))
|
|
59
|
+
|
|
60
|
+
scales = res['sigma_range']
|
|
61
|
+
obs = res['observable']
|
|
62
|
+
|
|
63
|
+
plt.plot(scales, obs, 'c-o', label='Gradient Variance')
|
|
64
|
+
plt.axvline(sigma_c, color='r', linestyle='--', label=f'Critical Scale {sigma_c:.0f}km')
|
|
65
|
+
|
|
66
|
+
plt.xscale('log')
|
|
67
|
+
plt.xlabel("Spatial Scale (km)")
|
|
68
|
+
plt.ylabel("Gradient Variance")
|
|
69
|
+
plt.title("Climate Spatial Scaling Analysis")
|
|
70
|
+
plt.legend()
|
|
71
|
+
plt.grid(True, alpha=0.3)
|
|
72
|
+
|
|
73
|
+
output_file = "climate_results.png"
|
|
74
|
+
plt.savefig(output_file)
|
|
75
|
+
print(f"ā Plot saved to {output_file}")
|
|
76
|
+
|
|
77
|
+
except Exception as e:
|
|
78
|
+
print(f"ā ļø Could not generate plot: {e}")
|
|
79
|
+
|
|
80
|
+
if __name__ == "__main__":
|
|
81
|
+
main()
|