Skip to content

Commit

Permalink
add pack docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PythonFZ committed Aug 16, 2024
1 parent 2b603aa commit 2d6886a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ print(atoms)
>>> Atoms(symbols='OH2', pbc=False)
```

## Packmol Interface
If you have [packmol](https://github.com/m3g/packmol) (at least `v20.15.0`) you can use the rdkit2ase interface.

```py
from rdkit2ase import pack, smiles2conformers

water = smiles2conformers("O", 2)
ethanol = smiles2conformers("CCO", 5)
density = 1000 # kg/m^3
box = pack([water, ethanol], [7, 5], density)
print(box)
>>> Atoms(symbols='C10H44O12', pbc=True, cell=[8.4, 8.4, 8.4])
```

### Limitations

- `rdkit2ase.ase2rdkit` won't be able to detect higher order bonds.
2 changes: 1 addition & 1 deletion rdkit2ase/utils/solvate.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def pack(
>>> water = smiles2conformers("O", 1)
>>> ethanol = smiles2conformers("CCO", 1)
>>> density = 1000 # kg/m^3
>>> packed_system = pack([water, ethanol], [10, 5], density)
>>> packed_system = pack([water, ethanol], [7, 5], density)
>>> print(packed_system)
Atoms(symbols='C10H44O12', pbc=True, cell=[8.4, 8.4, 8.4])
"""
Expand Down

0 comments on commit 2d6886a

Please sign in to comment.