Beispiel #1
0
    def __mul__(self, div):
        '''
        Parameters
        ----------
        div : Div
        
        Returns
        -------
        Div
            The intersection product of "self" and 
            "div" wrt. to matrix "self.int_mat".
        '''

        row_vec = sage_vector(sage_ZZ, self.e_lst).row()
        col_vec = sage_vector(sage_ZZ, div.e_lst).column()
        mat = self.int_mat

        v = row_vec * mat * col_vec

        return v[0][0]
Beispiel #2
0
 def mat_mul(self, M):
     '''
     Parameters
     ----------
         M : sage_matrix
             A matrix with self.rank() columns.
     
     Returns
     -------
     Div
         Returns a "Div" object that is a result of 
         applying the linear transformation corresponding
         to "M" to itself. 
     '''
     v = sage_vector(self.e_lst).column()
     return Div((M * v).list())
Beispiel #3
0
 def __sub__(self, div):
     v = sage_vector(sage_ZZ, self.e_lst) - sage_vector(sage_ZZ, div.e_lst)
     return Div(list(v))
Beispiel #4
0
 def __add__(self, div):
     v = sage_vector(sage_ZZ, self.e_lst) + sage_vector(sage_ZZ, div.e_lst)
     return Div(list(v))
Beispiel #5
0
    def set_attributes(self, level=9):
        '''
        Sets attributes of this object, depending
        on the input level.
        For constructing a classification we instantiate
        many DPLattice objects. This method allows us 
        to minimize the number of attributes that computed
        (thus we use lazy evaluation).
        
        Parameter
        ---------
        self: DPLattice
            At least self.M, self.Md_lst and self.d_lst        
            should be initialized.
        
        level : int
            A non-negative number.
        '''

        # M, Md_lst and d_lst are set.

        if self.m1_lst == None:
            all_m1_lst = get_divs(get_ak(self.get_rank()), 1, -1, True)
            self.m1_lst = get_indecomp_divs(all_m1_lst, self.d_lst)

        if level < 1: return

        if self.fam_lst == None:
            all_fam_lst = get_divs(get_ak(self.get_rank()), 2, 0, True)
            self.fam_lst = get_indecomp_divs(all_fam_lst, self.d_lst)

        if level < 2: return

        if self.real_d_lst == None:
            self.real_d_lst = [d for d in self.d_lst if d.mat_mul(self.M) == d]

        if level < 3: return

        if self.real_m1_lst == None:
            self.real_m1_lst = [
                m1 for m1 in self.m1_lst if m1.mat_mul(self.M) == m1
            ]

        if level < 4: return

        if self.real_fam_lst == None:
            self.real_fam_lst = [
                f for f in self.fam_lst if f.mat_mul(self.M) == f
            ]

        if level < 5: return

        if self.or_lst == None:
            self.or_lst = []
            for m2 in get_divs(get_ak(self.get_rank()), 0, -2, True):
                if [m2 * d for d in self.d_lst] == len(self.d_lst) * [0]:
                    self.or_lst += [m2]

        if level < 6: return

        if self.sr_lst == None:
            V = sage_VectorSpace(sage_QQ, self.get_rank())
            W = V.subspace([d.e_lst for d in self.d_lst])
            self.sr_lst = []
            for m2 in get_divs(get_ak(self.get_rank()), 0, -2, True):
                if sage_vector(m2.e_lst) in W:
                    self.sr_lst += [m2]

        if level < 7: return

        if self.type == None:
            self.type = get_dynkin_type(self.d_lst)

        if level < 8: return

        if self.Mtype == None:
            self.Mtype = get_dynkin_type(self.Md_lst)

        if level < 9: return

        if self.G == None:
            self.G = get_ext_graph(self.d_lst + self.m1_lst, self.M)