SymPy | Partition.conjugate() in Python
Partition.conjugate() : conjugate() is a sympy Python library function that returns the conjugate partition of the argumented partition.
Syntax : sympy.combinatorics.partitions.Partition.conjugate()
Return : conjugate partition
Code #1 : conjugate() Example
# Python code explaining # SymPy.conjugate() # importing SymPy libraries from sympy.combinatorics.partitions import Partition from sympy.combinatorics.partitions import IntegerPartition # Using from sympy.combinatorics.partitions.Partition.conjugate() method p = IntegerPartition([312, 14, 23]) print ('Conjugate : ', p.conjugate) |
Output :
Conjugate : [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
Code #2 : conjugate() Example – showing ValueError.
# Python code explaining # SymPy.conjugate() # importing SymPy libraries from sympy.combinatorics.partitions import Partition from sympy.combinatorics.partitions import IntegerPartition # Using from sympy.combinatorics.partitions.Partition.conjugate() method # Only positive elements are required # so this will generate error p = IntegerPartition([312, 14, -10, 23, -1]) print ('Conjugate : ', p.conjugate) |
Output :
ValueError: The summands must all be positive.
Recommended Posts:
- Python | sympy.crt() method
- Python | sympy.Pow() method
- Python | sympy RGS method
- Python | sympy.Add() method
- Python | sympy.has() method
- Python | sympy.Mul() method
- Python | sympy.cos() method
- Python | sympy.sin() method
- Python | sympy.tan() method
- Python | sympy.Add() method
- SymPy | Prufer.next() in Python
- SymPy | Permutation.max() in Python
- Python | sympy.S.EulerGamma
- Python | sympy.S.GoldenRatio
- Python | sympy.cot() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



