Ask Your Question

GA3165's profile - activity

2024-04-12 09:04:00 +0200 received badge  Notable Question (source)
2024-04-12 09:04:00 +0200 received badge  Popular Question (source)
2023-09-05 19:30:04 +0200 received badge  Notable Question (source)
2023-09-05 19:30:04 +0200 received badge  Popular Question (source)
2023-07-24 23:46:08 +0200 received badge  Popular Question (source)
2023-01-05 05:51:17 +0200 received badge  Notable Question (source)
2022-07-23 09:51:23 +0200 received badge  Popular Question (source)
2021-05-18 07:32:16 +0200 received badge  Popular Question (source)
2021-04-12 06:39:43 +0200 commented answer Product of finite rings in sage

How to list out the zero-divisors of this ring? Thank you.

2021-04-12 06:28:02 +0200 marked best answer list of all prime powers -1

The primes () method gives the list of all primes. Similarly, I need a list (Say PP) that consists of all $p^k-1$ where $p$ is a prime and $k \ge 1$. How to create this infinite list?

Also, I want all possible finite products of elements of PP. Using this I want to understand when two such products are equal.

How to do this? Kindly share your thoughts. Thank you.

2021-04-12 06:27:50 +0200 commented answer list of all prime powers -1

@Max Alekseyev Thank you. How to list the elements less than 100 from PP?

2021-04-12 06:25:44 +0200 commented answer list of all prime powers -1

Thank you. But I want for arbitrary k :)

2021-04-10 03:53:12 +0200 edited question list of all prime powers -1

list of all prime powers -1 The primes () method gives the list of all primes. Similarly, I need a list (Say PP) that co

2021-04-10 03:53:11 +0200 edited question list of all prime powers -1

list of all prime powers -1 The primes () method gives the list of all primes. Similarly, I need a list (Say PP) that co

2021-04-10 03:40:31 +0200 edited question list of all prime powers -1

list of all prime powers -1 The primes () method gives the list of all primes. Similarly, I need a list that consists of

2021-04-10 03:40:02 +0200 asked a question list of all prime powers -1

list of all prime powers -1 The primes () method gives the list of all primes. Similarly, I need a list that consists of

2021-04-10 02:32:28 +0200 commented answer Product of finite rings in sage

Thank you :)

2021-04-10 02:32:14 +0200 marked best answer Product of finite rings in sage

How to implement the cartesian product of finite commutative rings with 1 with pointwise multiplication in sage?

As far as I know, it is not there yet. So please help me with this. Thank you.

2021-03-31 04:24:31 +0200 asked a question Product of finite rings in sage

Product of finite rings in sage How to implement the cartesian product of finite commutative rings with 1 with pointwise

2021-03-31 04:08:07 +0200 received badge  Scholar (source)
2021-03-30 16:22:32 +0200 commented answer construction of product rings Z/nZ x Z/mZ

Thanks for the code. Someone, please explain to me how to use this code to construct the product of rings in jupiter? Th

2020-10-10 13:04:59 +0200 received badge  Nice Question (source)
2020-10-09 07:57:33 +0200 commented question Refinement between Lists of lists

In the given link, they are checking whether a list is a sublist of another list or not. I am unable to see how it can be used here. Can you please explain it to me? Thank you.

2020-10-09 07:55:29 +0200 commented question Refinement between Lists of lists

@John Palmieri No. The order doesn't matter. In your previous comment if you meant [[0,1],[2]] is a refinement of [[1,0,2]] then it is a refinement. Thank you.

2020-10-09 05:46:28 +0200 received badge  Supporter (source)
2020-10-09 05:38:52 +0200 asked a question Refinement between Lists of lists

Consider the following lists of lists L1 = [[0,1,2],[1,2],[2,2]] and L2 = [[0,1],[2],[1,2],[1,2]]. We say that L2 is a refinement of L1. How to check whether a list of lists is a refinement of another list of lists in Sage.

In the case of set partitions, we have the option refinement. But I need to work with the multisets and its multi partitions. So I am using lists and there is no refinement option for lists of lists.

Kindly help me with how to implement this.

Thank you.

2020-10-09 02:49:00 +0200 commented question TypeError: unhashable type: 'list' in constructing poset

@slelievre I have added the full code. Kindly check. Thank you. I directly feed M = [[0], [1, 2], [1, 2], [2, 2]] but it is throwing the same error message.

2020-10-08 08:21:47 +0200 received badge  Editor (source)
2020-10-08 08:21:09 +0200 asked a question TypeError: unhashable type: 'list' in constructing poset

I have the following code to generate all multiset partitions of a given multiset (list).

k0 = 2
k1 = 1
k2 = 1
#k3 = 1
l = k0+k1+k2 #+k3 

L = [ ]
for i in range(k0) :
    L.append(0)
for i in range(k1) :
    L.append(1)
for i in range(k2) :
    L.append(2)
print L
#L = [0,1,2,3]
LL = list(range(len(L)))
print LL
P = SetPartitions(LL)
P = list(P)

J = []
for p in P :
    J.append([])
    aa = P.index(p)
    for i in p :
        J[aa].append(list(i))
#print J    


JJ =[]
for j in J :
    JJ.append([])
    bb = J.index(j)
    for i in j :
        JJ[bb].append([])
        aa = j.index(i)
        for k in i :
            #print aa
            JJ[bb][aa].append(L[k])
print JJ

The above code gives me the following output

[0, 0, 1, 2]
[0, 1, 2, 3]
[[[0, 0, 1, 2]], [[0], [0, 1, 2]], [[0, 1, 2], [0]], [[0, 0, 2], [1]], [[0, 0, 1], [2]], [[0, 0], [1, 2]], [[0, 1], [0, 2]], [[0, 2], [0, 1]], [[0], [0], [1, 2]], [[0], [0, 2], [1]], [[0], [0, 1], [2]], [[0, 2], [0], [1]], [[0, 1], [0], [2]], [[0, 0], [1], [2]], [[0], [0], [1], [2]]]

I have the following code to generate a poset out of JJ in which the order is given by the refinement.

sage: elms = JJ
sage: def fcn(A, B):
....:     if len(A) != len(B) + 1:
....:         return False
....:     for a in A:
....:         if not any(set(a).issubset(b) for b in B):
....:             return False
....:     return True
sage: Poset((elms, fcn), cover_relations=True)

I usually work with sets and my input JJ is usually a set partition and the program works well.

Now, I am working with multisets (like [0,1,1,2,2,2,2]) and multi partitions (like [[0],[1,2],[1,2],[2,2]). By a multi-partition, I mean a partition in which each part is a multiset and parts can be repeated in a partition. So basically it is a list of lists. We cannot implement this using sets. I have codes given above to generate all such partitions in sage using lists.

Now, the set of all multi partitions JJ (which is implements as a list) of a multiset (which is also implemented as a list) has to be fed as an input to the above code to generate the poset. But the above code throws the error

 ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-42-993ec557f50c> in <module>()
      7             return False
      8     return True
----> 9 Poset((elms, fcn), cover_relations=True)

/Applications/SageMath-8.1.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/combinat/posets/posets.pyc in Poset(data, element_labels, cover_relations, linear_extension, category, facade, key)
    674                         raise TypeError("not a list of relations")
    675             D = DiGraph()
--> 676             D.add_vertices(elements)
    677             D.add_edges(relations, loops=False)
    678         elif len(data) > 2:

/Applications/SageMath-8.1.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/graphs/generic_graph.pyc in add_vertices(self, vertices)
   9602 
   9603         """
-> 9604         return self._backend.add_vertices(vertices)
   9605 
   9606     def delete_vertex(self, vertex, in_order=False):

/Applications/SageMath-8.1.app/Contents/Resources/sage/src/sage/graphs/base/c_graph.pyx in sage.graphs.base.c_graph.CGraphBackend.add_vertices (build/cythonized/sage/graphs/base/c_graph.c:14020)()
   1504         for v in vertices:
   1505             if v is not None:
-> 1506                 self.add_vertex(v)
   1507             else:
   1508                 nones += 1

/Applications/SageMath-8.1.app/Contents/Resources/sage/src/sage/graphs/base/c_graph.pyx in sage.graphs.base.c_graph.CGraphBackend.add_vertex (build/cythonized/sage/graphs/base/c_graph.c:13856)()
   1454             retval = name
   1455 
-> 1456         self.check_labelled_vertex(name,
   1457                      (self._directed and
   1458                       self._cg_rev is not None)) # this will add the vertex

/Applications/SageMath-8.1.app/Contents/Resources/sage/src/sage/graphs/base/c_graph.pyx in sage.graphs.base.c_graph.CGraphBackend.check_labelled_vertex (build/cythonized/sage/graphs/base/c_graph.c:12310)()
   1153         cdef CGraph G_rev = self._cg_rev
   1154 
-> 1155         cdef int u_int = self.get_vertex(u)
   1156         if u_int != -1:
   1157             if not bitset_in(G.active_vertices, u_int):

/Applications/SageMath-8.1.app/Contents/Resources/sage/src/sage/graphs/base/c_graph.pyx in sage.graphs.base.c_graph.CGraphBackend.get_vertex (build/cythonized/sage/graphs/base/c_graph.c:11902)()
   1120         cdef CGraph G = self._cg
   1121         cdef long u_long
-> 1122         if u in vertex_ints:
   1123             return vertex_ints[u]
   1124         try:

TypeError: unhashable type: 'list'

How to overcome this issue? Kindly help me with this. Thank you.

2020-10-08 05:23:09 +0200 commented question Multipartitions of a multiset in Sage

@rburing. Thank you. It works. Cute idea.

2020-10-07 20:38:04 +0200 received badge  Student (source)
2020-10-07 16:53:56 +0200 asked a question Multipartitions of a multiset in Sage

Let L = [0,1,1,2,2,2,2,]. I want to generate all the multi-partitions of L in which each part can have repeated entries and the parts themselves can repeat in the partition.

For example, [[0],[1,2],[1,2],[2,2]] is one such partition of L.

Kindly help me with this. Thank you.

2020-10-07 16:53:56 +0200 asked a question multipartitions of multisets in sage

Let L be equal to the list [0,1,1,2,2,2,2]. I want to generate all the multiset partitions of L in which each part is a multiset (or a list with repeated entries) and parts are allowed to repeat. For example, [[0],[1,2],[1,2],[2,2]] is one such multi partitions. Kindly help me with this. Thank you.