
    g                     H   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 d Z
d Zd Z ed	e          Z e
d	ee          Z ed
e          Z e
d
ee          Zd Zd Zd Zd Z ede          Z ed	ee          Z ede          Z ed
ee          Zd Zd Zd Zd ZdS )z/Benchmarks for polynomials over Galois fields.     )gf_from_dictgf_factor_sqf)ZZ)pi)	nextprimec                 N    t          | |j        d|j        d|j        i||          S )N   r   )r   one)npKs      d/var/www/html/ai-engine/env/lib/python3.11/site-packages/sympy/polys/benchmarks/bench_galoispolys.pygathen_polyr   
   s'    AE1aeQ61===    c                     |j         g| dz   z  }t          d| dz             D ]}||dz
           dz  |j         z   |z  ||<   |S )Nr	      )r
   range)r   r   r   fis        r   
shoup_polyr      sW    	
1q5A1a!e__ ) )!a%!ae#q(!Hr   c                      |t          t          d| z  t          z                                                                S )Nr   )r   intr   evalf)r   r   s     r   genprimer      s6    1YsAqD2I,,..//00111r   
      c                  J    t          t          t          t          d           d S N
zassenhausmethodr   f_10p_10r    r   r   !timeit_gathen_poly_f10_zassenhausr&          $b666666r   c                  J    t          t          t          t          d           d S Nshoupr    r"   r%   r   r   timeit_gathen_poly_f10_shoupr+   #       $b111111r   c                  J    t          t          t          t          d           d S r   r   f_20p_20r   r%   r   r   !timeit_gathen_poly_f20_zassenhausr1   '   r'   r   c                  J    t          t          t          t          d           d S r)   r.   r%   r   r   timeit_gathen_poly_f20_shoupr3   +   r,   r         c                  J    t          t          t          t          d           d S r   r   F_10P_08r   r%   r   r    timeit_shoup_poly_F10_zassenhausr:   5   r'   r   c                  J    t          t          t          t          d           d S r)   r7   r%   r   r   timeit_shoup_poly_F10_shoupr<   9   r,   r   c                  J    t          t          t          t          d           d S r   r   F_20P_18r   r%   r   r    timeit_shoup_poly_F20_zassenhausrA   =   r'   r   c                  J    t          t          t          t          d           d S r)   r>   r%   r   r   timeit_shoup_poly_F20_shouprC   A   r,   r   N)__doc__sympy.polys.galoistoolsr   r   sympy.polys.domainsr   sympy.core.numbersr   sympy.ntheory.generater   r   r   r   r$   r#   r0   r/   r&   r+   r1   r3   r9   r8   r@   r?   r:   r<   rA   rC   r%   r   r   <module>rI      s   5 5 @ ? ? ? ? ? ? ? " " " " " " ! ! ! ! ! ! , , , , , ,> > >  2 2 2 xB{2tR  xB{2tR  7 7 72 2 27 7 72 2 2 x2z"dBxBz"dB7 7 72 2 27 7 72 2 2 2 2r   