def __init__(self, parent, gen_left, gen_right): """Specify generators on the two sides of the tensor. Both are type D generators because the AA generator in between is assumed. """ # Note tuple initialization is automatic Generator.__init__(self, parent)
def __init__(self, parent, idem1, idem2): """Every generator has two idempotents. idem1 is the type D idempotent on the left. idem2 is the type A idempotent on the right. """ Generator.__init__(self, parent) self.idem1, self.idem2 = idem1, idem2
def __init__(self, parent, source, coeff, target): """Specifies the morphism source -> coeff * target. Note coeff has type TensorDGAlgebra of the two algebras that act on the DD structures. """ Generator.__init__(self, parent) MorObject.__init__(self, source, coeff, target)
def __init__(self, parent, source, coeff, target): """Specifies the morphism source -> coeff * target.""" Generator.__init__(self, parent) MorObject.__init__(self, source, coeff, target) filt = [] if hasattr(source, "filtration"): filt += [1-x for x in source.filtration] if hasattr(target, "filtration"): filt += target.filtration if filt != []: self.filtration = filt
def __init__(self, parent, strands): """Specifies the parent algebra (of type PreStrandAlgebra), and a list of strands. Each element of strands is a pair specifying the starting and ending points. """ Generator.__init__(self, parent) self.pmc = parent.pmc self.strands = tuple(sorted(strands)) self.left_pt_idem = tuple(sorted([s for s, t in self.strands])) self.right_pt_idem = tuple(sorted([t for s, t in self.strands])) self.left_idem = tuple(sorted([self.pmc.pairid[s] for s in self.left_pt_idem])) self.right_idem = tuple(sorted([self.pmc.pairid[s] for s in self.right_pt_idem]))
def __init__(self, parent, coeff_d, coeffs_a, source, target): """Specifies the morphism m(source, coeffs_a) -> coeff_d * target. source and target are generators in two type DA bimodules with same algebra actions. If the bimodules have left type D action by algebra1 and right type A action by algebra2, then as a MorObject coeff is of type TensorDGAlgebra(algebra1, CobarAlgebra(algebra2)). """ Generator.__init__(self, parent) self.coeff_d, self.coeffs_a = coeff_d, coeffs_a cobar_alg = CobarAlgebra(source.parent.algebra2) tensor_alg = TensorDGAlgebra((source.parent.algebra1, cobar_alg)) coeff = TensorGenerator( (coeff_d, TensorStarGenerator(coeffs_a, cobar_alg, source.idem2)), tensor_alg) MorObject.__init__(self, source, coeff, target)
def __init__(self, parent, left_idem, strands, right_idem = None): """Specifies PMC, left idempotent and right idempotent as list of pair ID's, and strands as a list of pairs (start, end). For example, in the split PMC of genus 2, the strand diagram with double horizontal at (1,3) and strand from 2 to 5 would be encoded as: left_idem = [1,2], right_idem = [1,3], strands = [(2,5)], since pair (1,3) has index 1, pair (2,4) has index 2, and pair (5,7) has index 3. """ Generator.__init__(self, parent) self.pmc = parent.pmc self.mult_one = parent.mult_one self.strands = strands if not isinstance(self.strands, Strands): self.strands = Strands(self.pmc, self.strands) # Calculate left idempotent if necessary if left_idem is None: assert right_idem is not None left_idem = self.strands.propagateLeft(right_idem) self.left_idem = left_idem if not isinstance(self.left_idem, Idempotent): self.left_idem = Idempotent(self.pmc, self.left_idem) # Calculate right idempotent if necessary if right_idem is None: right_idem = self.strands.propagateRight(self.left_idem) assert right_idem is not None, \ "Invalid init data for strand diagram: cannot propagate to right." self.right_idem = right_idem if not isinstance(self.right_idem, Idempotent): self.right_idem = Idempotent(self.pmc, self.right_idem) # Enumerate double horizontals self.double_hor = list(self.left_idem) for st in self.strands: self.double_hor.remove(self.pmc.pairid[st[0]]) self.double_hor = tuple(self.double_hor) # Get multiplicity from strands self.multiplicity = self.strands.multiplicity
def __init__(self, parent, left_idem, strands): """Specifies the parent algebra (which contains the local PMC), left idempotent, and strands. Input parameters: - parent: must be an object of LocalStrandAlgebra. - left_idem: tuple containing IDs of occupied pairs. - strands: tuple of pairs specifying strands. """ Generator.__init__(self, parent) self.local_pmc = parent.local_pmc self.left_idem = left_idem if not isinstance(self.left_idem, LocalIdempotent): self.left_idem = LocalIdempotent(self.local_pmc, self.left_idem) if not isinstance(strands, LocalStrands): strands = LocalStrands(self.local_pmc, strands) self.strands = strands # Get right_idem and multiplicity from strands self.right_idem = self.strands.propagateRight(self.left_idem) self.multiplicity = self.strands.multiplicity # Enumerate single and double horizontals self.all_hor = list(self.left_idem) for st in self.strands: start_idem = self.local_pmc.pairid[st[0]] if start_idem != -1: if start_idem not in self.all_hor: print left_idem, strands self.all_hor.remove(start_idem) self.all_hor = tuple(self.all_hor) self.single_hor = tuple([i for i in self.all_hor if len(self.local_pmc.pairs[i]) == 1]) self.double_hor = tuple([i for i in self.all_hor if len(self.local_pmc.pairs[i]) == 2])
def __init__(self, parent, idem1, idem2): ''' Every generator has two idempotents. idem1: left type D idempotent on the left. idem2: right type A idempotent on the right.''' # cb and check Generator.__init__(self, parent) self.idem1, self.idem2 = idem1, idem2
def __init__(self, parent, idem): """Every generator must have an idempotent.""" Generator.__init__(self, parent) self.idem = idem
def __init__(self, parent, gen_left, gen_right): ''' Specifies generators on the two sides of the tensor.''' # Both are type D generators? ( CB and reread) Generator.__init__(self, parent)
def __init__(self, parent, idem1, idem2): ''' Every generator has two idempotents. idem1: left type D idempotent on the left. idem2: right type A idempotent on the right.''' # cb and check Generator.__init__(self,parent) self.idem1, self.idem2 = idem1, idem2
def __init__(self, parent, idem1, idem2): """Every generator has two idempotents (for the two type D actions).""" Generator.__init__(self, parent) self.idem1, self.idem2 = idem1, idem2
def __init__(self, parent, idem): ''' Every generator must have an idempotent. ''' Generator.__init__(self, parent) self.idem = idem # ask akram # left idempotent CB and fill in
def __init__(self, parent, sd_left, sd_right): "Specifies the two strand diagrams." "" # Note tuple initialization is automatic Generator.__init__(self, parent)
def __init__(self, parent, gen_left, gen_right): ''' Specifies generators on the two sides of the tensor.''' # Both are type D generators? ( CB and reread) Generator.__init__(self, parent)