Permutation.full_cyclic_form() : full_cyclic_form() is a sympy Python library function that returns the permutation in cyclic form, by including the singletons.
Syntax :
sympy.combinatorics.permutations.Permutation.full_cyclic_form()Return :
permutation in cyclic form
Code #1 : full_cyclic_form() Example
# Python code explaining # SymPy.Permutation.full_cyclic_form() # importing SymPy libraries from sympy.combinatorics.partitions import Partition from sympy.combinatorics.permutations import Permutation # Using from sympy.combinatorics.permutations.Permutation.full_cyclic_form() method # creating Permutation a = Permutation([ 2 , 0 , 3 , 1 , 5 , 4 ]) b = Permutation([ 3 , 1 , 2 , 5 , 4 , 0 ]) print ( "Permutation a - full_cyclic_form form : " , a.full_cyclic_form) print ( "Permutation b - full_cyclic_form form : " , b.full_cyclic_form) |
Output :
Permutation a – full_cyclic_form form : [[0, 2, 3, 1], [4, 5]]
Permutation b – full_cyclic_form form : [[0, 3, 5], [1], [2], [4]]
Code #2 : full_cyclic_form() Example – 2D Permutation
# Python code explaining # SymPy.Permutation.full_cyclic_form() # importing SymPy libraries from sympy.combinatorics.partitions import Partition from sympy.combinatorics.permutations import Permutation # Using from # sympy.combinatorics.permutations.Permutation.full_cyclic_form() method # creating Permutation a = Permutation([[ 2 , 4 , 0 ], [ 3 , 1 , 2 ], [ 1 , 5 , 6 ]]) print ( "Permutation a - full_cyclic_form form : " , a.full_cyclic_form) |
Output :
Permutation a – full_cyclic_form form : [[0, 3, 5, 6, 1, 2, 4]]