qib.operator.pauli_operator.WeightedPauliString¶
- class qib.operator.pauli_operator.WeightedPauliString(paulis: PauliString, weight)[source]¶
Bases:
AbstractOperatorPauli string with a weight factor.
Methods
Generate the sparse matrix representation of the weighted Pauli string.
Test whether the weighted Pauli string commutes with another weighted Pauli string.
List of fields the weighted Pauli string acts on.
Whether the operator is Hermitian.
Whether the operator is unitary.
Set a field which the weighted Pauli string acts on (such that it can be used like a Hamiltonian).
Attributes
Number of qubits, i.e., length of Pauli string, including identities.
- commutes_with(other)[source]¶
Test whether the weighted Pauli string commutes with another weighted Pauli string.
- property num_qubits¶
Number of qubits, i.e., length of Pauli string, including identities.