cirq_google.ops.internal_gate.function_points_to_proto
Return CustomArg that expresses a function through its x and y values.
cirq_google.ops.internal_gate.function_points_to_proto(
x: Union[Sequence[float], np.ndarray],
y: Union[Sequence[float], np.ndarray],
msg: Optional[cirq_google.api.v2.program_pb2.CustomArg
] = None
) -> cirq_google.api.v2.program_pb2.CustomArg
Args |
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.
|
Returns |
A CustomArg encoding the function.
|
Raises |
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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-15 UTC."],[],[]]