
    Ed                     f    d Z  G d de          Z G d de          Z G d de          Zg dZdS )	z,Special exception classes for numberfields. c                       e Zd ZdZdS )ClosureFailurea  
    Signals that a :py:class:`ModuleElement` which we tried to represent in a
    certain :py:class:`Module` cannot in fact be represented there.

    Examples
    ========

    >>> from sympy.polys import Poly, cyclotomic_poly, ZZ
    >>> from sympy.polys.matrices import DomainMatrix
    >>> from sympy.polys.numberfields.modules import PowerBasis, to_col, ClosureFailure
    >>> from sympy.testing.pytest import raises
    >>> T = Poly(cyclotomic_poly(5))
    >>> A = PowerBasis(T)
    >>> B = A.submodule_from_matrix(2 * DomainMatrix.eye(4, ZZ))

    Because we are in a cyclotomic field, the power basis ``A`` is an integral
    basis, and the submodule ``B`` is just the ideal $(2)$. Therefore ``B`` can
    represent an element having all even coefficients over the power basis:

    >>> a1 = A(to_col([2, 4, 6, 8]))
    >>> print(B.represent(a1))
    DomainMatrix([[1], [2], [3], [4]], (4, 1), ZZ)

    but ``B`` cannot represent an element with an odd coefficient:

    >>> a2 = A(to_col([1, 2, 2, 2]))
    >>> print(raises(ClosureFailure, lambda: B.represent(a2)))
    <ExceptionInfo ClosureFailure('Element in QQ-span but not ZZ-span of this basis.')>

    N__name__
__module____qualname____doc__     Clib/python3.11/site-packages/sympy/polys/numberfields/exceptions.pyr   r      s         < 	Dr
   r   c                       e Zd ZdZdS )StructureErrorz
    Represents cases in which an algebraic structure was expected to have a
    certain property, or be of a certain type, but was not.
    Nr   r	   r
   r   r   r   &   s          	Dr
   r   c                       e Zd ZdZdS )MissingUnityErrorz6Structure should contain a unity element but does not.Nr   r	   r
   r   r   r   .   s        AADr
   r   )r   r   r   N)r   	Exceptionr   r   r   __all__r	   r
   r   <module>r      s    2 2	 	 	 	 	Y 	 	 	D	 	 	 	 	Y 	 	 		 	 	 	 	 	 	 	
  r
   