I am trying to convert a list to a set in sagemath 8.2
H = Set(range(1,n+1))
[1, 2, 3, 4]
L=Combinations(H,2).list()
[[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]]
Now, I would like to use SetPartitions but L is a list.
How can I convert this list to set?
The items of the list
Lare lists themselves. Being mutable, lists are not hashable, and therefore cannot be used as elements in a set, so we turn them into tuples first.