OperatorStateFn.traverse¶
- OperatorStateFn.traverse(convert_fn, coeff=None)¶
Apply the convert_fn to the internal primitive if the primitive is an Operator (as in the case of
OperatorStateFn
). Otherwise do nothing. Used by converters.- Parameters
convert_fn (
Callable
) – The function to apply to the internal OperatorBase.coeff (
Union
[int
,float
,complex
,ParameterExpression
,None
]) – A coefficient to multiply by after applying convert_fn.
- Return type
- Returns
The converted StateFn.