@@ -344,17 +344,25 @@ cdef class gr_ctx(flint_ctx):
344344 def gens(self ) -> list[gr]:
345345 """Return the top-level generators of the domain
346346
347- # >>> from flint.types._gr import gr_fmpzi_ctx , gr_gr_mpoly_ctx
348- # >>> ctx = gr_gr_mpoly_ctx.new(gr_fmpzi_ctx, [' x' , ' y' ])
349- # >>> ctx.gens()
350- # [x , y]
351- # >>> gr_fmpzi_ctx.gens()
352- # [I]
353- # >>> ctx.gens_recursive()
354- # [I , x , y]
347+ >>> from flint.types._gr import gr_fmpzi_ctx , gr_gr_mpoly_ctx
348+ >>> ctx = gr_gr_mpoly_ctx.new(gr_fmpzi_ctx, [' x' , ' y' ])
349+ >>> ctx.gens()
350+ [x , y]
351+ >>> gr_fmpzi_ctx.gens()
352+ [I]
355353 """
356354 return self._gens()
357355
356+ def gens_recursive(self ) -> list[gr]:
357+ """Return the generators of the domain and its coefficient domains.
358+
359+ >>> from flint.types._gr import gr_fmpzi_ctx , gr_gr_mpoly_ctx
360+ >>> ctx = gr_gr_mpoly_ctx.new(gr_fmpzi_ctx, [' x' , ' y' ])
361+ >>> ctx.gens_recursive()
362+ [I , x , y]
363+ """
364+ return self._gens_recursive()
365+
358366 def is_zero(self , x ) -> bool | None:
359367 """
360368 Returns whether x is equal to the ring element 0.
@@ -1096,21 +1104,21 @@ cdef class gr_fq_nmod_ctx(gr_scalar_ctx):
10961104 def new (p , d , name = None ) -> gr_fq_nmod_ctx:
10971105 """Create a new context for finite fields.
10981106
1099- # >>> from flint.types._gr import gr_fq_nmod_ctx
1100- # >>> F9 = gr_fq_nmod_ctx.new(3 , 2 )
1101- # >>> F9
1102- # gr_fq_nmod_ctx(3, 2)
1103- # >>> F9(2) + F9(3)
1104- # 2
1105- # >>> F9.characteristic()
1106- # 3
1107- # >>> F9.degree()
1108- # 2
1109- # >>> F9.gen()
1110- # a
1111- # >>> a = F9.gen()
1112- # >>> (1 + a ) ** 2 + a
1113- # a+2
1107+ >>> from flint.types._gr import gr_fq_nmod_ctx
1108+ >>> F9 = gr_fq_nmod_ctx.new(3 , 2 )
1109+ >>> F9
1110+ gr_fq_nmod_ctx(3, 2)
1111+ >>> F9(2) + F9(3)
1112+ 2
1113+ >>> F9.characteristic()
1114+ 3
1115+ >>> F9.degree()
1116+ 2
1117+ >>> F9.gen()
1118+ a
1119+ >>> a = F9.gen()
1120+ >>> (1 + a ) ** 2 + a
1121+ a+2
11141122 """
11151123 cdef bytes name_b
11161124 cdef char *name_c
@@ -1148,21 +1156,21 @@ cdef class gr_fq_zech_ctx(gr_scalar_ctx):
11481156 def new (p , d , name = None ) -> gr_fq_zech_ctx:
11491157 """Create a new context for finite fields with small characteristic.
11501158
1151- # >>> from flint.types._gr import gr_fq_zech_ctx
1152- # >>> F9 = gr_fq_zech_ctx.new(3 , 2 )
1153- # >>> F9
1154- # gr_fq_zech_ctx(3, 2)
1155- # >>> F9(2) + F9(3) # XXX: Is this correct?
1156- # a^4
1157- # >>> F9.characteristic()
1158- # 3
1159- # >>> F9.degree()
1160- # 2
1161- # >>> F9.gen()
1162- # a^1
1163- # >>> a = F9.gen()
1164- # >>> (1 + a ) ** 2 + a # doctest: + SKIP
1165- # a+2
1159+ >>> from flint.types._gr import gr_fq_zech_ctx
1160+ >>> F9 = gr_fq_zech_ctx.new(3 , 2 )
1161+ >>> F9
1162+ gr_fq_zech_ctx(3, 2)
1163+ >>> F9(2) + F9(3)
1164+ a^4
1165+ >>> F9.characteristic()
1166+ 3
1167+ >>> F9.degree()
1168+ 2
1169+ >>> F9.gen()
1170+ a^1
1171+ >>> a = F9.gen()
1172+ >>> (1 + a ) ** 2 + a
1173+ a^7
11661174 """
11671175 cdef bytes name_b
11681176 cdef char *name_c
0 commit comments