def differential(self, place): hom = Hom(self.sheaf_at(place), self.sheaf_at(place + 1)) if place not in self._diff: return hom.zero() return hom(self._diff[place], name="differential of {} at degree {}".format( self._name, place))
def _composition_free_module_morphism(psi, phi): """ Returns the composition of two compasable morphisms of free modules of finite rank over the same base ring. """ hom = Hom(phi.domain(), psi.codomain()) if phi.is_zero() or psi.is_zero(): return hom.zero() return hom(psi.matrix() * phi.matrix())
def _cover_relation_to_restriction(self, relation): """ Returns the restriction morphism associated to a cover relation of the domain poset of ``self``. """ hom = Hom(self.stalk(relation[0]), self.stalk(relation[1])) if self._res_dict[relation] == 0: return hom.zero() elif self._res_dict[relation] == 1: return hom(identity_matrix(self._stalk_dict[relation[0]])) else: return hom(self._res_dict[relation])
def component(self, point): h = Hom(self.domain().stalk(point), self.codomain().stalk(point)) if self._components[point] == 0: phi = h.zero() elif self._components[point] == 1: phi = h( identity_marix(self._base_ring, self.domain()._stalk_dict[point])) else: phi = h(self._components[point]) phi._name = "Component of {} at {}".format(self._name, point) return phi