qstack.c2mio¶
Converter from cell2mol Cell objects to PySCF Mole.
- qstack.c2mio.get_cell(fpath, workdir='.')[source]¶
Load a unit cell from a .cell or .cif file.
If a .cif file is provided, the function checks for a corresponding .cell file in the working directory. If it exists, it loads the .cell file; otherwise, it calls cell2mol to process the .cif file to generate the unit cell.
- Parameters:
fpath (str) – Path to the input file (.cell or .cif).
workdir (str) – Directory to read / write .cell file and logs if a .cif file is provided. Defaults to ‘.’.
- Returns:
Unit cell object.
- Return type:
cell2mol.unitcell
- Raises:
NotImplementedError – If the file extension is not .cell or .cif.
- qstack.c2mio.get_cell2mol_xyz(mol)[source]¶
Extract XYZ coordinates, charge, and spin from a cell2mol object.
- Parameters:
mol – cell2mol molecule or ligand object.
- Returns:
A tuple containing: - xyz (str): XYZ coordinate string. - charge (int): Total charge of the molecule. - spin (int): Number of unpaired electrons of the molecule (multiplicity - 1) for molecules and None for ligands.
- Return type:
tuple
- qstack.c2mio.get_ligand(cell, mol_idx=0, lig_idx=0, basis='minao', ecp=None)[source]¶
Convert a ligand in a cell2mol unit cell object to a pyscf Mole object.
- Parameters:
cell – cell2mol unit cell object.
mol_idx (int) – Index of the molecule in the cell. Defaults to 0.
lig_idx (int) – Index of the ligand in the molecule. Defaults to 0.
basis (str or dict) – Basis set. Defaults to ‘minao’.
ecp (str) – Effective core potential. Defaults to None.
- Returns:
pyscf Mole object for the ligand.
- Return type:
pyscf.gto.Mole
- qstack.c2mio.get_mol(cell, mol_idx=0, basis='minao', ecp=None)[source]¶
Convert a molecule in a cell2mol unit cell object to a pyscf Mole object.
- Parameters:
cell – cell2mol unit cell object.
mol_idx (int) – Index of the molecule in the cell. Defaults to 0.
basis (str or dict) – Basis set. Defaults to ‘minao’.
ecp (str) – Effective core potential. Defaults to None.
- Returns:
pyscf Mole object for the molecule.
- Return type:
pyscf.gto.Mole