def __init__(self, domain, sub, quotient_matrix, lift_matrix, inner_product_matrix=None): """ Create this quotient space, from the given domain, sub-module, and quotient_matrix. EXAMPLES:: sage: A = QQ^5; V = A.span_of_basis([[1,0,-1,1,1], [1,-1,0,2/3,3/4]]); V Vector space of degree 5 and dimension 2 over Rational Field User basis matrix: [ 1 0 -1 1 1] [ 1 -1 0 2/3 3/4] sage: W = V.span_of_basis([V.0 - 2/3*V.1]); W Vector space of degree 5 and dimension 1 over Rational Field User basis matrix: [1/3 2/3 -1 5/9 1/2] This creates a quotient vector space, which calls the init method:: sage: Q = V / W #indirect doctest Behold the type of Q:: sage: type(Q) <class 'sage.modules.quotient_module.FreeModule_ambient_field_quotient_with_category'> We do some consistency checks on the extra quotient and lifting structure of Q:: sage: Q(V.0) (1) sage: Q( V.0 - 2/3*V.1 ) (0) sage: v = Q.lift(Q.0); v (1, 0, -1, 1, 1) sage: Q( v ) (1) """ base_field = domain.base_field() dimension = quotient_matrix.ncols() sparse = domain.is_sparse() self.__sub = sub self.__domain = domain self.__hash = hash((domain, sub)) FreeModule_ambient_field.__init__(self, base_field, dimension, sparse) self.__quo_map = domain.Hom(self)(quotient_matrix) self.__quo_map.register_as_coercion() self.__lift_map = self.Hom(domain)(lift_matrix)
def __init__(self, domain, sub, quotient_matrix, lift_matrix, inner_product_matrix = None): """ Create this quotient space, from the given domain, sub-module, and quotient_matrix. EXAMPLES:: sage: A = QQ^5; V = A.span_of_basis([[1,0,-1,1,1], [1,-1,0,2/3,3/4]]); V Vector space of degree 5 and dimension 2 over Rational Field User basis matrix: [ 1 0 -1 1 1] [ 1 -1 0 2/3 3/4] sage: W = V.span_of_basis([V.0 - 2/3*V.1]); W Vector space of degree 5 and dimension 1 over Rational Field User basis matrix: [1/3 2/3 -1 5/9 1/2] This creates a quotient vector space, which calls the init method:: sage: Q = V / W #indirect doctest Behold the type of Q:: sage: type(Q) <class 'sage.modules.quotient_module.FreeModule_ambient_field_quotient_with_category'> We do some consistency checks on the extra quotient and lifting structure of Q:: sage: Q(V.0) (1) sage: Q( V.0 - 2/3*V.1 ) (0) sage: v = Q.lift(Q.0); v (1, 0, -1, 1, 1) sage: Q( v ) (1) """ base_field = domain.base_field() dimension = quotient_matrix.ncols() sparse = domain.is_sparse() self.__sub = sub self.__domain = domain self.__hash = hash((domain, sub)) FreeModule_ambient_field.__init__(self, base_field, dimension, sparse) self.__quo_map = domain.Hom(self)(quotient_matrix) self.__quo_map.register_as_coercion() self.__lift_map = self.Hom(domain)(lift_matrix)