class_docstr: Test that tapes containing matrix-valued parameters are drawn correctly.
docstr: Test matrix parameters only printed once after a batch transform.
docstr_tok: ["Test","matrix","parameters","only","printed","once","after","a","batch","transform","."]
code: def test_matrix_parameters_batch_transform(self):
      """Test matrix parameters only printed once after a batch transform."""
  
      @partial(qml.gradients.param_shift, shifts=[(0.2,)])
      @qml.qnode(qml.device("default.qubit", wires=2))
      def matrices_circuit(x):
          qml.StatePrep([1.0, 0.0, 0.0, 0.0], wires=(0, 1))
          qml.QubitUnitary(np.eye(2, requires_grad=False), wires=0)
          qml.RX(x, wires=1)
          return qml.expval(
              qml.Hermitian(np.eye(2, requires_grad=False), wires=1)
          )
  
      expected1 = (
          "0: ─╭|Ψ⟩──U(M0)────┤         \n"
          "1: ─╰|Ψ⟩──RX(1.20)─┤  <𝓗(M0)>\n\n"
          "0: ─╭|Ψ⟩──U(M0)────┤         \n"
          "1: ─╰|Ψ⟩──RX(0.80)─┤  <𝓗(M0)>\n\n"
          "M0 = \n[[1. 0.]\n [0. 1.]]"
      )
      output = draw(matrices_circuit)(np.array(1.0, requires_grad=True))
      assert output == expected1
  
      expected2 = (
          "0: ─╭|Ψ⟩──U(M0)────┤         \n"
          "1: ─╰|Ψ⟩──RX(1.20)─┤  <𝓗(M0)>\n\n"
          "0: ─╭|Ψ⟩──U(M0)────┤         \n"
          "1: ─╰|Ψ⟩──RX(0.80)─┤  <𝓗(M0)>"
      )
      output = draw(matrices_circuit, show_matrices=False)(
          np.array(1.0, requires_grad=True)
      )
      assert output == expected2
  
imports: from functools import partial
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.drawer import draw
label_desc: Use image node_id 2 for calling the TestMatrixParameters obj's underlying member method code with example usage: obj.test_matrix_parameters_batch_transform() and returns: qml