Processing math: 100%
Ask Your Question
0

Unique Representation

asked 12 years ago

SLOtoSF gravatar image

updated 12 years ago

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
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
4

answered 12 years ago

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.

Preview: (hide)
link

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: 12 years ago

Seen: 343 times

Last updated: Oct 23 '12