Topological Free-energy Gradient Theory toolkit for fluid-topology computation with NS++ topological forcing.
Project description
TFGT
TFGT (tfgt) is a Python package for fluid-topology computation based on the
Topological Free-energy Gradient Theory.
Core modeling identity:
f_top = -lambda * grad(F_top)
This equivalent topological force can be injected into an NS++ momentum model:
rho * Du/Dt = -grad(p) + div(tau) - lambda * grad(F_top)
Theory Snapshot
This package is initialized from the research note:
C:\Users\18858\Desktop\MD_2026-04-28_10-09-36_668.md
Canonical baseline parameters implemented here:
lambda0 = 4*pi*alphaE0 = 0.026 eV
Installation
pip install tfgt
From source:
pip install .
Quick Start
import numpy as np
from tfgt import TFGTParameters, topological_force, nspp_rhs, topological_activity_index
# Build a synthetic free-energy field F_top on a 2D grid.
x = np.linspace(-1.0, 1.0, 64)
y = np.linspace(-1.0, 1.0, 64)
xx, yy = np.meshgrid(x, y, indexing="ij")
F_top = np.exp(-6.0 * (xx**2 + yy**2))
params = TFGTParameters()
force = topological_force(F_top, lambda_top=params.lambda0, spacing=(x[1] - x[0], y[1] - y[0]))
rho = 1.0
pressure_gradient = np.zeros_like(force)
tau_divergence = np.zeros_like(force)
velocity = np.zeros_like(force)
dudt = nspp_rhs(
velocity=velocity,
rho=rho,
pressure_gradient=pressure_gradient,
tau_divergence=tau_divergence,
f_top=F_top,
lambda_top=params.lambda0,
spacing=(x[1] - x[0], y[1] - y[0]),
)
print("dudt shape:", dudt.shape)
print("TAI:", topological_activity_index(F_top, lambda_top=params.lambda0))
API
TFGTParameters: canonical parameter container (alpha,lambda0,E0)gradient_nd,laplacian_nd: finite-difference scalar field operatorstopological_force: equivalent topology force from free-energy fieldnspp_acceleration,nspp_rhs: NS++ helper termsvorticity_2d,helicity_density_3d,enstrophy_2d,topological_activity_index
Build and Publish
Install dev tooling:
pip install -e .[dev]
Run tests:
pytest -q
Build package:
python -m build
Validate artifacts:
python -m twine check dist/*
Upload:
python -m twine upload dist/*
Scientific Scope
tfgt currently provides a computational core and reference utilities for
fluid-topology workflows. It does not claim experimental validation by itself.
Use this library together with your own data, calibration, and falsifiability
protocols.
License
MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tfgt-0.1.0.tar.gz.
File metadata
- Download URL: tfgt-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b987f6f5bb476bedf4bcf078bce2a6039797861bb5fd51274442f0f7273add99
|
|
| MD5 |
2463e5bde33feb258cf931ae0fea9fea
|
|
| BLAKE2b-256 |
5b61fae8973d438ce259b9ca866eb8d77afe9e8258d3517b95e49ba661a8dd47
|
File details
Details for the file tfgt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tfgt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cd6e66c702bf1bb862bacfaa45f75269c22755ea5053e937be8b75f96830896
|
|
| MD5 |
d027696b02f38f505ba7edee08d0ed9f
|
|
| BLAKE2b-256 |
9b7aa0c5ca0f2a7fc9550be59615f372c14b9c4ec75de824b8852e1f1c189f54
|