"range(2)" is not suited for cartesian product. If you want to consider integer mod 2 you can use
cartesian_product([Zmod(2)] * 10) Vincent 2014-08-14 11:47 UTC, Jori Mantysalo <jori.mantys...@uta.fi>: > To get for example all bit vectors of size 3 one can say > > CartesianProduct(range(2), range(2), range(2)).list() > > To get this done for given n one can say at least > > a=CartesianProduct(range(2)).list() > for n in range(1,n): > a=[flatten(x) for x in CartesianProduct(a, range(2)).list()] > > Is there any direct (and quite possibly faster) way to accomplish this? > > -- > Jori Mäntysalo > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.