Open In App

SymPy | Polyhedron.pgroup() in Python

Last Updated : 27 Aug, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
Polyhedron.pgroup() : pgroup() is a sympy Python library function that returns the permutations of the polyhedra.
Syntax : sympy.combinatorics.Polyhedrons.Polyhedron.pgroup() Return : permutations of the Polyhedron.
Code #1 : pgroup() Example - tetrahedron Python3 1=1
# Python code explaining
# SymPy.Polyhedron.pgroup()

# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.polyhedron import tetrahedron, octahedron

# Using from 
# sympy.combinatorics.polyhedron.Polyhedron.pgroup()

# Creating Polyhedron
a = tetrahedron.copy()

print ("Polyhedron - pgroup form : ", a.pgroup)

a.rotate(0)
print ("\nPolyhedron - pgroup form : ", a.pgroup)
Output :
Polyhedron - pgroup form : PermutationGroup([ (1 2 3), (3)(0 1 2), (0 3 2), (0 3 1), (0 1)(2 3), (0 2)(1 3), (0 3)(1 2)]) Polyhedron - pgroup form : PermutationGroup([ (1 2 3), (3)(0 1 2), (0 3 2), (0 3 1), (0 1)(2 3), (0 2)(1 3), (0 3)(1 2)])
Code #2 : pgroup() Example - octahedron Python3 1=1
# Python code explaining
# SymPy.Polyhedron.pgroup()

# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.polyhedron import tetrahedron, octahedron

# Using from 
# sympy.combinatorics.polyhedron.Polyhedron.pgroup()

# Creating Polyhedron
a = octahedron.copy()

print ("Polyhedron - pgroup form : ", a.pgroup)

a.rotate(0)
print ("\nPolyhedron - pgroup form : ", a.pgroup)
Output :
Polyhedron - pgroup form : PermutationGroup([ (5)(1 2 3 4), (0 4 5 2), (0 1 5 3), (0 1)(2 4)(3 5), (0 2)(1 3)(4 5), (0 3)(1 5)(2 4), (0 4)(1 3)(2 5), (0 5)(1 4)(2 3), (0 5)(1 2)(3 4), (0 4 1)(2 3 5), (0 1 2)(3 4 5), (0 2 3)(1 5 4), (0 4 3)(1 5 2)]) Polyhedron - pgroup form : PermutationGroup([ (5)(1 2 3 4), (0 4 5 2), (0 1 5 3), (0 1)(2 4)(3 5), (0 2)(1 3)(4 5), (0 3)(1 5)(2 4), (0 4)(1 3)(2 5), (0 5)(1 4)(2 3), (0 5)(1 2)(3 4), (0 4 1)(2 3 5), (0 1 2)(3 4 5), (0 2 3)(1 5 4), (0 4 3)(1 5 2)])

Next Article
Article Tags :
Practice Tags :

Similar Reads