Source code for iodata.inputs.gaussian
# IODATA is an input and output module for quantum chemistry.
# Copyright (C) 2011-2019 The IODATA Development Team
#
# This file is part of IODATA.
#
# IODATA is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# IODATA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>
# --
"""Gaussian Input Module."""
from collections.abc import Callable
from typing import TextIO
from ..docstrings import document_write_input
from ..iodata import IOData
from ..periodic import num2sym
from ..utils import angstrom
from .common import write_input_base
__all__ = ()
default_template = """\
#n {lot}/{obasis_name} {run_type}
{title}
{charge} {spinmult}
{geometry}
"""
[docs]
def default_atom_line(data: IOData, iatom: int):
"""Format atom line for Gaussian input."""
symbol = num2sym[data.atnums[iatom]]
atcoord = data.atcoords[iatom] / angstrom
return f"{symbol:3s} {atcoord[0]:10.6f} {atcoord[1]:10.6f} {atcoord[2]:10.6f}"