CircuitSampler.convert¶
- CircuitSampler.convert(operator, params=None)[source]¶
Converts the Operator to one in which the CircuitStateFns are replaced by DictStateFns or VectorStateFns. Extracts the CircuitStateFns out of the Operator, caches them, calls
sample_circuits
below to get their converted replacements, and replaces the CircuitStateFns in operator with the replacement StateFns.- Parameters
operator (
OperatorBase
) – The Operator to convertparams (
Optional
[Dict
[Union
[ParameterExpression
,ParameterVector
],Union
[float
,List
[float
],List
[List
[float
]]]]]) – A dictionary mapping parameters to either single binding values or lists of binding values. The dictionary can also contain pairs of ParameterVectors with lists of parameters or lists of lists of parameters to bind to them.
- Return type
- Returns
The converted Operator with CircuitStateFns replaced by DictStateFns or VectorStateFns.