cirq_google.ops.internal_gate.function_points_to_proto

Return CustomArg that expresses a function through its x and y values.

x Sequence of values of the free variable. For 1D functions, this input is assumed to be given in increasing order.
y Sequence of values of the dependent variable. Where y[i] = func(x[i]) where func is the function being encoded.
msg Optional CustomArg to serialize to. If not provided a CustomArg is created.

A CustomArg encoding the function.

ValueError If

  • x is 1D and not sorted in increasing order.
  • x and y don't have the same number of points.
  • y is multidimensional.
  • x is multidimensional.