예제 #1
0
    def __init__(self, s1, s2,l):
        
        f = ia_mat.init_atom_coef(s1, l)
        f.extract_coef()
        Coef_spin_1 = f.getter_spin_1()
        Coef_spin_2 = f.getter_spin_2()
        #Coef_spin_2 = f.getter_spin_1()


        ff = ol_mat.overlap_mat(s2, l)
        ff.extract_coef()
        S = ff.getter_overlap()
        S_value, S_vector = linalg.eigh(S)
        self.dimension = S_value.shape[0]
        S_eigen_invsqrt = zeros([self.dimension, self.dimension],float64)
        for i in range(self.dimension):
            S_eigen_invsqrt[i,i] = pow(S_value[i],-0.5)
        X_can = dot(S_vector, S_eigen_invsqrt)
        self.Canonical_1 = dot(dot(X_can.transpose(), S), Coef_spin_1)
        self.Canonical_2 = dot(dot(X_can.transpose(), S), Coef_spin_2)
        
        self.X = zeros([2*self.dimension, 2*self.dimension], float64)
        self.X[ :self.dimension, :self.dimension] = X_can
        self.X[self.dimension: , self.dimension:] = X_can
예제 #2
0
    def __init__(self, str1, str2, nbf):

        self.nbf = nbf
        p = ia_mat.init_atom_coef(str1, nbf)
        p.extract_coef()
        self.Coef_spin_1 = p.getter_spin_1()
        self.Coef_spin_2 = p.getter_spin_2()
        self.energy_1 = p.getter_energy_1()
        self.energy_2 = p.getter_energy_2()
        self.occupy_1 = p.getter_occupancy_1()
        self.occupy_2 = p.getter_occupancy_2()

        pp = ol_mat.overlap_mat(str2, nbf)
        pp.extract_coef()
        self.S = pp.getter_overlap()
        #print self.S.shape
        
        

        S_value, S_vector = linalg.eigh(self.S)
        self.dimension = S_value.shape[0]
        self.Coef = zeros([2*self.dimension, 2*self.dimension],float64)
        self.energy = zeros([2*self.dimension, 1],float64)
        self.occupy = zeros([2*self.dimension, 1],float64)
        self.Coef[ :self.dimension, :self.dimension] = self.Coef_spin_1
        self.Coef[self.dimension: , self.dimension:] = self.Coef_spin_2
        self.energy[ :self.dimension, 0] = self.energy_1
        self.energy[self.dimension: , 0] = self.energy_2
        self.occupy[ :self.dimension, 0] = self.occupy_1
        self.occupy[self.dimension: , 0] = self.occupy_2
        #print S_value

        
        S_eigen_invsqrt = zeros([self.dimension, self.dimension],float64)
        for i in range(self.dimension):
            S_eigen_invsqrt[i,i] = pow(S_value[i],-0.5)
        #print S_eigen_invsqrt
        
        self.X_sym = dot(dot(S_vector, S_eigen_invsqrt), S_vector.transpose())
        self.X_can = dot(S_vector, S_eigen_invsqrt)

        self.Lowdin_1 = dot(dot(self.X_sym.transpose(), self.S), self.Coef_spin_1)
        self.Lowdin_2 = dot(dot(self.X_sym.transpose(), self.S), self.Coef_spin_2)
        self.Lowdin = zeros([2*self.dimension, 2*self.dimension],float64)
        self.Lowdin[ :self.dimension, :self.dimension] = self.Lowdin_1
        self.Lowdin[self.dimension: , self.dimension:] = self.Lowdin_2

        
        self.Canonical_1 = dot(dot(self.X_can.transpose(), self.S), self.Coef_spin_1)
        self.Canonical_2 = dot(dot(self.X_can.transpose(), self.S), self.Coef_spin_2)
        self.Canonical = zeros([2*self.dimension, 2*self.dimension],float64)
        self.Canonical[ :self.dimension, :self.dimension] = self.Canonical_1
        self.Canonical[self.dimension: , self.dimension:] = self.Canonical_2
        
        #print self.Lowdin.shape, self.Canonical.shape
        self.X = zeros([2*self.dimension, 2*self.dimension], float64)
        self.X[ :self.dimension, :self.dimension] = self.X_can
        self.X[self.dimension: , self.dimension:] = self.X_can

        self.lap = zeros([2*self.dimension, 2*self.dimension], float64)
        self.lap[ :self.dimension, :self.dimension] = self.S
        self.lap[self.dimension: , self.dimension:] = self.S
예제 #3
0
    def __init__(self, str1, str2, nbf):

        self.nbf = nbf
        p = ia_mat.init_atom_coef(str1, nbf)
        p.extract_coef()
        self.Coef_spin_1 = p.getter_spin_1()
        self.Coef_spin_2 = p.getter_spin_2()
        self.energy_1 = p.getter_energy_1()
        self.energy_2 = p.getter_energy_2()
        self.occupy_1 = p.getter_occupancy_1()
        self.occupy_2 = p.getter_occupancy_2()

        pp = ol_mat.overlap_mat(str2, nbf)
        pp.extract_coef()
        self.S = pp.getter_overlap()
        #print self.S.shape

        S_value, S_vector = linalg.eigh(self.S)
        self.dimension = S_value.shape[0]
        self.Coef = zeros([2 * self.dimension, 2 * self.dimension], float64)
        self.energy = zeros([2 * self.dimension, 1], float64)
        self.occupy = zeros([2 * self.dimension, 1], float64)
        self.Coef[:self.dimension, :self.dimension] = self.Coef_spin_1
        self.Coef[self.dimension:, self.dimension:] = self.Coef_spin_2
        self.energy[:self.dimension, 0] = self.energy_1
        self.energy[self.dimension:, 0] = self.energy_2
        self.occupy[:self.dimension, 0] = self.occupy_1
        self.occupy[self.dimension:, 0] = self.occupy_2
        #print S_value

        S_eigen_invsqrt = zeros([self.dimension, self.dimension], float64)
        for i in range(self.dimension):
            S_eigen_invsqrt[i, i] = pow(S_value[i], -0.5)
        #print S_eigen_invsqrt

        self.X_sym = dot(dot(S_vector, S_eigen_invsqrt), S_vector.transpose())
        self.X_can = dot(S_vector, S_eigen_invsqrt)

        self.Lowdin_1 = dot(dot(self.X_sym.transpose(), self.S),
                            self.Coef_spin_1)
        self.Lowdin_2 = dot(dot(self.X_sym.transpose(), self.S),
                            self.Coef_spin_2)
        self.Lowdin = zeros([2 * self.dimension, 2 * self.dimension], float64)
        self.Lowdin[:self.dimension, :self.dimension] = self.Lowdin_1
        self.Lowdin[self.dimension:, self.dimension:] = self.Lowdin_2

        self.Canonical_1 = dot(dot(self.X_can.transpose(), self.S),
                               self.Coef_spin_1)
        self.Canonical_2 = dot(dot(self.X_can.transpose(), self.S),
                               self.Coef_spin_2)
        self.Canonical = zeros([2 * self.dimension, 2 * self.dimension],
                               float64)
        self.Canonical[:self.dimension, :self.dimension] = self.Canonical_1
        self.Canonical[self.dimension:, self.dimension:] = self.Canonical_2

        #print self.Lowdin.shape, self.Canonical.shape
        self.X = zeros([2 * self.dimension, 2 * self.dimension], float64)
        self.X[:self.dimension, :self.dimension] = self.X_can
        self.X[self.dimension:, self.dimension:] = self.X_can

        self.lap = zeros([2 * self.dimension, 2 * self.dimension], float64)
        self.lap[:self.dimension, :self.dimension] = self.S
        self.lap[self.dimension:, self.dimension:] = self.S