class_docstr: A prime ideal in a ring of algebraic integers.
docstr: Represent this prime ideal as a :py:class:`~.Submodule`.
  
  Explanation
  ===========
  
  The :py:class:`~.PrimeIdeal` class serves to bundle information about
  a prime ideal, such as its inertia degree, ramification index, and
  two-generator representation, as well as to offer helpful methods like
  :py:meth:`~.PrimeIdeal.valuation` and
  :py:meth:`~.PrimeIdeal.test_factor`.
  
  However, in order to be added and multiplied by other ideals or
  rational numbers, it must first be converted into a
  :py:class:`~.Submodule`, which is a class that supports these
  operations.
  
  In many cases, the user need not perform this conversion deliberately,
  since it is automatically performed by the arithmetic operator methods
  :py:meth:`~.PrimeIdeal.__add__` and :py:meth:`~.PrimeIdeal.__mul__`.
  
  Raising a :py:class:`~.PrimeIdeal` to a non-negative integer power is
  also supported.
  
  Examples
  ========
  
  >>> from sympy import Poly, cyclotomic_poly, prime_decomp
  >>> T = Poly(cyclotomic_poly(7))
  >>> P0 = prime_decomp(7, T)[0]
  >>> print(P0**6 == 7*P0.ZK)
  True
  
  Note that, on both sides of the equation above, we had a
  :py:class:`~.Submodule`. In the next equation we recall that adding
  ideals yields their GCD. This time, we need a deliberate conversion
  to :py:class:`~.Submodule` on the right:
  
  >>> print(P0 + 7*P0.ZK == P0.as_submodule())
  True
  
  Returns
  =======
  
  :py:class:`~.Submodule`
      Will be equal to ``self.p * self.ZK + self.alpha * self.ZK``.
  
  See Also
  ========
  
  __add__
  __mul__
code: def as_submodule(self):
      r"""
      Represent this prime ideal as a :py:class:`~.Submodule`.
  
      Explanation
      ===========
  
      The :py:class:`~.PrimeIdeal` class serves to bundle information about
      a prime ideal, such as its inertia degree, ramification index, and
      two-generator representation, as well as to offer helpful methods like
      :py:meth:`~.PrimeIdeal.valuation` and
      :py:meth:`~.PrimeIdeal.test_factor`.
  
      However, in order to be added and multiplied by other ideals or
      rational numbers, it must first be converted into a
      :py:class:`~.Submodule`, which is a class that supports these
      operations.
  
      In many cases, the user need not perform this conversion deliberately,
      since it is automatically performed by the arithmetic operator methods
      :py:meth:`~.PrimeIdeal.__add__` and :py:meth:`~.PrimeIdeal.__mul__`.
  
      Raising a :py:class:`~.PrimeIdeal` to a non-negative integer power is
      also supported.
  
      Examples
      ========
  
      >>> from sympy import Poly, cyclotomic_poly, prime_decomp
      >>> T = Poly(cyclotomic_poly(7))
      >>> P0 = prime_decomp(7, T)[0]
      >>> print(P0**6 == 7*P0.ZK)
      True
  
      Note that, on both sides of the equation above, we had a
      :py:class:`~.Submodule`. In the next equation we recall that adding
      ideals yields their GCD. This time, we need a deliberate conversion
      to :py:class:`~.Submodule` on the right:
  
      >>> print(P0 + 7*P0.ZK == P0.as_submodule())
      True
  
      Returns
      =======
  
      :py:class:`~.Submodule`
          Will be equal to ``self.p * self.ZK + self.alpha * self.ZK``.
  
      See Also
      ========
  
      __add__
      __mul__
  
      """
      M = self.p * self.ZK + self.alpha * self.ZK
      # Pre-set expensive boolean properties whose value we already know:
      M._starts_with_unity = False
      M._is_sq_maxrank_HNF = True
      return M
  
imports: from sympy.polys.polytools import Poly
  from sympy.polys.domains.finitefield import FF
  from sympy.polys.domains.rationalfield import QQ
  from sympy.polys.domains.integerring import ZZ
  from sympy.polys.matrices.domainmatrix import DomainMatrix
  from sympy.polys.polyerrors import CoercionFailed
  from sympy.polys.polyutils import IntegerPowerable
  from sympy.utilities.decorator import public
  from .basis import round_two, nilradical_mod_p
  from .exceptions import StructureError
  from .modules import ModuleEndomorphism, find_min_poly
  from .utilities import coeff_search, supplement_a_subspace
label_desc: Use image node_id 6 for calling the PrimeIdeal obj's underlying member method code with example usage: obj.as_submodule() and returns: M