def _vector_to_sdm_helper(v, order):
 from sympy.polys.distributedmodules import sdm_from_dict
 d = {}
 for (i, e) in enumerate(v):
  for (key, value) in e.to_dict().items():
   d[((i,) + key)] = value
 return sdm_from_dict(d, order)

def _vector_to_sdm_helper ( v , order ) : from sympy . polys . distributedmodules import sdm_from_dict d = { } for ( i , e ) in enumerate ( v ) : for ( key , value ) in e . to_dict ( ) . items ( ) : d [ ( ( i , ) + key ) ] = value return sdm_from_dict ( d , order )
helper method for common code in global and local poly rings .