hillclimber 0.1.0a1__tar.gz → 0.1.0a3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of hillclimber might be problematic. Click here for more details.
- hillclimber-0.1.0a3/.claude/settings.local.json +16 -0
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/.gitignore +1 -0
- hillclimber-0.1.0a3/AGENTS.md +32 -0
- hillclimber-0.1.0a3/CLAUDE.md +1 -0
- hillclimber-0.1.0a3/Getting_started.md +253 -0
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/PKG-INFO +59 -1
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/README.md +58 -0
- hillclimber-0.1.0a3/TODO.md +623 -0
- hillclimber-0.1.0a3/examples/01_distance_metad.py +199 -0
- hillclimber-0.1.0a3/examples/02_torsion_metad.py +186 -0
- hillclimber-0.1.0a3/examples/03_coordination_number.py +212 -0
- hillclimber-0.1.0a3/examples/04_2d_metad.py +210 -0
- hillclimber-0.1.0a3/examples/05_opes_sampling.py +189 -0
- hillclimber-0.1.0a3/examples/06_walls_restraints.py +255 -0
- hillclimber-0.1.0a3/examples/README.md +362 -0
- hillclimber-0.1.0a3/hillclimber/__init__.py +33 -0
- hillclimber-0.1.0a3/hillclimber/actions.py +56 -0
- hillclimber-0.1.0a3/hillclimber/analysis.py +636 -0
- hillclimber-0.1.0a3/hillclimber/biases.py +293 -0
- hillclimber-0.1.0a3/hillclimber/cvs.py +1053 -0
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/hillclimber/interfaces.py +45 -5
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/hillclimber/metadynamics.py +110 -34
- hillclimber-0.1.0a3/hillclimber/opes.py +357 -0
- hillclimber-0.1.0a3/hillclimber/selectors.py +221 -0
- hillclimber-0.1.0a3/hillclimber/virtual_atoms.py +335 -0
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/pyproject.toml +1 -1
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/tests/conftest.py +3 -3
- hillclimber-0.1.0a3/tests/test_biases.py +210 -0
- hillclimber-0.1.0a3/tests/test_cv_angle.py +242 -0
- hillclimber-0.1.0a3/tests/test_cv_coordination.py +244 -0
- hillclimber-0.1.0a3/tests/test_cv_distance.py +190 -0
- hillclimber-0.1.0a3/tests/test_cv_distance_new.py +253 -0
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/tests/test_cv_gyration.py +48 -4
- hillclimber-0.1.0a3/tests/test_cv_torsion.py +121 -0
- hillclimber-0.1.0a3/tests/test_metad.py +464 -0
- hillclimber-0.1.0a3/tests/test_opes.py +495 -0
- hillclimber-0.1.0a3/tests/test_selectors.py +163 -0
- hillclimber-0.1.0a3/tests/test_virtual_atoms.py +164 -0
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/uv.lock +1 -1
- hillclimber-0.1.0a1/.claude/settings.local.json +0 -10
- hillclimber-0.1.0a1/hillclimber/__init__.py +0 -18
- hillclimber-0.1.0a1/hillclimber/actions.py +0 -30
- hillclimber-0.1.0a1/hillclimber/cvs.py +0 -646
- hillclimber-0.1.0a1/hillclimber/selectors.py +0 -96
- hillclimber-0.1.0a1/tests/test_cv_coordination.py +0 -104
- hillclimber-0.1.0a1/tests/test_cv_distance.py +0 -181
- hillclimber-0.1.0a1/tests/test_cv_torsion.py +0 -38
- hillclimber-0.1.0a1/tests/test_metad.py +0 -131
- hillclimber-0.1.0a1/tests/test_selectors.py +0 -29
- hillclimber-0.1.0a1/tmp/cvs.ipynb +0 -275
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/.python-version +0 -0
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/LICENSE +0 -0
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/hillclimber/calc.py +0 -0
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/hillclimber/nodes.py +0 -0
- {hillclimber-0.1.0a1 → hillclimber-0.1.0a3}/main.py +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"mcp__context7__resolve-library-id",
|
|
5
|
+
"mcp__context7__get-library-docs",
|
|
6
|
+
"Bash(find:*)",
|
|
7
|
+
"Bash(uv run pytest:*)",
|
|
8
|
+
"WebFetch(domain:www.plumed.org)",
|
|
9
|
+
"WebSearch",
|
|
10
|
+
"Bash(uv run:*)",
|
|
11
|
+
"WebFetch(domain:www.plumed-nest.org)"
|
|
12
|
+
],
|
|
13
|
+
"deny": [],
|
|
14
|
+
"ask": []
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Hillclimber
|
|
2
|
+
A Python wrapper around PLUMED.
|
|
3
|
+
|
|
4
|
+
This package uses numpy style docstrings and type hinting.
|
|
5
|
+
Use `t.Literal[]` instead of plain strings for fixed options.
|
|
6
|
+
To run tests, use `uv run pytest tests/`.
|
|
7
|
+
There must be unit tests added for all new functionality!
|
|
8
|
+
The test should expect the full output like
|
|
9
|
+
```
|
|
10
|
+
expected = [
|
|
11
|
+
"d12_g1_0_com: COM ATOMS=1,2,3,4,5,6,7,8,9",
|
|
12
|
+
"d12_g2_0_com: COM ATOMS=19,20,21",
|
|
13
|
+
"d12: DISTANCE ATOMS=d12_g1_0_com,d12_g2_0_com",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
assert plumed_str == expected
|
|
17
|
+
```
|
|
18
|
+
and not just parts of it, e.g.
|
|
19
|
+
```
|
|
20
|
+
assert any("COM ATOMS=1,2,3,4,5,6,7,8,9" in cmd for cmd in plumed_str)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The goal of the package is to provide abstractions for collective variables and biases and to interface with ASE and ZnTrack.
|
|
24
|
+
|
|
25
|
+
The package uses ASE units, e.g. distances are in Angstrom, energies in eV and time in fs.
|
|
26
|
+
If available, reference the `https://www.plumed.org/doc-master/user-doc/html/` inside the docstrings to get more information about the underlying PLUMED functionality!
|
|
27
|
+
|
|
28
|
+
This is a new package, backwards compatibility is not required!
|
|
29
|
+
Make design decisions for good code structure and usability, not for backwards compatibility!
|
|
30
|
+
Use KISS, DRY, SOLID and YAGNI principles.
|
|
31
|
+
|
|
32
|
+
Ask before you create or plan summary documents!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
AGENTS.md
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# 🚀 HillClimber Quick Start Guide
|
|
2
|
+
|
|
3
|
+
Selectors pick atoms.
|
|
4
|
+
VirtualAtoms reduce groups (COM/COG).
|
|
5
|
+
CVs measure things (distance, coordination, etc.).
|
|
6
|
+
|
|
7
|
+
Three clean layers, one clear mental model. 🧠
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Selectors — "Pick What You Want"
|
|
12
|
+
|
|
13
|
+
Selectors identify groups of atoms in your system.
|
|
14
|
+
Every selector returns a list of groups, each a list of atom indices:
|
|
15
|
+
|
|
16
|
+
[[atoms_of_group_0], [atoms_of_group_1], ...]
|
|
17
|
+
|
|
18
|
+
**Example:**
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
ethanol_sel = hc.SMARTSSelector("CCO") # Matches 2 ethanols
|
|
22
|
+
water_sel = hc.SMARTSSelector("O") # Matches 3 waters
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### Indexing — Two Levels Deep
|
|
28
|
+
|
|
29
|
+
- **Level 1:** Pick which groups
|
|
30
|
+
- **Level 2:** Pick which atoms within those groups
|
|
31
|
+
|
|
32
|
+
| Syntax | Meaning |
|
|
33
|
+
|--------|---------|
|
|
34
|
+
| `sel` | All groups |
|
|
35
|
+
| `sel[0]` | First group |
|
|
36
|
+
| `sel[0:2]` | First two groups |
|
|
37
|
+
| `sel[[0, 2]]` | Groups 0 and 2 |
|
|
38
|
+
| `sel[:][0]` | First atom of each group |
|
|
39
|
+
| `sel[0][0]` | First atom of the first group |
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
# First oxygen of each water
|
|
43
|
+
oxygens = water_sel[:][0]
|
|
44
|
+
|
|
45
|
+
# First two waters only
|
|
46
|
+
first_two = water_sel[0:2]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
### Combining Selectors
|
|
52
|
+
|
|
53
|
+
Combine any selectors using `+`:
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
all_mols = water_sel + ethanol_sel
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
→ "Select all waters and ethanols."
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 2. VirtualAtoms — "Reduce to COM/COG"
|
|
64
|
+
|
|
65
|
+
A VirtualAtom creates virtual sites (e.g., centers of mass).
|
|
66
|
+
|
|
67
|
+
**Key concept:** One virtual site per group in the selector.
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
water_coms = hc.VirtualAtom(water_sel, "com") # 3 COMs
|
|
71
|
+
ethanol_coms = hc.VirtualAtom(ethanol_sel, "com") # 2 COMs
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Common Patterns
|
|
75
|
+
|
|
76
|
+
| Code | Meaning |
|
|
77
|
+
|------|---------|
|
|
78
|
+
| `VirtualAtom(sel, "com")` | COM of each group |
|
|
79
|
+
| `VirtualAtom(sel[0], "com")` | COM of the first group only |
|
|
80
|
+
| `VirtualAtom(va, "com")` | COM of COMs (nested) |
|
|
81
|
+
| `va1 + va2` | Combine multiple COM sets |
|
|
82
|
+
|
|
83
|
+
**Example:**
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
# COM for each water
|
|
87
|
+
water_coms = hc.VirtualAtom(water_sel, "com")
|
|
88
|
+
|
|
89
|
+
# COM for ethanol[0]
|
|
90
|
+
ethanol_0_com = hc.VirtualAtom(ethanol_sel[0], "com")
|
|
91
|
+
|
|
92
|
+
# Combine both
|
|
93
|
+
all_coms = ethanol_0_com + water_coms
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
💡 **Important:** Indexing happens at the selector, not the VirtualAtom.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 3. CVs — "Measure Things Between Groups or COMs"
|
|
101
|
+
|
|
102
|
+
CVs use Selectors or VirtualAtoms as inputs.
|
|
103
|
+
|
|
104
|
+
### DistanceCV
|
|
105
|
+
|
|
106
|
+
Measures distances between atom groups or virtual sites.
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
# Distance between ethanol[0] COM and water[0] COM
|
|
110
|
+
dist = hc.DistanceCV(
|
|
111
|
+
x1=hc.VirtualAtom(ethanol_sel[0], "com"),
|
|
112
|
+
x2=hc.VirtualAtom(water_sel[0], "com"),
|
|
113
|
+
prefix="d_com"
|
|
114
|
+
)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**One-to-Many / Many-to-Many:**
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
# Distance from one ethanol to each water
|
|
121
|
+
dist = hc.DistanceCV(
|
|
122
|
+
x1=hc.VirtualAtom(ethanol_sel[0], "com"),
|
|
123
|
+
x2=hc.VirtualAtom(water_sel, "com"),
|
|
124
|
+
)
|
|
125
|
+
# → Creates 3 CVs: d_0, d_1, d_2
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### CoordinationCV
|
|
131
|
+
|
|
132
|
+
Measures how "close" groups are — like solvation or clustering.
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
cn = hc.CoordinationCV(
|
|
136
|
+
x1=hc.VirtualAtom(water_sel, "com"),
|
|
137
|
+
x2=hc.VirtualAtom(water_sel, "com"),
|
|
138
|
+
r_0=5.0,
|
|
139
|
+
prefix="cn_water"
|
|
140
|
+
)
|
|
141
|
+
# → One CV: coordination among all water COMs
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### Flattening
|
|
147
|
+
|
|
148
|
+
Controls whether multi-atom groups are flattened or grouped in PLUMED:
|
|
149
|
+
|
|
150
|
+
| Option | Effect | PLUMED Output |
|
|
151
|
+
|--------|--------|---------------|
|
|
152
|
+
| `flatten=True` | Atoms merged into one list | `DISTANCE ATOMS=1,2,3,4` |
|
|
153
|
+
| `flatten=False` | Each group becomes a GROUP | `G1: GROUP ATOMS=...` |
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
dist = hc.DistanceCV(
|
|
157
|
+
x1=water_sel[0],
|
|
158
|
+
x2=ethanol_sel[0],
|
|
159
|
+
flatten=False
|
|
160
|
+
)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 4. Quick Visual Cheat Sheet
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
Selector → picks atoms or groups
|
|
169
|
+
e.g. water_sel[0:2]
|
|
170
|
+
|
|
171
|
+
VirtualAtom → reduces groups (COM/COG)
|
|
172
|
+
e.g. VirtualAtom(water_sel, "com")
|
|
173
|
+
|
|
174
|
+
CV → measures between selectors or virtual sites
|
|
175
|
+
e.g. DistanceCV(x1, x2)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 5. Common Real-World Examples
|
|
181
|
+
|
|
182
|
+
| Goal | Code | Output |
|
|
183
|
+
|------|------|--------|
|
|
184
|
+
| Distance between two specific atoms | `hc.DistanceCV(x1=sel1[0][0], x2=sel2[0][0])` | `DISTANCE ATOMS=1,2` |
|
|
185
|
+
| Distance between molecule COMs | `hc.DistanceCV(x1=hc.VirtualAtom(sel1[0],"com"), x2=hc.VirtualAtom(sel2[0],"com"))` | `COM ATOMS=...` |
|
|
186
|
+
| Distance from one COM to all COMs | `hc.DistanceCV(x1=va1[0], x2=va2)` | Multiple CVs |
|
|
187
|
+
| Coordination between all COMs | `hc.CoordinationCV(x1=va, x2=va, r_0=5.0)` | One CN CV |
|
|
188
|
+
| COM of COMs (e.g., cluster center) | `hc.VirtualAtom(hc.VirtualAtom(sel, "com"), "com")` | Single virtual site |
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 6. Mental Model
|
|
193
|
+
|
|
194
|
+
| You Think | You Write | PLUMED Thinks |
|
|
195
|
+
|-----------|-----------|---------------|
|
|
196
|
+
| "Select these atoms" | `selector` | atom indices |
|
|
197
|
+
| "Group them by molecule" | `selector[0:2]` | grouped atoms |
|
|
198
|
+
| "Compute their COM" | `VirtualAtom(selector, "com")` | `COM ATOMS=...` |
|
|
199
|
+
| "Measure a distance" | `DistanceCV(x1, x2)` | `DISTANCE ATOMS=...` |
|
|
200
|
+
| "Compute coordination" | `CoordinationCV(x1, x2)` | `COORDINATION GROUPA=...,GROUPB=...` |
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 7. Golden Rules
|
|
205
|
+
|
|
206
|
+
1. **Selectors select.**
|
|
207
|
+
- Always use selectors for picking atoms and groups.
|
|
208
|
+
2. **VirtualAtoms reduce.**
|
|
209
|
+
- Use them only for COM/COG — never for indexing.
|
|
210
|
+
3. **CVs measure.**
|
|
211
|
+
- They combine selectors or virtual sites to produce observables.
|
|
212
|
+
4. **Index at the selector level.**
|
|
213
|
+
- e.g., `VirtualAtom(sel[0], "com")`, not `VirtualAtom(sel, "com")[0]`.
|
|
214
|
+
5. **Combine with `+`.**
|
|
215
|
+
- `sel1 + sel2` or `va1 + va2` to merge sets.
|
|
216
|
+
6. **Flatten mindfully.**
|
|
217
|
+
- `flatten=True` → single atom list
|
|
218
|
+
- `flatten=False` → PLUMED GROUPs
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## 8. Typical PLUMED Translations
|
|
223
|
+
|
|
224
|
+
| Python Expression | PLUMED Output |
|
|
225
|
+
|-------------------|---------------|
|
|
226
|
+
| `hc.VirtualAtom(water_sel, "com")` | `water_0_com: COM ATOMS=...` |
|
|
227
|
+
| `hc.DistanceCV(x1=va1, x2=va2)` | `DISTANCE ATOMS=va1_0,va2_0` |
|
|
228
|
+
| `hc.CoordinationCV(x1=va, x2=va, r_0=5.0)` | `COORDINATION GROUPA=va_0,... GROUPB=va_0,... R_0=5.0` |
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 9. Summary of Best Practices
|
|
233
|
+
|
|
234
|
+
| Task | Recommended Approach |
|
|
235
|
+
|------|---------------------|
|
|
236
|
+
| Select atoms or molecules | SMARTSSelector, use indexing |
|
|
237
|
+
| Combine multiple groups | `sel1 + sel2` |
|
|
238
|
+
| Create COM/COG | `VirtualAtom(sel, "com" / "cog")` |
|
|
239
|
+
| Compute distances | `DistanceCV(x1, x2)` |
|
|
240
|
+
| Compute coordination numbers | `CoordinationCV(x1, x2)` |
|
|
241
|
+
| Preserve group structure | `flatten=False` |
|
|
242
|
+
| Build hierarchical centers | `VirtualAtom(VirtualAtom(sel, "com"), "com")` |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## TL;DR
|
|
247
|
+
|
|
248
|
+
Think modular:
|
|
249
|
+
- **Selectors** → choose what
|
|
250
|
+
- **VirtualAtoms** → define where
|
|
251
|
+
- **CVs** → measure how
|
|
252
|
+
|
|
253
|
+
No hidden behavior. No implicit COMs. Just clean, explicit, composable logic — fully PLUMED-compatible.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hillclimber
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a3
|
|
4
4
|
Summary: Python interfaces for the plumed library with enhanced sampling.
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Requires-Python: >=3.11
|
|
@@ -124,6 +124,64 @@ with project:
|
|
|
124
124
|
project.build()
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
+
## Units
|
|
128
|
+
|
|
129
|
+
hillclimber uses **ASE units** throughout the package:
|
|
130
|
+
|
|
131
|
+
- **Distances**: Ångström (Å)
|
|
132
|
+
- **Energies**: electronvolt (eV)
|
|
133
|
+
- **Time**: femtoseconds (fs)
|
|
134
|
+
- **Temperature**: Kelvin (K)
|
|
135
|
+
- **Mass**: atomic mass units (amu)
|
|
136
|
+
|
|
137
|
+
### Unit Conversion with PLUMED
|
|
138
|
+
|
|
139
|
+
PLUMED internally uses different units (nm, kJ/mol, ps). hillclimber automatically handles the conversion by adding a `UNITS` line to the PLUMED input:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
UNITS LENGTH=A TIME=0.001 ENERGY=96.48533288249877
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
This tells PLUMED to interpret all input parameters in ASE units:
|
|
146
|
+
- `LENGTH=A`: Distances are in Ångström
|
|
147
|
+
- `TIME=0.001`: Time values are in fs (1 fs = 0.001 ps)
|
|
148
|
+
- `ENERGY=96.485`: Energies are in eV (1 eV = 96.485 kJ/mol)
|
|
149
|
+
|
|
150
|
+
**All PLUMED parameters (HEIGHT, BARRIER, KAPPA, SIGMA, etc.) should be specified in ASE units (eV, Å, fs).** The UNITS line ensures PLUMED interprets them correctly.
|
|
151
|
+
|
|
152
|
+
### Example with Units
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
config = hc.MetaDynamicsConfig(
|
|
156
|
+
height=0.5, # eV - Gaussian hill height
|
|
157
|
+
pace=150, # MD steps - deposition frequency
|
|
158
|
+
biasfactor=10.0, # Dimensionless - well-tempered factor
|
|
159
|
+
temp=300.0 # Kelvin - system temperature
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
bias = hc.MetadBias(
|
|
163
|
+
cv=distance_cv,
|
|
164
|
+
sigma=0.1, # Å - Gaussian width for distance CV
|
|
165
|
+
grid_min=0.0, # Å - minimum grid value
|
|
166
|
+
grid_max=5.0, # Å - maximum grid value
|
|
167
|
+
grid_bin=100 # Number of bins
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
# Restraint example
|
|
171
|
+
restraint = hc.RestraintBias(
|
|
172
|
+
cv=distance_cv,
|
|
173
|
+
kappa=200.0, # eV/Ų - force constant
|
|
174
|
+
at=2.5 # Å - restraint center
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
metad_model = hc.MetaDynamicsModel(
|
|
178
|
+
config=config,
|
|
179
|
+
bias_cvs=[bias],
|
|
180
|
+
actions=[restraint],
|
|
181
|
+
timestep=0.5 # fs - MD timestep
|
|
182
|
+
)
|
|
183
|
+
```
|
|
184
|
+
|
|
127
185
|
## Collective Variables
|
|
128
186
|
|
|
129
187
|
hillclimber supports multiple types of collective variables:
|
|
@@ -112,6 +112,64 @@ with project:
|
|
|
112
112
|
project.build()
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
+
## Units
|
|
116
|
+
|
|
117
|
+
hillclimber uses **ASE units** throughout the package:
|
|
118
|
+
|
|
119
|
+
- **Distances**: Ångström (Å)
|
|
120
|
+
- **Energies**: electronvolt (eV)
|
|
121
|
+
- **Time**: femtoseconds (fs)
|
|
122
|
+
- **Temperature**: Kelvin (K)
|
|
123
|
+
- **Mass**: atomic mass units (amu)
|
|
124
|
+
|
|
125
|
+
### Unit Conversion with PLUMED
|
|
126
|
+
|
|
127
|
+
PLUMED internally uses different units (nm, kJ/mol, ps). hillclimber automatically handles the conversion by adding a `UNITS` line to the PLUMED input:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
UNITS LENGTH=A TIME=0.001 ENERGY=96.48533288249877
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
This tells PLUMED to interpret all input parameters in ASE units:
|
|
134
|
+
- `LENGTH=A`: Distances are in Ångström
|
|
135
|
+
- `TIME=0.001`: Time values are in fs (1 fs = 0.001 ps)
|
|
136
|
+
- `ENERGY=96.485`: Energies are in eV (1 eV = 96.485 kJ/mol)
|
|
137
|
+
|
|
138
|
+
**All PLUMED parameters (HEIGHT, BARRIER, KAPPA, SIGMA, etc.) should be specified in ASE units (eV, Å, fs).** The UNITS line ensures PLUMED interprets them correctly.
|
|
139
|
+
|
|
140
|
+
### Example with Units
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
config = hc.MetaDynamicsConfig(
|
|
144
|
+
height=0.5, # eV - Gaussian hill height
|
|
145
|
+
pace=150, # MD steps - deposition frequency
|
|
146
|
+
biasfactor=10.0, # Dimensionless - well-tempered factor
|
|
147
|
+
temp=300.0 # Kelvin - system temperature
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
bias = hc.MetadBias(
|
|
151
|
+
cv=distance_cv,
|
|
152
|
+
sigma=0.1, # Å - Gaussian width for distance CV
|
|
153
|
+
grid_min=0.0, # Å - minimum grid value
|
|
154
|
+
grid_max=5.0, # Å - maximum grid value
|
|
155
|
+
grid_bin=100 # Number of bins
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
# Restraint example
|
|
159
|
+
restraint = hc.RestraintBias(
|
|
160
|
+
cv=distance_cv,
|
|
161
|
+
kappa=200.0, # eV/Ų - force constant
|
|
162
|
+
at=2.5 # Å - restraint center
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
metad_model = hc.MetaDynamicsModel(
|
|
166
|
+
config=config,
|
|
167
|
+
bias_cvs=[bias],
|
|
168
|
+
actions=[restraint],
|
|
169
|
+
timestep=0.5 # fs - MD timestep
|
|
170
|
+
)
|
|
171
|
+
```
|
|
172
|
+
|
|
115
173
|
## Collective Variables
|
|
116
174
|
|
|
117
175
|
hillclimber supports multiple types of collective variables:
|