Skip to content

Add: TENCoM vibrational entropy differential standalone tool#46

Open
lmorency wants to merge 2 commits intoclaude/write-implementation-MglRZfrom
claude/tencom-entropy-differential-IUd2K
Open

Add: TENCoM vibrational entropy differential standalone tool#46
lmorency wants to merge 2 commits intoclaude/write-implementation-MglRZfrom
claude/tencom-entropy-differential-IUd2K

Conversation

@lmorency
Copy link
Owner

Standalone executable (tencom_entropy_diff) for computing vibrational
entropy differentials between a reference structure and multiple target
structures using the Torsional Elastic Network Contact Model (TENCoM).

Key changes:

  • Add TorsionalENM::build_from_ca() for standalone Cα-coordinate input
    without dependency on FlexAID atom/resid data structures
  • Add tencom_entropy_diff.cpp: standalone tool that parses PDB files,
    computes TENCoM normal modes, and outputs FlexibilityMode reports
    (ligand-free BindingMode analog for global flexibility analysis)
  • Outputs eigenvalue differentials, eigenvector overlaps, per-residue
    B-factor differentials, and vibrational entropy/free energy deltas
  • Full flexibility always ON by default
  • CMake option: -DENABLE_TENCOM_ENTROPY_DIFF=ON
  • 9 GoogleTest unit tests (all passing)

https://claude.ai/code/session_01PGgbrgbfdcHiSBMLd8GRWB

claude added 2 commits March 11, 2026 02:59
Standalone executable (tencom_entropy_diff) for computing vibrational
entropy differentials between a reference structure and multiple target
structures using the Torsional Elastic Network Contact Model (TENCoM).

Key changes:
- Add TorsionalENM::build_from_ca() for standalone Cα-coordinate input
  without dependency on FlexAID atom/resid data structures
- Add tencom_entropy_diff.cpp: standalone tool that parses PDB files,
  computes TENCoM normal modes, and outputs FlexibilityMode reports
  (ligand-free BindingMode analog for global flexibility analysis)
- Outputs eigenvalue differentials, eigenvector overlaps, per-residue
  B-factor differentials, and vibrational entropy/free energy deltas
- Full flexibility always ON by default
- CMake option: -DENABLE_TENCOM_ENTROPY_DIFF=ON
- 9 GoogleTest unit tests (all passing)

https://claude.ai/code/session_01PGgbrgbfdcHiSBMLd8GRWB
…tal)

Major performance acceleration of the Torsional Elastic Network Contact
Model across all hot paths:

CPU acceleration (tencm.cpp):
- Eigen SelfAdjointEigenSolver replaces hand-rolled Jacobi diagonalisation
  (divide-and-conquer vs O(M³) per-sweep Jacobi — order-of-magnitude speedup)
- Eigen Map<VectorXd> for sample() mode accumulation and strain energy (BLAS)
- OpenMP parallel contact discovery with thread-local vectors
- OpenMP parallel Hessian assembly with thread-local matrices + reduction
- OpenMP parallel B-factor computation (independent per residue)
- AVX-512 16-wide distance batching in contact discovery (with mask extract)
- AVX-512 8-wide double FMA accumulation in B-factor inner loop
- AVX2 8-wide distance batching via simd::distance2_1x8 fallback

GPU acceleration (new files):
- tencm_cuda.cu/cuh: CUDA kernels for contact discovery (one thread per
  pair, atomic compaction) and Hessian assembly (one block per contact,
  256 threads handle (k,l) pairs with atomicAdd)
- tencm_metal.mm/h: Metal compute shaders matching CUDA kernels, using
  CAS-loop atomic float add (Metal 2 compatible), embedded MSL source

Multi-structure parallelism (tencom_entropy_diff.cpp):
- OpenMP parallel for over target structures with mutex-guarded console I/O
- std::atomic counters for success/fail tracking

CMake integration:
- CUDA/Metal sources added to FlexAID main target and tencom_entropy_diff
- GPU_THRESHOLD = 256 residues (below that, CPU is faster due to PCIe cost)

All 9 TENCoM entropy diff tests + all 42 statmech tests pass.

https://claude.ai/code/session_01PGgbrgbfdcHiSBMLd8GRWB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants