Skip to content

Commit c8a60c2

Browse files
authored
Merge pull request #2800 from fermga/copilot/create-basic-wiki
Add basic wiki with visual graphics for TNFR-Python-Engine
2 parents 8378d8b + 4047ca3 commit c8a60c2

13 files changed

+2188
-0
lines changed

wiki/Core-Concepts.md

Lines changed: 461 additions & 0 deletions
Large diffs are not rendered by default.

wiki/Examples.md

Lines changed: 550 additions & 0 deletions
Large diffs are not rendered by default.

wiki/Getting-Started.md

Lines changed: 393 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,393 @@
1+
# Getting Started with TNFR 🚀
2+
3+
This guide will get you up and running with the TNFR Python Engine in minutes.
4+
5+
## Installation
6+
7+
### Using pip (Recommended)
8+
9+
```bash
10+
pip install tnfr
11+
```
12+
13+
**Requirements**: Python ≥ 3.9
14+
15+
### Optional Dependencies
16+
17+
For enhanced performance and features:
18+
19+
```bash
20+
# GPU acceleration with JAX
21+
pip install tnfr[jax]
22+
23+
# PyTorch backend support
24+
pip install tnfr[torch]
25+
26+
# Visualization tools
27+
pip install tnfr[viz]
28+
29+
# All optional features
30+
pip install tnfr[all]
31+
```
32+
33+
### From Source
34+
35+
For development or to get the latest features:
36+
37+
```bash
38+
git clone https://github.com/fermga/TNFR-Python-Engine.git
39+
cd TNFR-Python-Engine
40+
pip install -e ".[dev]"
41+
```
42+
43+
## Quick Start
44+
45+
### Your First TNFR Network (3 Lines!)
46+
47+
```python
48+
from tnfr.sdk import TNFRNetwork
49+
50+
# Create, activate, and measure a network
51+
network = TNFRNetwork("hello_world")
52+
results = (network
53+
.add_nodes(10)
54+
.connect_nodes(0.3, "random")
55+
.apply_sequence("basic_activation", repeat=3)
56+
.measure())
57+
58+
print(results.summary())
59+
```
60+
61+
**Output:**
62+
```
63+
=== TNFR Network Results ===
64+
Network: hello_world
65+
Nodes: 10
66+
Edges: 13
67+
Coherence C(t): 0.782
68+
Sense Index Si: 0.654
69+
Status: STABLE
70+
```
71+
72+
### What Just Happened?
73+
74+
Let's break down the code:
75+
76+
1. **`add_nodes(10)`**: Created 10 Resonant Fractal Nodes (NFRs)
77+
- Each node has an EPI (structural form), νf (frequency), and φ (phase)
78+
79+
2. **`connect_nodes(0.3, "random")`**: Connected nodes randomly
80+
- 30% connection probability
81+
- Creates couplings based on phase synchrony
82+
83+
3. **`apply_sequence("basic_activation", repeat=3)`**: Applied operator sequence
84+
- Emission → Coherence → Resonance
85+
- Repeated 3 times to stabilize the network
86+
87+
4. **`measure()`**: Calculated network metrics
88+
- C(t): Total coherence (pattern stability)
89+
- Si: Sense index (reorganization stability)
90+
91+
## Interactive Learning (5 Minutes)
92+
93+
TNFR includes guided tutorials to learn the concepts:
94+
95+
```python
96+
from tnfr.tutorials import hello_tnfr
97+
98+
# Guided tour of TNFR fundamentals
99+
hello_tnfr()
100+
```
101+
102+
This interactive tutorial will:
103+
- ✅ Explain core TNFR concepts
104+
- ✅ Show you how to create and manipulate networks
105+
- ✅ Demonstrate structural operators in action
106+
- ✅ Teach you to interpret coherence metrics
107+
108+
## Core Workflow
109+
110+
Every TNFR application follows this pattern:
111+
112+
```python
113+
from tnfr.sdk import TNFRNetwork
114+
115+
# 1. Initialize network
116+
network = TNFRNetwork("my_network")
117+
118+
# 2. Build structure
119+
network.add_nodes(20, epi_range=(0.8, 1.2))
120+
network.connect_nodes(0.4, topology="scale_free")
121+
122+
# 3. Apply operators
123+
network.apply_operator("emission", target_nodes=[0, 1, 2])
124+
network.apply_operator("coherence")
125+
network.apply_operator("resonance")
126+
127+
# 4. Measure & analyze
128+
results = network.measure()
129+
print(f"Coherence: {results.coherence:.3f}")
130+
print(f"Sense Index: {results.sense_index:.3f}")
131+
132+
# 5. Visualize (optional)
133+
network.visualize(show_metrics=True)
134+
```
135+
136+
## Domain-Specific Examples
137+
138+
### Biological Network
139+
140+
Model cellular communication:
141+
142+
```python
143+
from tnfr.sdk import TNFRNetwork
144+
145+
# Create a cellular network
146+
cells = TNFRNetwork("cell_network")
147+
148+
results = (cells
149+
.add_nodes(20, epi_range=(0.8, 1.2)) # Biological variation
150+
.connect_nodes(0.3, "scale_free") # Power-law connectivity
151+
.apply_sequence("therapeutic", repeat=5) # Healing pattern
152+
.measure())
153+
154+
print(f"Network health: {results.coherence:.2%}")
155+
```
156+
157+
### Social Network
158+
159+
Model information spreading:
160+
161+
```python
162+
from tnfr.sdk import TNFRNetwork
163+
164+
# Create a social network
165+
community = TNFRNetwork("social_community")
166+
167+
results = (community
168+
.add_nodes(50)
169+
.connect_nodes(0.25, "small_world") # Small-world topology
170+
.apply_operator("emission", target_nodes=[0]) # Seed information
171+
.apply_sequence("propagation", repeat=10) # Spread through network
172+
.measure())
173+
174+
print(f"Information reach: {results.active_nodes}/{results.total_nodes}")
175+
```
176+
177+
### Technology/IoT Network
178+
179+
Model distributed system coordination:
180+
181+
```python
182+
from tnfr.sdk import TNFRNetwork
183+
184+
# Create IoT sensor network
185+
sensors = TNFRNetwork("iot_sensors")
186+
187+
results = (sensors
188+
.add_nodes(30)
189+
.connect_nodes(0.35, "lattice") # Grid topology
190+
.apply_sequence("synchronization", repeat=8) # Coordinate sensors
191+
.measure())
192+
193+
print(f"Sync quality: {results.sense_index:.3f}")
194+
```
195+
196+
## Understanding Results
197+
198+
### Coherence Metrics
199+
200+
After measuring a network, you get these key metrics:
201+
202+
```python
203+
results = network.measure()
204+
205+
# Total Coherence C(t) [0, 1]
206+
print(f"C(t): {results.coherence:.3f}")
207+
# > 0.7: Strong coherence (stable patterns)
208+
# 0.3-0.7: Moderate coherence (evolving)
209+
# < 0.3: Weak coherence (fragmentation risk)
210+
211+
# Sense Index Si [0, 1+]
212+
print(f"Si: {results.sense_index:.3f}")
213+
# > 0.8: Excellent stability
214+
# 0.4-0.8: Moderate stability
215+
# < 0.4: Unstable (changes may cause bifurcation)
216+
217+
# Reorganization Gradient ΔNFR
218+
print(f"ΔNFR: {results.delta_nfr:.3f}")
219+
# Positive: Structure expanding
220+
# Negative: Structure contracting
221+
# ~0: Equilibrium
222+
```
223+
224+
### Network Status
225+
226+
```python
227+
if results.coherence > 0.7 and results.sense_index > 0.6:
228+
print("✓ Network is STABLE and healthy")
229+
elif results.coherence < 0.3:
230+
print("⚠ Network is FRAGMENTING - apply coherence operators")
231+
else:
232+
print("◐ Network is EVOLVING - monitor closely")
233+
```
234+
235+
## Built-in Operator Sequences
236+
237+
TNFR provides pre-configured operator sequences for common patterns:
238+
239+
```python
240+
# Available sequences
241+
sequences = [
242+
"basic_activation", # Emission → Coherence → Resonance
243+
"therapeutic", # Self-org → Coherence → Regeneration
244+
"exploration", # Dissonance → Mutation → Coherence
245+
"propagation", # Emission → Resonance → Coupling
246+
"synchronization", # Reception → Coherence → Silence
247+
"stabilization", # Coherence → Silence → Coherence
248+
]
249+
250+
# Use any sequence
251+
network.apply_sequence("therapeutic", repeat=5)
252+
```
253+
254+
## Visualization
255+
256+
### Basic Network Plot
257+
258+
```python
259+
network.visualize()
260+
```
261+
262+
Shows:
263+
- Nodes (colored by coherence level)
264+
- Edges (thickness = coupling strength)
265+
- Phase synchronization
266+
267+
### Interactive Dashboard
268+
269+
```python
270+
from tnfr.viz import launch_dashboard
271+
272+
# Launch interactive web dashboard
273+
launch_dashboard(network)
274+
```
275+
276+
Features:
277+
- Real-time metric updates
278+
- Operator controls
279+
- Time-series plots
280+
- Network graph explorer
281+
282+
### Save Metrics Plot
283+
284+
```python
285+
import matplotlib.pyplot as plt
286+
287+
# Plot coherence over time
288+
results.plot_metrics()
289+
plt.savefig("coherence_evolution.png")
290+
```
291+
292+
## Advanced Configuration
293+
294+
### Custom Node Parameters
295+
296+
```python
297+
# Precise control over node properties
298+
network.add_nodes(
299+
count=15,
300+
epi_range=(0.5, 1.5), # EPI magnitude range
301+
freq_range=(10, 50), # νf in Hz_str
302+
phase_sync=True, # Start with synchronized phases
303+
initial_coherence=0.8 # Target initial C(t)
304+
)
305+
```
306+
307+
### Custom Topology
308+
309+
```python
310+
# Different network topologies
311+
network.connect_nodes(0.3, topology="random") # Erdős–Rényi
312+
network.connect_nodes(0.3, topology="scale_free") # Barabási–Albert
313+
network.connect_nodes(0.3, topology="small_world") # Watts–Strogatz
314+
network.connect_nodes(0.3, topology="lattice") # Grid
315+
```
316+
317+
### Backend Selection
318+
319+
```python
320+
from tnfr.sdk import TNFRNetwork
321+
322+
# Choose computational backend
323+
network = TNFRNetwork("my_net", backend="jax") # GPU-accelerated
324+
# Options: "numpy" (default), "jax", "torch"
325+
```
326+
327+
## Performance Tips
328+
329+
### For Large Networks (>1000 nodes)
330+
331+
```bash
332+
# Use JAX backend with GPU
333+
pip install tnfr[jax]
334+
```
335+
336+
```python
337+
network = TNFRNetwork("large_net", backend="jax")
338+
```
339+
340+
### Caching
341+
342+
```python
343+
# Enable intelligent caching for repeated operations
344+
from tnfr.sdk import TNFRNetwork
345+
346+
network = TNFRNetwork("cached_net", enable_cache=True)
347+
```
348+
349+
## Next Steps
350+
351+
Now that you're up and running:
352+
353+
1. **Learn the Theory**: Read [Core Concepts](Core-Concepts.md) to understand the paradigm
354+
2. **Explore Examples**: Check out [Examples & Use Cases](Examples.md) for your domain
355+
3. **API Deep Dive**: See the [API Reference](https://tnfr.netlify.app/api/overview/) for advanced features
356+
4. **Join the Community**: Ask questions in [GitHub Discussions](https://github.com/fermga/TNFR-Python-Engine/discussions)
357+
358+
## Troubleshooting
359+
360+
### Import Errors
361+
362+
```bash
363+
# If you get "No module named 'tnfr'"
364+
pip install --upgrade tnfr
365+
366+
# Or for development install
367+
pip install -e .
368+
```
369+
370+
### Low Coherence
371+
372+
If your network has low coherence (<0.3):
373+
374+
```python
375+
# Apply stabilization sequence
376+
network.apply_sequence("stabilization", repeat=5)
377+
results = network.measure()
378+
```
379+
380+
### Installation Issues
381+
382+
See [Troubleshooting Guide](https://tnfr.netlify.app/user-guide/TROUBLESHOOTING/) for common issues.
383+
384+
## Getting Help
385+
386+
- 📖 **Documentation**: https://tnfr.netlify.app
387+
- 💬 **Discussions**: https://github.com/fermga/TNFR-Python-Engine/discussions
388+
- 🐛 **Issues**: https://github.com/fermga/TNFR-Python-Engine/issues
389+
- 📧 **Email**: See [CONTRIBUTING.md](https://github.com/fermga/TNFR-Python-Engine/blob/main/CONTRIBUTING.md)
390+
391+
---
392+
393+
[← Back to Home](Home.md) | [Core Concepts →](Core-Concepts.md) | [Examples →](Examples.md)

0 commit comments

Comments
 (0)