def cosets(self): """decomposing group of a bilayer with respect to the pair stabilizer. Coset representatives generate pairs, symmetry equivalent to self. Returns list of cosets of the decomposition""" if self._cosets: return self._cosets self._cosets = core.cosets_mod(self.stab, self.bilayer.stab, 1) return self._cosets
def fragments(self, fragments): nr_frags = len(fragments) assert nr_frags >= 0 "The layer contains no fragments!"#fragments is non-empty if nr_frags == 1: item_fragments = [] basic_fragment = fragments[0] order_basic = len(basic_fragment.stab) order_self = len(self.stab) #basic checks that can be switched off #1a in __init__ assert order_self % order_basic == 0,\ "Order of Fragment.stab does not divide that of Layer.stab!" #1b ... assert all([item in self.stab for item in basic_fragment.stab]),\ "There are symops in Fragment.stab that are not in Layer.stab!" lcosets = core.cosets_mod(basic_fragment.stab, self.stab) for lcoset in lcosets: item_fragments.append(Fragment.leftmult(basic_fragment, lcoset[0])) self._fragments = item_fragments #basic checks to do after coset decomposition #1c assert all([core.coset_in_stab((coset, self.stab)) \ for coset in lcosets]),\ """Cosets of the consituent fragments do not belong to the stabilizer of the layer!""" #1d assert all([core.divides((coset, self.stab)) for coset in lcosets]),\ """Order of cosets of consituent fragments does not devides order of the layers's stabilizer""" else: self._fragments = fragments #basic checks that can be switched off coset_list = [fragment.coset for fragment in self._fragments] stab_list = [fragment.stab for fragment in self._fragments] #1e assert core.cosets_are_disjoint(coset_list), "Cosets are not disjoint!" #1f assert all([core.divides((stab, self.stab)) for stab in stab_list]),\ """Order of stabilizer of some constituent fragments does not devide order of the layers's stabilizer""" #1g assert all([core.coset_in_stab((stab, self.stab)) \ for stab in stab_list]),\ """Stabilizers of the consituent fragments