class_docstr: Basic usage and edge-case tests for the measurement optimization utility functions.
class_docstr_tok: ["Basic","usage","and","edge-case","tests","for","the","measurement","optimization","utility","functions","."]
docstr: Determining if two Pauli words are qubit-wise commuting.
docstr_tok: ["Determining","if","two","Pauli","words","are","qubit-wise","commuting","."]
code: def test_is_qwc(self):
      """Determining if two Pauli words are qubit-wise commuting."""
  
      wire_map = {0: 0, "a": 1, "b": 2}
      p1_vec = pauli_to_binary(
          PauliX(0) @ PauliY("a"), wire_map=wire_map
      )
      p2_vec = pauli_to_binary(
          PauliX(0) @ Identity("a") @ PauliX("b"), wire_map=wire_map
      )
      p3_vec = pauli_to_binary(
          PauliX(0) @ PauliZ("a") @ Identity("b"), wire_map=wire_map
      )
      identity = pauli_to_binary(
          Identity("a") @ Identity(0), wire_map=wire_map
      )
  
      assert is_qwc(p1_vec, p2_vec)
      assert not is_qwc(p1_vec, p3_vec)
      assert is_qwc(p2_vec, p3_vec)
      assert (
          is_qwc(p1_vec, identity)
          == is_qwc(p2_vec, identity)
          == is_qwc(p3_vec, identity)
          == is_qwc(identity, identity)
          == True
      )
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import RX, RY, U3, Hadamard, Hamiltonian, Hermitian, Identity, PauliX, PauliY, PauliZ, is_commuting
  from pennylane.operation import Tensor
  from pennylane.pauli import are_identical_pauli_words, are_pauli_words_qwc, binary_to_pauli, diagonalize_pauli_word, diagonalize_qwc_pauli_words, is_pauli_word, is_qwc, observables_to_binary_matrix, partition_pauli_group, pauli_group, pauli_mult, pauli_mult_with_phase, pauli_to_binary, pauli_word_to_matrix, pauli_word_to_string, qwc_complement_adj_matrix, qwc_rotation, simplify, string_to_pauli_word
label_desc: Use image node_id 12 for calling the TestGroupingUtils obj's underlying member method code with example usage: obj.test_is_qwc() without return types