spdkit是由谁开发的
时间: 2023-08-09 18:10:40 浏览: 28
SPDKIT是由中国科学院上海硅酸盐研究所的材料计算与设计团队开发的。该团队由张俊峰教授领导,研究方向包括材料计算、材料设计、表面化学等。SPDKIT是该团队在研究表面性质计算方法和工具时开发的一个工具包,旨在为科学家和工程师提供一个方便、易于使用和功能强大的表面性质计算工具。目前,SPDKIT已经成为了一个广泛使用的开源工具,得到了众多材料科学领域的研究人员的关注和使用。
相关问题
ModuleNotFoundError: No module named 'spdkit.geometry'
抱歉,这是我犯了一个错误。在 `spdkit` 库中,`geometry` 模块已经被移除了。因此,需要将代码中的 `spdkit.geometry` 替换为 `spdkit.utils`,并使用 `Box` 类来处理对称性和分子居中。下面是修改后的代码:
```
from spdkit import Molecule, analysis
from spdkit.utils import Box
import numpy as np
def create_supercell_bond_pattern(mol: Molecule, supercell_size=(3,3,3)):
# keep only C atoms
remove = []
for (i, a) in mol.atoms():
if a.symbol != "C":
remove.append(i)
mol.remove_atoms(remove)
# create a supercell
mol_supercell = mol.supercell(*supercell_size)
# create bonds using bond detector with kmeans clustering
bd = analysis.BondDetector(mol_supercell)
bd.detect_bonds()
# use Box to reduce the size of the cell
box = Box.from_molecule(mol_supercell)
mol_symm = box.wrap_molecule(mol_supercell)
# center the molecule in the cell
center = np.array([0.5, 0.5, 0.5])
mol_symm.translate(center - mol_symm.center_of_mass())
return mol_symm
m5 = Molecule.from_file("Fe32C9/05_1/POSCAR")
m5_new = create_supercell_bond_pattern(m5)
```
这里我修改了以下几点:
1. 使用 `spdkit.utils` 替换了 `spdkit.geometry`。
2. 使用 `Box` 类来处理对称性和分子居中。
3. 在创建键之前不需要删除铁原子。因为 `BondDetector` 会自动忽略非碳原子之间的键。
4. 保留了 `supercell_size` 参数。
修改RuntimeError: found difference in connectivity。import spdkit from spdkit import * m1 = Molecule.from_file("POSCAR1") m2 = Molecule.from_file("POSCAR2") dis = m1.disparity_between(m2) m1.rebond() m1.rebond() rmsd = m1.resemble_rigidly(m2) print(rmsd)
这个错误通常是由于分子之间的连接方式不一致导致的。在计算 RMSD 值之前,需要确保两个分子具有相同的连接方式。您可以尝试以下修改:
```python
import spdkit
from spdkit import *
# 读取分子文件
m1 = Molecule.from_file("POSCAR1")
m2 = Molecule.from_file("POSCAR2")
# 重新确定原子之间的连接方式
m1.rebond()
m2.rebond()
# 检查分子之间的差异性
dis = m1.disparity_between(m2)
if dis:
# 如果分子之间存在差异性,则修正分子的连接方式
m1.fix_bonds(m2.get_bonds())
# 计算 RMSD 值
rmsd = m1.resemble_rigidly(m2)
print(rmsd)
```
这里使用 `fix_bonds` 函数修正分子的连接方式,如果两个分子之间存在差异性,则将第一个分子的连接方式更新为第二个分子的连接方式。然后再计算 RMSD 值。
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![apk](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)