Open In App

SymPy | Permutation.support() in Python

Last Updated : 27 Aug, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
Permutation.support() : support() is a sympy Python library function that returns the elements in permutation, P, for which P[i] != i.
Syntax : sympy.combinatorics.permutations.Permutation.support() Return : elements in permutation, P, for which P[i] != i.
Code #1 : support() Example Python3 1=1
# Python code explaining
# SymPy.Permutation.support()

# importing SymPy libraries
from sympy.combinatorics.partitions import Partition
from sympy.combinatorics.permutations import Permutation

# Using from sympy.combinatorics.permutations.Permutation.support() method 

# creating Permutation
a = Permutation([[2, 0], [3, 1]])

b = Permutation([1, 3, 5, 4, 2, 0])


print ("Permutation a - support form : ", a.support())
print ("Permutation b - support form : ", b.support())
Output :
Permutation a - support form : [0, 1, 2, 3] Permutation b - support form : [0, 1, 2, 3, 4, 5]
Code #2 : support() Example Python3 1=1
# Python code explaining
# SymPy.Permutation.support()

# importing SymPy libraries
from sympy.combinatorics.partitions import Partition
from sympy.combinatorics.permutations import Permutation

# Using from 
# sympy.combinatorics.permutations.Permutation.support() method 

# creating Permutation
a = Permutation([[2, 4, 0], 
                 [3, 1, 2],
                 [1, 5, 6]])


print ("Permutation a - support form : ", a.support())
Output :
Permutation a - support form : [0, 1, 2, 3, 4, 5, 6]

Next Article
Article Tags :
Practice Tags :

Similar Reads