Ejemplo n.º 1
0
from pymuonsuite import constants

from pymuonsuite.io.readwrite import ReadWrite

_geom_opt_args = {'Driver_': 'ConjugateGradient', 'Driver_Masses_': '',
                  'Driver_Masses_Mass_': '', 'Driver_Masses_Mass_Atoms': '-1',
                  'Driver_Masses_Mass_MassPerAtom [amu]':
                  str(constants.m_mu_amu)}

_spinpol_args = {'Hamiltonian_SpinPolarisation_': 'Colinear',
                 'Hamiltonian_SpinPolarisation_UnpairedElectrons': 1,
                 'Hamiltonian_SpinPolarisation_InitialSpins_': '',
                 'Hamiltonian_SpinPolarisation_InitialSpins_Atoms': '-1',
                 'Hamiltonian_SpinPolarisation_InitialSpins_SpinPerAtom': 1}

customize_warnings()


class ReadWriteDFTB(ReadWrite):
    def __init__(self, params={}, script=None, calc=None):
        '''
        |   Args:
        |   params (dict):          Contains dftb_set, k_points_grid,
        |                           geom_force_tol and dftb_optionals.
        |                           geom_steps, max_scc_steps, and
        |                           charged are also required in the case
        |                           of writing geom_opt input files
        |   script (str):           Path to a file containing a submission
        |                           script to copy to the input folder. The
        |                           script can contain the argument
        |                           {seedname} in curly braces, and it will
Ejemplo n.º 2
0
import inspect
import warnings
import numpy as np
# 2-to-3 compatibility
try:
    import cPickle as pickle
except ImportError:
    import pickle
# More 2-to-3 compatibility, defining a wrapper function for inspect
# Internal imports
from ase import io as ase_io
from ase.build import niggli_reduce
from ase.calculators.singlepoint import SinglePointCalculator
from soprano import utils

utils.customize_warnings()


class _AllCaller(object):
    """_AllCaller class.

    A meta-object that serves the purpose of calling a function on all members
    of a list in a natural way.
    """
    def __init__(self, all_list, all_class=None):
        """Initialize the AllCaller with an 'all' list"""
        if all_class is None:
            self._class = all_list[0].__class__
        else:
            self._class = all_class
        if not all([x.__class__ is self._class for x in all_list]):