Sunday, July 26, 2026
HomeLanguagesSymPy | Polyhedron.pgroup() in Python

SymPy | Polyhedron.pgroup() in Python

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




# 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




# 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)])

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32520 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6903 POSTS0 COMMENTS
Nicole Veronica
12017 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12115 POSTS0 COMMENTS
Shaida Kate Naidoo
7023 POSTS0 COMMENTS
Ted Musemwa
7265 POSTS0 COMMENTS
Thapelo Manthata
6980 POSTS0 COMMENTS
Umr Jansen
6972 POSTS0 COMMENTS