TPBGroupedWeightedPauliOperator.from_list¶
- classmethod TPBGroupedWeightedPauliOperator.from_list(paulis, weights=None, name=None)¶
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