
    sg                        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y)z/Benchmarks for polynomials over Galois fields.     )gf_from_dictgf_factor_sqf)ZZ)pi)	nextprimec                 d    t        | |j                  d|j                  d|j                  i||      S )N   r   )r   one)npKs      [/var/www/html/venv/lib/python3.12/site-packages/sympy/polys/benchmarks/bench_galoispolys.pygathen_polyr   
   s*    AEE1aeeQ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%!aee#q(!)Hr   c                 f     |t        t        d| z  t        z  j                                           S )Nr   )r   intr   evalf)r   r   s     r   genprimer      s(    YsAqD2I,,./011r   
      c                  :    t        t        t        t        d       y N
zassenhausmethodr   f_10p_10r    r   r   !timeit_gathen_poly_f10_zassenhausr&          $b6r   c                  :    t        t        t        t        d       y Nshoupr    r"   r%   r   r   timeit_gathen_poly_f10_shoupr+   #       $b1r   c                  :    t        t        t        t        d       y r   r   f_20p_20r   r%   r   r   !timeit_gathen_poly_f20_zassenhausr1   '   r'   r   c                  :    t        t        t        t        d       y r)   r.   r%   r   r   timeit_gathen_poly_f20_shoupr3   +   r,   r         c                  :    t        t        t        t        d       y r   r   F_10P_08r   r%   r   r    timeit_shoup_poly_F10_zassenhausr:   5   r'   r   c                  :    t        t        t        t        d       y r)   r7   r%   r   r   timeit_shoup_poly_F10_shoupr<   9   r,   r   c                  :    t        t        t        t        d       y r   r   F_20P_18r   r%   r   r    timeit_shoup_poly_F20_zassenhausrA   =   r'   r   c                  :    t        t        t        t        d       y 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 @ " ! ,>2 B2tR B2tR 7272 2"dBB"dB7272r   