qiskit.opflow.converters.CircuitSampler.convert¶
- CircuitSampler.convert(operator, params=None)[código fonte]¶
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.- Parâmetros
operator (OperatorBase) – The Operator to convert
params (Optional[Dict[Parameter, Union[float, List[float], List[List[float]]]]]) – A dictionary mapping parameters to either single binding values or lists of binding values.
- Retorno
The converted Operator with CircuitStateFns replaced by DictStateFns or VectorStateFns.
- Levanta
OpflowError – if extracted circuits are empty.
- Tipo de retorno