Psikit as a Electronic-Structure Informatics library

Now pen and I are planning to develop a library for a Electronic-Structure Informatics named Psikit (Psi4 + RDKit).

Which coding style do you like?

The repository is here.

psikit as a wrapper library?

import psikit
import numpy as np
from rdkit import Chem

psikit.core.set_output_file("out.dat", True)
psikit.set_memory('4 GB')

mol = Chem.MolFromSmiles("c1ccccc1")
benz = psikit.geometry(mol)
scf_e, scf_wfn ="B3LYP/cc-pVDZ", return_wfn=True)
HOMO = psikit.get_homo(scf_wfn)
LUMO = psikit.get_lumo(scf_wfn)
print(HOMO, LUMO, scf_e)

or psikit as a set of util functions library?

import psi4
from psikit import mol2xyz, get_homo, get_lumo
import numpy as np
from rdkit import Chem
psi4.core.set_output_file("out.dat", True)
mol = Chem.MolFromSmiles("c1ccccc1")
xyz, mol = mol2xyz(mol)
psi4.set_memory('4 GB')
benz = psi4.geometry(xyz)
scf_e, scf_wfn ="B3LYP/cc-pVDZ", return_wfn=True)
HOMO = get_homo(scf_wfn)
LUMO = get_lumo(scf_wfn)
print(HOMO, LUMO, scf_e)




  • SetBoolProp
  • SetDoubleProp
  • SetIntProp
  • SetProp
  • SetUnsignedProp

しか用意されていなくて、困ったなぁと途方にくれていたところ、 SetPropって文字列格納するからとりあえずシリアライズすればいけるんじゃないの ということでやってみた

>>> from rdkit import Chem
>>> import numpy as np
>>> import pickle
>>> mol = Chem.MolFromSmiles("CC")
>>> ar = np.array([[1,2,3],[4,5,6]])
>>> mol.SetProp("arraydata",pickle.dumps(ar))
>>> pickle.loads(mol.GetProp("arraydata"))
array([[1, 2, 3],
       [4, 5, 6]])