Ask Your Question
0

Unique Representation

asked 2012-10-22 17:00:23 -0600

SLOtoSF gravatar image

updated 2012-10-22 17:05:09 -0600

Please explain why the following output is as so. How is it possible for id's not to match but the names to be equal?

sage: SP = SetPartitions(5)
sage: a = SetPartitions(5).random_element()
sage: a
{{2, 3, 4, 5}, {1}}
sage: id(a)
190399916
sage: a in SetPartitions(5)
True
sage: a in SP
True
sage: print id(SP); print id(SetPartitions(5))
188090924
188091308
sage: SP == SetPartitions(5)
True
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
4

answered 2012-10-23 01:49:30 -0600

Hivert gravatar image

Currently in Sage, SetPartitions are not proper Parent and uses the old deprecated CombinatorialClass framework. This framework was writen before UniqueRepresentation. As a consequence

sage: isinstance(SetPartitions(5), UniqueRepresentation)

False

We are currently in the process of removing CombinatorialClass and cleaning the code depending of it. See for example trac ticket #13552, #12913, #9265. Nothing is currently done on set partitions.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-10-22 17:00:23 -0600

Seen: 56 times

Last updated: Oct 23 '12