- return ip.parent()(ip.sqrt())
-
- v = list(v) # make a copy, don't clobber the input
-
- # Drop all zero vectors before we start.
- v = [ v_i for v_i in v if not v_i.is_zero() ]
-
- if len(v) == 0:
- # cool
- return v
-
- # Our "zero" needs to belong to the right space for sum() to work.
- zero = v[0].parent().zero()