class_docstr: Test the utility function _nonzero_coeffs_and_words.
class_docstr_tok: ["Test","the","utility","function","_nonzero_coeffs_and_words","."]
docstr: Test that no coefficients and words are returned when all coefficients vanish.
docstr_tok: ["Test","that","no","coefficients","and","words","are","returned","when","all","coefficients","vanish","."]
code: def test_all_zero(self, num_wires):
      """Test that no coefficients and words are returned when all coefficients vanish."""
      dim = 4**num_wires - 1
      shapes = [(dim, 3), (dim,), (dim, 2, 5)]
      # Generate zero coefficients only
      coeffs = tuple(np.zeros(shape) for shape in shapes)
      new_coeffs, words = _nonzero_coeffs_and_words(coeffs, num_wires)
      # There should be as many coefficient sets as before, namely three, and they should
      # be empty.
      assert new_coeffs == [[], [], []]
      # There should be an empty list of Pauli words left.
      assert words == []
  
imports: import copy
  import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.ops.qubit.special_unitary import pauli_basis_matrices, pauli_basis_strings
  from pennylane.math import expand_matrix
  from pennylane.gradients.pulse_gradient_odegen import _generate_tapes_and_coeffs, pulse_odegen, _insert_op, _nonzero_coeffs_and_words, _one_parameter_generators, _one_parameter_paulirot_coeffs, _parshift_and_contract
label_desc: Use image node_id 1 for calling the TestNonzeroCoeffsAndWords obj's underlying member method code with example usage: obj.test_all_zero(num_wires) without return types