Coverage for cclib/bridge/cclib2psi4.py : 92%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# -*- coding: utf-8 -*-
2#
3# Copyright (c) 2019, the cclib development team
4#
5# This file is part of cclib (http://cclib.github.io) and is distributed under
6# the terms of the BSD 3-Clause License.
8"""Bridge for using cclib data in Psi4 (http://www.psicode.org/)."""
10from cclib.parser.utils import find_package
12_found_psi4 = find_package("psi4")
13if _found_psi4:
14 from psi4.core import Molecule
17def _check_psi4(found_psi4):
18 if not found_psi4:
19 raise ImportError("You must install `psi4` to use this function")
22def makepsi4(atomcoords, atomnos, charge=0, mult=1):
23 """Create a Psi4 Molecule."""
24 _check_psi4(_found_psi4)
25 return Molecule.from_arrays(
26 name="notitle",
27 elez=atomnos,
28 geom=atomcoords,
29 units="Angstrom",
30 molecular_charge=charge,
31 molecular_multiplicity=mult,
32 )
35del find_package