# Implement the conjugate of a set partition

Reported by: Owned by: zabrocki minor sage-9.3 combinatorics set partitions, conjugate saliola, aschilling Mike Zabrocki Anne Schilling, Frédéric Chapoton, Samuel Lelièvre N/A 7e6a9ec 7e6a9ec3abca9e4f924ed82a9ecca35fada37d35

### Description

Implement the notion of the conjugate of a set partition defined in "On Conjugates for Set Partitions and Integer Compositions" by David Callan for the combinatorial class `SetPartition`

### comment:1 Changed 22 months ago by zabrocki

• Branch set to public/combinat/conjugate-set-partition-30558
• Commit set to cc4efc2e7935195986b34784bca7cb069eced595
• Status changed from new to needs_review

New commits:

 ​cc4efc2 `initial version and reference`

### comment:2 Changed 22 months ago by aschilling

• Keywords set partitions conjugate added
• Reviewers set to Anne Schilling
• Status changed from needs_review to positive_review

### comment:3 Changed 22 months ago by chapoton

too late, but this is a bit ugly

```if len(initials)+len(singletons)==0:
```

and could have been

```if not initials and not singletons:
```

### comment:4 Changed 22 months ago by slelievre

It might be fine to reopen; otherwise fix it in a follow-up ticket.

Along with pep8 and maybe these other small things:

```-            return (support+[support[0]])[support.index(a)+1]
+            return support[(support.index(a)+1) % len(support)]
```
```-            support = sorted([a for S in sp for a in S])
+            support = sorted(a for S in sp for a in S)
```
```-        support = sorted([a for S in self for a in S])
+        support = sorted(a for S in self for a in S)
```

### comment:5 Changed 22 months ago by git

• Commit changed from cc4efc2e7935195986b34784bca7cb069eced595 to 6ce6f9eb614e7ba70b5d4ff8945c9f2c94fd6ca2
• Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

 ​6ce6f9e `changed as per comments`

### comment:6 Changed 22 months ago by git

• Commit changed from 6ce6f9eb614e7ba70b5d4ff8945c9f2c94fd6ca2 to 1cef639348be0ad6320365cf004145c5058e57a3

Branch pushed to git repo; I updated commit sha1. New commits:

 ​1cef639 `pep8 changes`

### comment:7 Changed 22 months ago by aschilling

Actually, this corner case also needs to be fixed:

```    sage: s = SetPartitions(0).list()[0]
sage: s.conjugate()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
```

### comment:8 Changed 22 months ago by git

• Commit changed from 1cef639348be0ad6320365cf004145c5058e57a3 to 5e86a5bfc7a31b4ce145577d0e730c27487bf654

Branch pushed to git repo; I updated commit sha1. New commits:

 ​5e86a5b `catch corner case`

### comment:9 Changed 22 months ago by aschilling

Add a doc test to the corner cases too!

### comment:10 Changed 22 months ago by git

• Commit changed from 5e86a5bfc7a31b4ce145577d0e730c27487bf654 to 7e6a9ec3abca9e4f924ed82a9ecca35fada37d35

Branch pushed to git repo; I updated commit sha1. New commits:

 ​7e6a9ec `add doc test for corner case`

### comment:11 Changed 22 months ago by slelievre

• Reviewers changed from Anne Schilling to Anne Schilling, Frédéric Chapoton, Samuel Lelièvre

Frédéric, any final formatting touch?

Then back to positive review?

### comment:12 Changed 22 months ago by aschilling

Yes, you can set it back to positive review!

### comment:13 Changed 22 months ago by chapoton

• Status changed from needs_review to positive_review

### comment:14 Changed 20 months ago by mkoeppe

• Milestone changed from sage-9.2 to sage-9.3

### comment:15 Changed 20 months ago by vbraun

• Branch changed from public/combinat/conjugate-set-partition-30558 to 7e6a9ec3abca9e4f924ed82a9ecca35fada37d35
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.