diff --git a/src/sage/operads/associative_operad.py b/src/sage/operads/associative_operad.py index 99fbebc1563..09ec55ddc9b 100644 --- a/src/sage/operads/associative_operad.py +++ b/src/sage/operads/associative_operad.py @@ -166,8 +166,8 @@ def associative_product(self, x, y): sage: A.associative_product(x, y) B[word: abdc] """ - gen = self.basis()[self.basis().keys()([0, 1])] - return gen.compose(x, 0).compose(y, 1) + gen = self.basis()[self.basis().keys()(["0", "1"])] + return gen.compose(x, "0").compose(y, "1") def operad_generators(self): """ diff --git a/src/sage/operads/commutative_operad.py b/src/sage/operads/commutative_operad.py index 6827d1bb183..ecc4149d51e 100644 --- a/src/sage/operads/commutative_operad.py +++ b/src/sage/operads/commutative_operad.py @@ -213,8 +213,8 @@ def commutative_product(self, x, y): sage: A.commutative_product(x, y) B[word: abcd] """ - gen = self.basis()[self.basis().keys()([0, 1])] - return gen.compose(x, 0).compose(y, 1) + gen = self.basis()[self.basis().keys()(["0", "1"])] + return gen.compose(x, "0").compose(y, "1") def operad_generators(self): """ diff --git a/src/sage/operads/dendriform_operad.py b/src/sage/operads/dendriform_operad.py index 90b160e962a..bb142cd0783 100644 --- a/src/sage/operads/dendriform_operad.py +++ b/src/sage/operads/dendriform_operad.py @@ -236,8 +236,8 @@ def pre_Lie_product(self, x, y): -B[a[b[., .], c[d[., .], .]]] + B[a[c[d[., .], b[., .]], .]] + B[a[b[c[d[., .], .], .], .]] """ LT = self.basis().keys() - expr = self.monomial(LT([LT([], label=1), None], label=0)) - self.monomial(LT([None, LT([], label=1)], label=0)) - return expr.compose(x, 0).compose(y, 1) + expr = self.monomial(LT([LT([], label="1"), None], label="0")) - self.monomial(LT([None, LT([], label="1")], label="0")) + return expr.compose(x, "0").compose(y, "1") def associative_product(self, x, y): """ @@ -253,8 +253,8 @@ def associative_product(self, x, y): B[a[b[., .], c[d[., .], .]]] + B[c[a[b[., .], d[., .]], .]] + B[c[d[a[b[., .], .], .], .]] """ LT = self.basis().keys() - expr = self.monomial(LT([LT([], label=0), None], label=1)) + self.monomial(LT([None, LT([], label=1)], label=0)) - return expr.compose(x, 0).compose(y, 1) + expr = self.monomial(LT([LT([], label="0"), None], label="1")) + self.monomial(LT([None, LT([], label="1")], label="0")) + return expr.compose(x, "0").compose(y, "1") def chosen_product(self, x, y, name='assoc'): """ @@ -285,18 +285,18 @@ def chosen_product(self, x, y, name='assoc'): """ LT = self.basis().keys() if name == 'assoc': - expr = self.monomial(LT([LT([], label=0), None], label=1)) - expr += self.monomial(LT([None, LT([], label=1)], label=0)) + expr = self.monomial(LT([LT([], label="0"), None], label="1")) + expr += self.monomial(LT([None, LT([], label="1")], label="0")) elif name == 'prelie': - expr = self.monomial(LT([LT([], label=1), None], label=0)) - expr -= self.monomial(LT([None, LT([], label=1)], label=0)) + expr = self.monomial(LT([LT([], label="1"), None], label="0")) + expr -= self.monomial(LT([None, LT([], label="1")], label="0")) elif name == 'lie': - expr = self.monomial(LT([LT([], label=0), None], label=1)) - expr += self.monomial(LT([None, LT([], label=1)], label=0)) - expr -= self.monomial(LT([LT([], label=1), None], label=0)) - expr -= self.monomial(LT([None, LT([], label=0)], label=1)) + expr = self.monomial(LT([LT([], label="0"), None], label="1")) + expr += self.monomial(LT([None, LT([], label="1")], label="0")) + expr -= self.monomial(LT([LT([], label="1"), None], label="0")) + expr -= self.monomial(LT([None, LT([], label="0")], label="1")) elif name == 'left_dend': - expr = self.monomial(LT([LT([], label=0), None], label=1)) + expr = self.monomial(LT([LT([], label="0"), None], label="1")) elif name == 'right_dend': - expr = self.monomial(LT([None, LT([], label=1)], label=0)) - return expr.compose(x, 0).compose(y, 1) + expr = self.monomial(LT([None, LT([], label="1")], label="0")) + return expr.compose(x, "0").compose(y, "1") diff --git a/src/sage/operads/free_operad.py b/src/sage/operads/free_operad.py index 7af40833d34..615d4675abd 100644 --- a/src/sage/operads/free_operad.py +++ b/src/sage/operads/free_operad.py @@ -157,9 +157,9 @@ def magmatic_product(self, x, y): B[@[a[b[]], c[d[]]]] """ LT = self.basis().keys() - t = LT([LT([], label=0), LT([], label=1)], label='@') + t = LT([LT([], label="0"), LT([], label="1")], label='@') gen = self.monomial(t) - return gen.compose(x, 0).compose(y, 1) + return gen.compose(x, "0").compose(y, "1") def operad_morphism_on_basis(self, t, cod, fun=None): """