

def rotate(self, perm):
    '\n        Apply a permutation to the polyhedron *in place*. The permutation\n        may be given as a Permutation instance or an integer indicating\n        which permutation from pgroup of the Polyhedron should be\n        applied.\n\n        This is an operation that is analogous to rotation about\n        an axis by a fixed increment.\n\n        Notes\n        =====\n\n        When a Permutation is applied, no check is done to see if that\n        is a valid permutation for the Polyhedron. For example, a cube\n        could be given a permutation which effectively swaps only 2\n        vertices. A valid permutation (that rotates the object in a\n        physical way) will be obtained if one only uses\n        permutations from the ``pgroup`` of the Polyhedron. On the other\n        hand, allowing arbitrary rotations (applications of permutations)\n        gives a way to follow named elements rather than indices since\n        Polyhedron allows vertices to be named while Permutation works\n        only with indices.\n\n        Examples\n        ========\n\n        >>> from sympy.combinatorics import Polyhedron, Permutation\n        >>> from sympy.combinatorics.polyhedron import cube\n        >>> cube.corners\n        (0, 1, 2, 3, 4, 5, 6, 7)\n        >>> cube.rotate(0)\n        >>> cube.corners\n        (1, 2, 3, 0, 5, 6, 7, 4)\n\n        A non-physical "rotation" that is not prohibited by this method:\n\n        >>> cube.reset()\n        >>> cube.rotate(Permutation([[1, 2]], size=8))\n        >>> cube.corners\n        (0, 2, 1, 3, 4, 5, 6, 7)\n\n        Polyhedron can be used to follow elements of set that are\n        identified by letters instead of integers:\n\n        >>> shadow = h5 = Polyhedron(list(\'abcde\'))\n        >>> p = Permutation([3, 0, 1, 2, 4])\n        >>> h5.rotate(p)\n        >>> h5.corners\n        (d, a, b, c, e)\n        >>> _ == shadow.corners\n        True\n        >>> copy = h5.copy()\n        >>> h5.rotate(p)\n        >>> h5.corners == copy.corners\n        False\n        '
    if (not isinstance(perm, Perm)):
        perm = self.pgroup[perm]
    elif (perm.size != self.size):
        raise ValueError('Polyhedron and Permutation sizes differ.')
    a = perm.array_form
    corners = [self.corners[a[i]] for i in range(len(self.corners))]
    self._corners = tuple(corners)

dataset/ETHPy150Open sympy/sympy/sympy/combinatorics/polyhedron.py Polyhedron.rotate/original