cirq.ParamResolver.value_of

ParamResolver.value_of(value: Union[cirq.TParamKey, float])cirq.TParamVal[source]

Attempt to resolve a parameter to its assigned value.

Floats are returned without modification. Strings are resolved via
the parameter dictionary with exact match only. Otherwise, strings
are considered to be sympy.Symbols with the name as the input string.
A sympy.Symbol is first checked for exact match in the parameter
dictionary. Otherwise, it is treated as a sympy.Basic.

A sympy.Basic is resolved using sympy substitution.

Note that passing a formula to this resolver can be slow due to the
underlying sympy library. For circuits relying on quick performance,
it is recommended that all formulas are flattened before-hand using
cirq.flatten or other means so that formula resolution is avoided.
If unable to resolve a sympy.Symbol, returns it unchanged.
If unable to resolve a name, returns a sympy.Symbol with that name.
Parameters

value – The parameter to try to resolve.

Returns

The value of the parameter as resolved by this resolver.