On 29 May 2018 at 12:01, chris wuthrich <christian.wuthr...@gmail.com>
wrote:

>
> As a simple-minded user I stumbled over exactly this last week. I don't
> understand much of what this thread is discussing, but I know what a
> simple-minded user wants.
>
> sage: G = GL(2,13)
> sage: G = G.as_matrix_group()
> sage: H = G.subgroup([ matrix(GF(13),[[1,0],[1,1]]) ])
> sage: H2 = G.subgroup([ matrix(GF(13),[[1,1],[0,1]]) ])
> sage: H3 = G.subgroup([ matrix(GF(13),[[1,0],[2,1]]) ])
>
> I expect H == H3 to say True as they are the same subgroup.
> I expect H = H2 to say False, since they are not the same subgroup, even
> though they are isomorphic.
> Instead
>
> sage: H == H3
> False
> sage: matrix(GF(13),[[1,0],[1,1]]) in H3
> True
> sage: matrix(GF(13),[[1,0],[2,1]]) in H
> True
> sage: H.is_isomorphic(H3)
> True
> sage: H.is_isomorphic(H2)
> True
> sage: matrix(GF(13),[[1,0],[1,1]]) in H2
> False
>
> I though of working around it by checking if they are the same as sets,
> but to my surprise:
>
> sage: Set( h for h in H ) == Set( h for h in H3 )
> False
> sage: Set( h.matrix() for h in H ) == Set( h.matrix() for h in H3 )
> True
>
> In short: I consider this a bug. No matter how this is done at the back,
> the user expects == to mean mathematical equality, here equality of
> subgroups. Otherwise the function should be called subgroups_with_given_
> generators.
>

This is not the only place in Sage where there is hidden structure which
equality testing uses.

sage: QuadraticField(2) == QuadraticField(8)
False

This looks wrong if you naively think that you are defining a subset of CC
or RR.  But number fields in Sage are all defined with a fixed generating
element, i.e. they are not just QQ-algebras but QQ[X]-algebras.

In the matrix subgroup case it is hard to see how H and the other subgroups
are intended to be viewed if not as subsets of G.  (By the way, your code
raises an error for me in the assignment to H I get

AttributeError:
'sage.matrix.matrix_modn_dense_float.Matrix_modn_dense_float' object has no
attribute 'gap'

)


>
>
> Chris
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to