DictToCircuitSum¶
- class DictToCircuitSum(traverse=True, convert_dicts=True, convert_vectors=True)[source]¶
Converts
DictStateFns
orVectorStateFns
to equivalentCircuitStateFns
or sums thereof. The behavior of this class can be mostly replicated by callingto_circuit_op
on an Operator, but with the added control of choosing whether to convert onlyDictStateFns
orVectorStateFns
, rather than both.- Parameters
traverse (
bool
) – Whether to recurse down into Operators with internal sub-operators for conversion.convert_dicts (
bool
) – Whether to convert VectorStateFn.convert_vectors (
bool
) – Whether to convert DictStateFns.
Methods
DictToCircuitSum.convert
(operator)Convert the Operator to
CircuitStateFns
, recursively iftraverse
is True.