# tnfr · Python package
> Engine for **modeling, simulation, and measurement** of multiscale structural coherence through **structural operators** (emission, reception, coherence, dissonance, coupling, resonance, silence, expansion, contraction, self‑organization, mutation, transition, recursivity).
---
## What is `tnfr`?
`tnfr` is a Python library to **operate with form**: build nodes, couple them into networks, and **modulate their coherence** over time using structural operators. It does not describe “things”; it **activates processes**. Its theoretical basis is the Resonant Fractal Nature Theory (TNFR), which understands reality as **networks of coherence** that persist because they **resonate**.
In practical terms, `tnfr` lets you:
* Model **Resonant Fractal Nodes (NFR)** with parameters for **frequency** (νf), **phase** (θ), and **form** (EPI).
* Apply **structural operators** to start, stabilize, propagate, or reconfigure coherence.
* **Simulate** nodal dynamics with discrete/continuous integrators.
* **Measure** global coherence C(t), nodal gradient ΔNFR, and the **Sense Index** (Si).
* **Visualize** states and trajectories (coupling matrices, C(t) curves, graphs).
> **Nodal equation (operational core)**
>
> $\frac{\partial \mathrm{EPI}}{\partial t} = \nu_f\,\cdot\,\Delta\mathrm{NFR}(t)$
>
> A form emerges and persists when **internal reorganization** (ΔNFR) **resonates** with the node’s **frequency** (νf).
---
## Installation
```bash
pip install tnfr
```
Requires **Python ≥ 3.9**.
---
## Why TNFR (in 60 seconds)
* **From objects to coherences:** you model **processes** that hold, not fixed entities.
* **Operators instead of rules:** you compose **structural operators** (e.g., *emission*, *coherence*, *dissonance*) to **build trajectories**.
* **Operational fractality:** the same pattern works for **ideas, teams, tissues, narratives**; the scales change, **the logic doesn’t**.
---
## Getting started (minimal recipe)
> *The high‑level API centers on three things: nodes, operators, simulation.*
```python
# 1) Nodes and network
import tnfr as T
# A minimal set of nodes with initial frequency (νf)
A = T.Node(label="seed", nu_f=0.8)
B = T.Node(label="context", nu_f=0.6)
net = T.Network([A, B], edges=[(A, B, 0.7)]) # coupling 0..1
# 2) Sequence of structural operators
ops = [
T.ops.Emission(strength=0.4), # start pattern
T.ops.Coupling(weight=0.7), # synchronize nodes
T.ops.Coherence(), # stabilize form
]
# 3) Simulation and metrics
traj = T.sim.run(net, ops, steps=200, dt=0.05)
print("C(t) =", T.metrics.coherence(traj)[-1])
print("Si =", T.metrics.sense_index(traj))
# 4) Quick visualization
T.viz.plot_coherence(traj) # C(t) curve
T.viz.plot_network(net) # graph/couplings
```
> **Note:** Specific class/function names may vary across minor versions. Check `help(T.ops)` and `help(T.sim)` for your installed API.
---
## Key concepts (operational summary)
* **Node (NFR):** a unit that persists because it **resonates**. Parameterized by **νf** (frequency), **θ** (phase), and **EPI** (coherent form).
* **Structural operators:** functions that reorganize the network. We use **functional** names (not phonemes):
* **Emission** (start), **Reception** (open), **Coherence** (stabilize), **Dissonance** (creative tension), **Coupling** (synchrony), **Resonance** (propagate), **Silence** (latency), **Expansion**, **Contraction**, **Self‑organization**, **Mutation**, **Transition**, **Recursivity**.
* **Magnitudes:**
* **C(t):** global coherence.
* **ΔNFR:** nodal gradient (need for reorganization).
* **νf:** structural frequency (Hz\_str).
* **Si:** sense index (ability to generate stable shared coherence).
---
## Typical workflow
1. **Model** your system as a network: nodes (agents, ideas, tissues, modules) and couplings.
2. **Select** a **trajectory of operators** aligned with your goal (e.g., *start → couple → stabilize*).
3. **Simulate** the dynamics: number of steps, step size, tolerances.
4. **Measure**: C(t), ΔNFR, Si; identify bifurcations and collapses.
5. **Iterate** with controlled **dissonance** to open mutations without losing form.
---
## High‑level API (orientation map)
> The typical module layout in `tnfr` is:
* `tnfr.core`: `Node`, `Network`, `EPI`, `State`
* `tnfr.ops`: structural operators (Emission, Reception, Coherence, Dissonance, ...)
* `tnfr.sim`: integrators (`run`, `step`, `integrate`), dt control and thresholds
* `tnfr.metrics`: `coherence`, `gradient`, `sense_index`, `phase_sync`
* `tnfr.viz`: plotting utilities (`plot_coherence`, `plot_network`, `plot_phase`)
Usage examples:
```python
from tnfr import core, ops, sim, metrics
net = core.Network.from_edges([
("n1", "n2", 0.6),
("n2", "n3", 0.8),
])
sequence = [ops.Emission(0.3), ops.Coupling(0.5), ops.Coherence()]
traj = sim.run(net, sequence, steps=500)
print(metrics.coherence(traj))
```
---
## Parametric modeling
```python
import tnfr as T
net = T.Network.uniform(n=25, nu_f=0.4, coupling=0.3)
plan = (
T.ops.Emission(0.2)
>> T.ops.Expansion(0.4)
>> T.ops.Coupling(0.6)
>> T.ops.Coherence()
)
traj = T.sim.run(net, plan, steps=800)
T.viz.plot_phase(traj)
```
---
## Main metrics
* `coherence(traj) → C(t)`: global stability; higher values indicate sustained form.
* `gradient(state) → ΔNFR`: local demand for reorganization (high = risk of collapse/bifurcation).
* `sense_index(traj) → Si`: proxy for **structural sense** (capacity to generate shared coherence) combining **νf**, phase, and topology.
---
## Best practices
* **Short sequences** and frequent C(t) checks avoid unnecessary collapses.
* Use **dissonance** as a tool: introduce it to open possibilities, but **seal** with coherence.
* **Scale first, detail later:** tune coarse couplings before micro‑parameters.
---
## Project status
* **pre‑1.0 API**: signatures may be refined; concepts and magnitudes are stable.
* **Pure‑Python** core with minimal dependencies (optional: `numpy`, `matplotlib`, `networkx`).
---
## Contributing
Suggestions, issues, and PRs are welcome. Guidelines:
1. Prioritize **operational clarity** (names, docstrings, examples).
2. Add **tests** and **notebooks** that show the structural effect of each PR.
3. Keep **semantic neutrality**: operators act on form, not on contents.
---
## License
MIT
---
## References & notes
* Theoretical foundations: TNFR operational manual.
* Operational definitions: nodal equation, dimensions (frequency, phase, form), and structural operators.
> If you use `tnfr` in research or projects, please cite the TNFR conceptual framework and link to the PyPI package.
Raw data
{
"_id": null,
"home_page": null,
"name": "tnfr",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "TNFR, resonant fractal, resonance, glyphs, networkx, dynamics, coherence, EPI, Kuramoto",
"author": "fmg",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/d1/74/7d2a9afaaccab088d19900287b2c9629457bacb72b0bb2ef726ed9e8aac5/tnfr-4.5.1.tar.gz",
"platform": null,
"description": "# tnfr \u00b7 Python package\r\n\r\n> Engine for **modeling, simulation, and measurement** of multiscale structural coherence through **structural operators** (emission, reception, coherence, dissonance, coupling, resonance, silence, expansion, contraction, self\u2011organization, mutation, transition, recursivity).\r\n\r\n---\r\n\r\n## What is `tnfr`?\r\n\r\n`tnfr` is a Python library to **operate with form**: build nodes, couple them into networks, and **modulate their coherence** over time using structural operators. It does not describe \u201cthings\u201d; it **activates processes**. Its theoretical basis is the Resonant Fractal Nature Theory (TNFR), which understands reality as **networks of coherence** that persist because they **resonate**.\r\n\r\nIn practical terms, `tnfr` lets you:\r\n\r\n* Model **Resonant Fractal Nodes (NFR)** with parameters for **frequency** (\u03bdf), **phase** (\u03b8), and **form** (EPI).\r\n* Apply **structural operators** to start, stabilize, propagate, or reconfigure coherence.\r\n* **Simulate** nodal dynamics with discrete/continuous integrators.\r\n* **Measure** global coherence C(t), nodal gradient \u0394NFR, and the **Sense Index** (Si).\r\n* **Visualize** states and trajectories (coupling matrices, C(t) curves, graphs).\r\n\r\n> **Nodal equation (operational core)**\r\n>\r\n> $\\frac{\\partial \\mathrm{EPI}}{\\partial t} = \\nu_f\\,\\cdot\\,\\Delta\\mathrm{NFR}(t)$\r\n>\r\n> A form emerges and persists when **internal reorganization** (\u0394NFR) **resonates** with the node\u2019s **frequency** (\u03bdf).\r\n\r\n---\r\n\r\n## Installation\r\n\r\n```bash\r\npip install tnfr\r\n```\r\n\r\nRequires **Python \u2265 3.9**.\r\n\r\n---\r\n\r\n## Why TNFR (in 60 seconds)\r\n\r\n* **From objects to coherences:** you model **processes** that hold, not fixed entities.\r\n* **Operators instead of rules:** you compose **structural operators** (e.g., *emission*, *coherence*, *dissonance*) to **build trajectories**.\r\n* **Operational fractality:** the same pattern works for **ideas, teams, tissues, narratives**; the scales change, **the logic doesn\u2019t**.\r\n\r\n---\r\n\r\n## Getting started (minimal recipe)\r\n\r\n> *The high\u2011level API centers on three things: nodes, operators, simulation.*\r\n\r\n```python\r\n# 1) Nodes and network\r\nimport tnfr as T\r\n\r\n# A minimal set of nodes with initial frequency (\u03bdf)\r\nA = T.Node(label=\"seed\", nu_f=0.8)\r\nB = T.Node(label=\"context\", nu_f=0.6)\r\nnet = T.Network([A, B], edges=[(A, B, 0.7)]) # coupling 0..1\r\n\r\n# 2) Sequence of structural operators\r\nops = [\r\n T.ops.Emission(strength=0.4), # start pattern\r\n T.ops.Coupling(weight=0.7), # synchronize nodes\r\n T.ops.Coherence(), # stabilize form\r\n]\r\n\r\n# 3) Simulation and metrics\r\ntraj = T.sim.run(net, ops, steps=200, dt=0.05)\r\nprint(\"C(t) =\", T.metrics.coherence(traj)[-1])\r\nprint(\"Si =\", T.metrics.sense_index(traj))\r\n\r\n# 4) Quick visualization\r\nT.viz.plot_coherence(traj) # C(t) curve\r\nT.viz.plot_network(net) # graph/couplings\r\n```\r\n\r\n> **Note:** Specific class/function names may vary across minor versions. Check `help(T.ops)` and `help(T.sim)` for your installed API.\r\n\r\n---\r\n\r\n## Key concepts (operational summary)\r\n\r\n* **Node (NFR):** a unit that persists because it **resonates**. Parameterized by **\u03bdf** (frequency), **\u03b8** (phase), and **EPI** (coherent form).\r\n* **Structural operators:** functions that reorganize the network. We use **functional** names (not phonemes):\r\n\r\n * **Emission** (start), **Reception** (open), **Coherence** (stabilize), **Dissonance** (creative tension), **Coupling** (synchrony), **Resonance** (propagate), **Silence** (latency), **Expansion**, **Contraction**, **Self\u2011organization**, **Mutation**, **Transition**, **Recursivity**.\r\n* **Magnitudes:**\r\n\r\n * **C(t):** global coherence.\r\n * **\u0394NFR:** nodal gradient (need for reorganization).\r\n * **\u03bdf:** structural frequency (Hz\\_str).\r\n * **Si:** sense index (ability to generate stable shared coherence).\r\n\r\n---\r\n\r\n## Typical workflow\r\n\r\n1. **Model** your system as a network: nodes (agents, ideas, tissues, modules) and couplings.\r\n2. **Select** a **trajectory of operators** aligned with your goal (e.g., *start \u2192 couple \u2192 stabilize*).\r\n3. **Simulate** the dynamics: number of steps, step size, tolerances.\r\n4. **Measure**: C(t), \u0394NFR, Si; identify bifurcations and collapses.\r\n5. **Iterate** with controlled **dissonance** to open mutations without losing form.\r\n\r\n---\r\n\r\n## High\u2011level API (orientation map)\r\n\r\n> The typical module layout in `tnfr` is:\r\n\r\n* `tnfr.core`: `Node`, `Network`, `EPI`, `State`\r\n* `tnfr.ops`: structural operators (Emission, Reception, Coherence, Dissonance, ...)\r\n* `tnfr.sim`: integrators (`run`, `step`, `integrate`), dt control and thresholds\r\n* `tnfr.metrics`: `coherence`, `gradient`, `sense_index`, `phase_sync`\r\n* `tnfr.viz`: plotting utilities (`plot_coherence`, `plot_network`, `plot_phase`)\r\n\r\nUsage examples:\r\n\r\n```python\r\nfrom tnfr import core, ops, sim, metrics\r\n\r\nnet = core.Network.from_edges([\r\n (\"n1\", \"n2\", 0.6),\r\n (\"n2\", \"n3\", 0.8),\r\n])\r\n\r\nsequence = [ops.Emission(0.3), ops.Coupling(0.5), ops.Coherence()]\r\ntraj = sim.run(net, sequence, steps=500)\r\n\r\nprint(metrics.coherence(traj))\r\n```\r\n\r\n---\r\n\r\n## Parametric modeling\r\n\r\n```python\r\nimport tnfr as T\r\n\r\nnet = T.Network.uniform(n=25, nu_f=0.4, coupling=0.3)\r\nplan = (\r\n T.ops.Emission(0.2)\r\n >> T.ops.Expansion(0.4)\r\n >> T.ops.Coupling(0.6)\r\n >> T.ops.Coherence()\r\n)\r\ntraj = T.sim.run(net, plan, steps=800)\r\nT.viz.plot_phase(traj)\r\n```\r\n\r\n---\r\n\r\n## Main metrics\r\n\r\n* `coherence(traj) \u2192 C(t)`: global stability; higher values indicate sustained form.\r\n* `gradient(state) \u2192 \u0394NFR`: local demand for reorganization (high = risk of collapse/bifurcation).\r\n* `sense_index(traj) \u2192 Si`: proxy for **structural sense** (capacity to generate shared coherence) combining **\u03bdf**, phase, and topology.\r\n\r\n---\r\n\r\n## Best practices\r\n\r\n* **Short sequences** and frequent C(t) checks avoid unnecessary collapses.\r\n* Use **dissonance** as a tool: introduce it to open possibilities, but **seal** with coherence.\r\n* **Scale first, detail later:** tune coarse couplings before micro\u2011parameters.\r\n\r\n---\r\n\r\n## Project status\r\n\r\n* **pre\u20111.0 API**: signatures may be refined; concepts and magnitudes are stable.\r\n* **Pure\u2011Python** core with minimal dependencies (optional: `numpy`, `matplotlib`, `networkx`).\r\n\r\n---\r\n\r\n## Contributing\r\n\r\nSuggestions, issues, and PRs are welcome. Guidelines:\r\n\r\n1. Prioritize **operational clarity** (names, docstrings, examples).\r\n2. Add **tests** and **notebooks** that show the structural effect of each PR.\r\n3. Keep **semantic neutrality**: operators act on form, not on contents.\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT \r\n\r\n---\r\n\r\n## References & notes\r\n\r\n* Theoretical foundations: TNFR operational manual.\r\n* Operational definitions: nodal equation, dimensions (frequency, phase, form), and structural operators.\r\n\r\n> If you use `tnfr` in research or projects, please cite the TNFR conceptual framework and link to the PyPI package.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "modular structural-based dynamics on networks",
"version": "4.5.1",
"project_urls": {
"Homepage": "https://pypi.org/project/tnfr/",
"Repository": "https://github.com/fermga/Teoria-de-la-naturaleza-fractal-resonante-TNFR-"
},
"split_keywords": [
"tnfr",
" resonant fractal",
" resonance",
" glyphs",
" networkx",
" dynamics",
" coherence",
" epi",
" kuramoto"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9d5aee27c1fa0f0686d17a4b8480e42080118d078e695e65f48737520a629e3f",
"md5": "c1958b7f926ff0b7e12101b26d7173f4",
"sha256": "d315b2436698d38799200ab810e39f1c50c6bc904e5f69edbe9c595854c8a54a"
},
"downloads": -1,
"filename": "tnfr-4.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c1958b7f926ff0b7e12101b26d7173f4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 62436,
"upload_time": "2025-08-31T10:13:32",
"upload_time_iso_8601": "2025-08-31T10:13:32.241803Z",
"url": "https://files.pythonhosted.org/packages/9d/5a/ee27c1fa0f0686d17a4b8480e42080118d078e695e65f48737520a629e3f/tnfr-4.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d1747d2a9afaaccab088d19900287b2c9629457bacb72b0bb2ef726ed9e8aac5",
"md5": "0fa1e1333f6a9ddb03fe43c0443ac50a",
"sha256": "0ddb059913d72795f9f9eb085ad870a3ae98257231f51f62479ed9788ece9b2a"
},
"downloads": -1,
"filename": "tnfr-4.5.1.tar.gz",
"has_sig": false,
"md5_digest": "0fa1e1333f6a9ddb03fe43c0443ac50a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 61306,
"upload_time": "2025-08-31T10:13:33",
"upload_time_iso_8601": "2025-08-31T10:13:33.626848Z",
"url": "https://files.pythonhosted.org/packages/d1/74/7d2a9afaaccab088d19900287b2c9629457bacb72b0bb2ef726ed9e8aac5/tnfr-4.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-31 10:13:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "fermga",
"github_project": "Teoria-de-la-naturaleza-fractal-resonante-TNFR-",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tnfr"
}