Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

qiskit.aqua.operators.converters.DictToCircuitSum

class DictToCircuitSum(traverse=True, convert_dicts=True, convert_vectors=True)

GitHub

Converts DictStateFns or VectorStateFns to equivalent CircuitStateFns or sums thereof. The behavior of this class can be mostly replicated by calling to_circuit_op on an Operator, but with the added control of choosing whether to convert only DictStateFns or VectorStateFns, 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.

__init__

__init__(traverse=True, convert_dicts=True, convert_vectors=True)

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

__init__([traverse, convert_dicts, …])type traversebool
convert(operator)Convert the Operator to CircuitStateFns, recursively if traverse is True.

convert

convert(operator)

Convert the Operator to CircuitStateFns, recursively if traverse is True.

Parameters

operator (OperatorBase) – The Operator to convert

Return type

OperatorBase

Returns

The converted Operator.

Was this page helpful?
Report a bug or request content on GitHub.