def intcurve_series(vector_field, param, start_point, n=6, coord_sys=None, coeffs=False):
 if ((contravariant_order(vector_field) != 1) or covariant_order(vector_field)):
  raise ValueError('The supplied field was not a vector field.')
 def iter_vfield(scalar_field, i):
  'Return ``vector_field`` called `i` times on ``scalar_field``.'
  return reduce((lambda s, v: v.rcall(s)), ([vector_field] * i), scalar_field)
 def taylor_terms_per_coord(coord_function):
  'Return the series for one of the coordinates.'
  return [(((param ** i) * iter_vfield(coord_function, i).rcall(start_point)) / factorial(i)) for i in range(n)]
 coord_sys = (coord_sys if coord_sys else start_point._coord_sys)
 coord_functions = coord_sys.coord_functions()
 taylor_terms = [taylor_terms_per_coord(f) for f in coord_functions]
 if coeffs:
  return [Matrix(t) for t in zip(*taylor_terms)]
 else:
  return Matrix([sum(c) for c in taylor_terms])

def intcurve_series ( vector_field , param , start_point , n = 6 , coord_sys = None , coeffs = False ) : if ( ( contravariant_order ( vector_field ) != 1 ) or covariant_order ( vector_field ) ) : raise ValueError ( 'The supplied field was not a vector field.' ) def iter_vfield ( scalar_field , i ) : return reduce ( ( lambda s , v : v . rcall ( s ) ) , ( [ vector_field ] * i ) , scalar_field ) def taylor_terms_per_coord ( coord_function ) : return [ ( ( ( param ** i ) * iter_vfield ( coord_function , i ) . rcall ( start_point ) ) / factorial ( i ) ) for i in range ( n ) ] coord_sys = ( coord_sys if coord_sys else start_point . _coord_sys ) coord_functions = coord_sys . coord_functions ( ) taylor_terms = [ taylor_terms_per_coord ( f ) for f in coord_functions ] if coeffs : return [ Matrix ( t ) for t in zip ( * taylor_terms ) ] else : return Matrix ( [ sum ( c ) for c in taylor_terms ] )
return the series expansion for an integral curve of the field .