def testExpectedWithSharedExps_allShared(self, mockedNormFunct): mockedNormFunct.side_effect = lambda *args: 1 expSetA = tCode.ExponentSetCP2K(self.exponentsA, [self.coeffsA, self.coeffsA, self.coeffsA], [0,0,0], self.nValAll) #Merging all expOutput = tCode.BasisSetCP2K(self.eleName, self.basisNames, [expSetA]) testOrbSet = [self.testObjA, self.testObjA, self.testObjA] actOutput = tCode.getCP2KBasisFromPlatoOrbitalGauPolyBasisExpansion(testOrbSet, [0,0,0], self.eleName, basisNames=self.basisNames, shareExp=True) self.assertEqual(expOutput, actOutput)
def testExpectedWithSharedExps_reversedOrder(self, mockedNormFunct): mockedNormFunct.side_effect = lambda *args: 1 expSetA = tCode.ExponentSetCP2K(self.exponentsA, [x for x in reversed([self.coeffsA, self.coeffsB])], [x for x in reversed(self.angMomsA)], self.nValAll) expSetB = self._getIndividualExpSetC() expOutput = tCode.BasisSetCP2K(self.eleName, self.basisNames, [expSetB, expSetA]) actOutput = tCode.getCP2KBasisFromPlatoOrbitalGauPolyBasisExpansion( [x for x in reversed(self.testOrbsSetB)], [x for x in reversed(self.angMomsB)], self.eleName, basisNames=self.basisNames, shareExp=True) self.assertEqual(expOutput,actOutput)
def createTestObjs(self): angMomTemp = 0 self.gauObjA = parseGau.GauPolyBasis( self.exponentsA, [self.coeffsA] ) self.gauObjB = parseGau.GauPolyBasis( self.exponentsB, [self.coeffsB] ) self.cp2kExpSetA = tCode.getCP2KExponentSetFromGauPolyBasis(self.gauObjA, angMomTemp) self.cp2kExpSetB = tCode.getCP2KExponentSetFromGauPolyBasis(self.gauObjB, angMomTemp) expSetListA = [self.cp2kExpSetA, self.cp2kExpSetB] self.cp2kBasisSetA = tCode.BasisSetCP2K(self.eleName, self.basisNames, expSetListA)
def _createExpectedBasisSetB(): #Basic info element = "Mg" basisNames = ["fake-basis-a"] #The exponent sets exponentsA = [0.16410043, 0.19845384] coeffsA = [ [6.42183555,-7.80636538], [3.61896728,-3.70059388] ] lValsA = [0,1] nValA = 3 exponentSetA = tCode.ExponentSetCP2K(exponentsA, coeffsA, lValsA, nValA) exponentsB = [0.20037409, 0.38555230] coeffsB = [ [3.47476137, -15.08683172], [5.55019829, -59.20857370] ] lValsB = [0,1] nValB = 3 exponentSetB = tCode.ExponentSetCP2K(exponentsB, coeffsB, lValsB, nValB) return tCode.BasisSetCP2K(element, basisNames, [exponentSetA,exponentSetB])
def _createExpectedBasisSetA(): #Basic info element = "Mg" basisNames = ["spd-2z-rc7pt0-r05pt5-1"] #The exponent sets exponentsA = [0.18835110] coeffsA = [ [8.44145278], [4.38527172], [1.46989022] ] lValsA = [0,1,2] nValA = 3 exponentSetA = tCode.ExponentSetCP2K(exponentsA, coeffsA, lValsA, nValA) exponentsB = [0.25684646, 0.41223507] coeffsB = [ [6.29193240,-33.73264167], [10.71646800,-80.11784971], [4.67136283,-35.36689601] ] # coeffsB = [ [6.29193240, 10.71646800, 4.67136283], [-33.73264167, -80.11784971, -35.36689601] ] lValsB = [0,1,2] nValB = 3 exponentSetB = tCode.ExponentSetCP2K(exponentsB, coeffsB, lValsB, nValB) return tCode.BasisSetCP2K(element, basisNames, [exponentSetA,exponentSetB])
def createTestObjs(self): self.expExponentSetA = tCode.ExponentSetCP2K(self.expA, self.coeffsA, self.lValsA, self.nValA) self.expExponentSetB = tCode.ExponentSetCP2K(self.expB, self.coeffsB, self.lValsB, self.nValA) self.expExponentSets = [self.expExponentSetA, self.expExponentSetB] self.expBasisSetObj = tCode.BasisSetCP2K(self.eleName, self.basisName, self.expExponentSets)
def testExpectedWithoutSharedExps(self, mockedNormFunct): mockedNormFunct.side_effect = lambda *args: 1 expExpSetA, expExpSetB = self._getIndividualExpSetA(), self._getIndividualExpSetB() expOutput = tCode.BasisSetCP2K(self.eleName, self.basisNames, [expExpSetA, expExpSetB]) actOutput = tCode.getCP2KBasisFromPlatoOrbitalGauPolyBasisExpansion(self.testOrbsSetA, self.angMomsA, self.eleName, basisNames=self.basisNames, shareExp=False) self.assertEqual(expOutput, actOutput)
def createTestObjs(self): self.testObjA = tCode.BasisSetCP2K(self.elementA, self.basisNamesA, self.exponentSetsA)