WeightedPauliOperator.from_list¶
- classmethod WeightedPauliOperator.from_list(paulis, weights=None, name=None)[source]¶
Create a WeightedPauliOperator via a pair of list.
- Parameters
paulis (list[Pauli]) – the list of Paulis
weights (list[complex], optional) – the list of weights, if it is None, all weights are 1.
name (str, optional) – name of the operator.
- Returns
operator
- Return type
- Raises
ValueError – The length of weights and paulis must be the same