Exemple #1
0
 def __init__(self, index=-1, label='', thermo=None, conformer=None, 
              molecule=None, transportData=None, molecularWeight=None, 
              energyTransferModel=None, reactive=True, props=None, aug_inchi=None,
              symmetryNumber = -1, creationIteration = 0, explicitlyAllowed=False):
     self.index = index
     self.label = label
     self.thermo = thermo
     self.conformer = conformer
     self.molecule = molecule or []
     self.transportData = transportData
     self.reactive = reactive
     self.molecularWeight = molecularWeight
     self.energyTransferModel = energyTransferModel        
     self.props = props or {}
     self.aug_inchi = aug_inchi
     self.symmetryNumber = symmetryNumber
     self.isSolvent = False
     self.creationIteration = creationIteration
     self.explicitlyAllowed = explicitlyAllowed
     # Check multiplicity of each molecule is the same
     if molecule is not None and len(molecule)>1:
         mult = molecule[0].multiplicity
         for m in molecule[1:]:
             if mult != m.multiplicity:
                 raise SpeciesError('Multiplicities of molecules in species {species} do not match.'.format(species=label))
Exemple #2
0
    def __init__(self,
                 index=-1,
                 label='',
                 thermo=None,
                 conformer=None,
                 molecule=None,
                 transport_data=None,
                 molecular_weight=None,
                 energy_transfer_model=None,
                 reactive=True,
                 props=None,
                 smiles='',
                 inchi='',
                 aug_inchi=None,
                 symmetry_number=-1,
                 creation_iteration=0,
                 explicitly_allowed=False):
        self.index = index
        self.label = label
        self.thermo = thermo
        self.conformer = conformer
        self.molecule = molecule or []
        self.transport_data = transport_data
        self.reactive = reactive
        self.molecular_weight = molecular_weight
        self.energy_transfer_model = energy_transfer_model
        self.props = props or {}
        self.aug_inchi = aug_inchi
        self.symmetry_number = symmetry_number
        self.is_solvent = False
        self.creation_iteration = creation_iteration
        self.explicitly_allowed = explicitly_allowed
        self._fingerprint = None
        self._inchi = None
        self._smiles = None

        if inchi and smiles:
            logging.warning(
                'Both InChI and SMILES provided for Species instantiation, '
                'using InChI and ignoring SMILES.')
        if inchi:
            self.molecule = [Molecule(inchi=inchi)]
            self._inchi = inchi
        elif smiles:
            self.molecule = [Molecule(smiles=smiles)]
            self._smiles = smiles

        # Check multiplicity of each molecule is the same
        if molecule is not None and len(molecule) > 1:
            mult = molecule[0].multiplicity
            for m in molecule[1:]:
                if mult != m.multiplicity:
                    raise SpeciesError(
                        'Multiplicities of molecules in species {species} '
                        'do not match.'.format(species=label))
Exemple #3
0
    def __init__(self,
                 index=-1,
                 label='',
                 thermo=None,
                 conformer=None,
                 molecule=None,
                 transportData=None,
                 molecularWeight=None,
                 energyTransferModel=None,
                 reactive=True,
                 props=None,
                 SMILES='',
                 InChI='',
                 aug_inchi=None,
                 symmetryNumber=-1,
                 creationIteration=0,
                 explicitlyAllowed=False):
        self.index = index
        self.label = label
        self.thermo = thermo
        self.conformer = conformer
        self.molecule = molecule or []
        self.transportData = transportData
        self.reactive = reactive
        self.molecularWeight = molecularWeight
        self.energyTransferModel = energyTransferModel
        self.props = props or {}
        self.aug_inchi = aug_inchi
        self.symmetryNumber = symmetryNumber
        self.isSolvent = False
        self.creationIteration = creationIteration
        self.explicitlyAllowed = explicitlyAllowed
        self._fingerprint = None
        self._inchi = None
        self._smiles = None

        if InChI and SMILES:
            logging.warning(
                'Both InChI and SMILES provided for Species instantiation, using InChI and ignoring SMILES.'
            )
        if InChI:
            self.molecule = [Molecule(InChI=InChI)]
            self._inchi = InChI
        elif SMILES:
            self.molecule = [Molecule(SMILES=SMILES)]
            self._smiles = SMILES

        # Check multiplicity of each molecule is the same
        if molecule is not None and len(molecule) > 1:
            mult = molecule[0].multiplicity
            for m in molecule[1:]:
                if mult != m.multiplicity:
                    raise SpeciesError(
                        'Multiplicities of molecules in species {species} do not match.'
                        .format(species=label))
Exemple #4
0
 def getPartitionFunction(self, T):
     """
     Return the partition function for the transition state at the
     specified temperature `T` in K.
     """
     cython.declare(Q=cython.double)
     if self.conformer is not None and len(self.conformer.modes) > 0:
         Q = self.conformer.getPartitionFunction(T)
     else:
         raise SpeciesError('Unable to calculate partition function for transition state {0!r}: no statmech data available.'.format(self.label))
     return Q