Python | SymPy Permutation.from_inversion_vector() method Last Updated : 27 Aug, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report Permutation.from_inversion_vector() : from_inversion_vector() is a sympy Python library function that returns the permutation from the inversion vector. Inversion Vector - The number of elements > ith element to the left of ith element in a permutation gives the ith element of the inversion vector. Syntax : sympy.combinatorics.permutations.Permutation.from_inversion_vector() Return : permutation from the inversion vector Code #1 : from_inversion_vector() Example Python3 1=1 # Python code explaining # SymPy.from_inversion_vector() # importing SymPy libraries from sympy.combinatorics.partitions import Partition from sympy.combinatorics.permutations import Permutation # Using from # sympy.combinatorics.permutations.Permutation.from_inversion_vector() method # creating vectors a = [1, 0, 0, 0] b = [6, 5, 4, 3, 0, 0 ] # inversion forms print ("vector a - from_inversion_vector form : ", Permutation.from_inversion_vector(a)) print ("vector b - from_inversion_vector form : ", Permutation.from_inversion_vector(b)) Output : vector a - from_inversion_vector form : Permutation([1, 0], size=5) vector b - from_inversion_vector form : Permutation([6, 5, 4, 3, 0, 1, 2]) Code #2 : from_inversion_vector() Example Python3 1=1 # Python code explaining # SymPy.from_inversion_vector() # importing SymPy libraries from sympy.combinatorics.partitions import Partition from sympy.combinatorics.permutations import Permutation # Using from # sympy.combinatorics.permutations.Permutation.from_inversion_vector() method # creating vector a = [2, 3, 1, 0] # inverted vector of a print ("vector a - from_inversion_vector form : ", Permutation.from_inversion_vector(a)) Output : vector a - from_inversion_vector form : Permutation([2, 4, 1, 0, 3]) Comment More infoAdvertise with us Next Article Python | SymPy Permutation.commutes_with() method N noobestars101 Follow Improve Article Tags : Python SymPy Practice Tags : python Similar Reads Python | SymPy Permutation.inversion_vector() Permutation.inversion_vector() : inversion_vector() is a sympy Python library function that returns the inversion_vector value of the permutation in argument. The inversion vector includes those elements whose value indicates the no. of elements in the permutation that are < it and lie on its rig 2 min read Python | SymPy Permutation.index() method Permutation.index() : index() is a sympy Python library function that returns the index value of the permutation in argument. Index of a permutation = Sum of all subscripts j such that permutation[j] is greater than permutation[j+1]. Syntax : sympy.combinatorics.permutations.Permutation.index() Retu 1 min read Python | SymPy Permutation.atoms() method Permutation.atoms() : atoms() is a sympy Python library function that returns all the elements that are present in the permutation. Syntax : sympy.combinatorics.permutations.Permutation.atoms() Return : elements of the argumented permutation. Code #1 : atoms() Example Python3 1=1 # Python code expla 1 min read Python | SymPy Permutation.commutes_with() method Permutation.commutes_with() : commutes_with() is a sympy Python library function that checks whether the two permutations are commuting. Suppose 'a' and 'b' are part of 'C', then the commutator of a and b is the 'C' identity if a and b commute, i.e. ab == ba. Syntax : sympy.combinatorics.permutation 2 min read SymPy | Permutation.inversions() in Python Permutation.inversions() : inversions() is a sympy Python library function that returns the number of inversions value of the permutation in the argument. The inversion vector includes those elements whose value indicates the no. of elements in the permutation that are < it and lie on its right-h 2 min read Python | SymPy Permutation.descents() method Permutation.descents() : descents() is a sympy Python library function that returns the position of descents in the permutation. Descents are the elements where a[i] > a[i+1] Syntax : sympy.combinatorics.permutations.Permutation.descents() Return : position of descents in the permutation Code #1 1 min read Like