File size: 7,082 Bytes
8cb220a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
05cc4e8
 
8cb220a
 
05cc4e8
 
 
 
 
 
 
 
 
 
 
 
 
8cb220a
 
8f0e979
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8cb220a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
---
license: apache-2.0
language: en
library_name: pytorch
tags:
  - protein-dynamics
  - molecular-dynamics
  - torsion-angles
  - phase-oscillators
  - neural-ode
  - ramachandran
  - ml-for-biology
  - reservoir-computing
pipeline_tag: feature-extraction
---

# AlphaDynamics

**Compact sequence-only neural propagator for protein torsion dynamics.**

> 2.39Γ— lower JSD than Microsoft Timewarp Β· 3000Γ— fewer parameters Β· 64 phase oscillators

[![PyPI](https://img.shields.io/pypi/v/alphadynamics.svg)](https://pypi.org/project/alphadynamics/)
[![GitHub](https://img.shields.io/badge/github-krisss0mecom%2FAlphaDynamics-blue?logo=github)](https://github.com/krisss0mecom/AlphaDynamics)
[![Try in browser](https://img.shields.io/badge/πŸ€—-Try_in_browser-yellow)](https://huggingface.co/spaces/krissss0/alphadynamics)
[![DOI](https://zenodo.org/badge/1211339504.svg)](https://doi.org/10.5281/zenodo.19788564)

A tiny (~123K parameter) neural propagator that, given only a protein sequence,
predicts an ensemble of torsion-angle (Ο†, ψ) trajectories matching the marginal
Ramachandran density of long-timescale molecular dynamics simulations.

On the canonical 4AA benchmark from `microsoft/timewarp` it produces densities
that are **2.39Γ— closer to ground-truth MD** than Microsoft Research's Timewarp
model (396M parameters), at roughly **3000Γ— fewer parameters**.

## Quickstart

### Try in your browser (no install)

πŸ‘‰ [**huggingface.co/spaces/krissss0/alphadynamics**](https://huggingface.co/spaces/krissss0/alphadynamics)

Type a peptide sequence, get an interactive Ramachandran plot in 30 seconds.

### Use locally

The simplest path β€” just type `alphadynamics` and answer the prompts:

```bash
pip install alphadynamics
alphadynamics
# Sequence (1-letter AA, e.g. AAAY): KLVFFAE
# How many independent trajectories? [16]: <Enter>
# How many timesteps per trajectory? [2500]: <Enter>
# Device (cuda/cpu/auto) [auto]: <Enter>
# Output file [...]: <Enter>
# Save Ramachandran plot? [b=both, p=PNG, h=HTML, n=no] [b]: <Enter>
```

Or as a one-liner for power users:

```bash
alphadynamics predict --sequence AAAY --n-ensemble 16 --rollout-steps 2500 --plot --plot-html -o traj.npz
```

### 3D backbone reconstruction (NEW in v0.4.0)

Convert torsion `.npz` to multi-model PDB you can open in PyMOL / VMD / ChimeraX:

```bash
alphadynamics predict --sequence KLVFFAE --output klvffae.npz
alphadynamics rebuild klvffae.npz -s KLVFFAE -o klvffae.pdb --diagnostics
pymol klvffae.pdb        # animate the trajectory
```

From Python:

```python
from alphadynamics import predict_torsion_ensemble, trajectory_to_pdb
traj = predict_torsion_ensemble("KLVFFAE", n_ensemble=4, rollout_steps=200)
trajectory_to_pdb(traj[0], "KLVFFAE", "klvffae.pdb")
```

Backbone heavy atoms only (N, CΞ±, C, O); deterministic NeRF reconstruction
(Parsons 2005) with Engh-Huber 1991 standard bond geometry. No ML, no training.

> ⚠️ Torsion errors accumulate along the chain; for long peptides
> (N > ~50) end-to-end displacement may be substantial. Use as
> diagnostic visualization, not high-resolution structure prediction.

### Or from Python (raw API):

```python
from alphadynamics import predict_torsion_ensemble

traj = predict_torsion_ensemble(
    "KLVFFAE",          # amyloid-Ξ² fragment
    n_ensemble=16,
    rollout_steps=2500,
    seed=42,
)
print(traj.shape)        # (16, 2500, 7, 2)  β€” ensemble Γ— time Γ— residues Γ— [Ο†,ψ]
```

## Headline result

Canonical Ramachandran Jensen-Shannon divergence (val-only ground truth, 36
bins, no smoothing) on the canonical 4AA test set, averaged over three peptides
AAAY, AACE, AAEW:

| Model                  | Params | Mean JSD | 4AA wins | Notes                              |
| ---------------------- | -----: | -------: | :------: | ---------------------------------- |
| Microsoft Timewarp     |  396 M |    0.468 |   0 / 3  | published baseline                 |
| **AlphaDynamics**      |  123 K |  **0.196** | **3 / 3** | **2.39Γ— lower**, **3000Γ— smaller** |

Cross-validated against Top8000 PDB statistics (Richardson Lab, Duke). Forbidden
Ξ±-L region: 0.7–1.0% β€” at the MolProbity error level (0.5%) for real
high-resolution PDB structures, meaning the model honors atomic steric exclusion.

## How it works

A residue's torsion state `(Ο†, ψ)` is treated as a phase pair on a torus.
Conditioned on the amino-acid identity, position, and current angles, an MLP
emits per-residue oscillator parameters: an intrinsic frequency, a coupling
matrix, and an anchor phase. A phase-flow ODE then integrates the joint state
of 64 coupled oscillators with classical RK4 over a fixed horizon `t_max=4.0`
(8 substeps). The integrated phase state is decoded into a mixture of
axis-independent von Mises distributions per residue, from which the next
torsion frame is sampled. Rolled out autoregressively, this defines a
transferable sequence-only propagator over the torsion torus.

The architecture is the protein-dynamics application of a multi-year line of
work in phase-oscillator computation: REZON hardware (80 physical PCB
oscillators), `phase-entanglement-rc` (formal phase computing), and
`phase-cnot-neuroscience` (theta-gamma coupling validated on rat and human
LFP recordings).

## Files

- `ad_transfer_v2_clean_best.pt` (310 KB) β€” the main propagator, ~78K params
- `ad_init_full_1477_best.pt` (181 KB) β€” von Mises mixture prior, ~45K params

## Honest caveats

- **Density only, not kinetics.** Captures *where* the peptide spends time on
  the Ramachandran torus, not *when* transitions happen.
- **Backbone only.** No side-chain rotamers, no Cartesian xyz, no docking.
- **Trained on 4–98 residues.** Reliability degrades outside this range.
- **Monomer only.** No multimer / aggregation modeling.

## Best for

- Quick conformational triage before launching expensive MD
- Comparing peptide sequence variants / mutants
- Estimating Ξ±/Ξ²/PPII basin populations
- Sanity-checking before large compute commitment
- AI-for-bio baselines and benchmarks
- Biochemistry / biophysics teaching with interactive Ramachandran plots

## Citation

```bibtex
@software{gwozdz2026alphadynamics,
  author  = {Gwozdz, Krzysztof},
  title   = {AlphaDynamics: Compact sequence-only neural propagator
             for protein torsion dynamics},
  year    = {2026},
  url     = {https://github.com/krisss0mecom/AlphaDynamics},
  license = {Apache-2.0},
  doi     = {10.5281/zenodo.19788564}
}
```

## Author

**Krzysztof Gwozdz** β€” independent researcher, Poland πŸ‡΅πŸ‡±
<krisss0gwo@gmail.com>

This is a free contribution to the protein-dynamics community.

## License

Apache 2.0. Free for any use including commercial.

## Links

- πŸ“¦ [PyPI](https://pypi.org/project/alphadynamics/) β€” `pip install alphadynamics`
- πŸ™ [GitHub](https://github.com/krisss0mecom/AlphaDynamics) β€” source code, issues, releases
- πŸ€— [Spaces demo](https://huggingface.co/spaces/krissss0/alphadynamics) β€” try in browser
- πŸ“š [Zenodo paper v2](https://doi.org/10.5281/zenodo.19877815) β€” per-system version (predecessor)