class_docstr: Tests that the template defines the correct decomposition.
class_docstr_tok: ["Tests","that","the","template","defines","the","correct","decomposition","."]
docstr: Test that attempting to decompose a BasisStatePreparation operation with
  broadcasting raises an error.
docstr_tok: ["Test","that","attempting","to","decompose","a","BasisStatePreparation","operation","with","broadcasting","raises","an","error","."]
code: def test_batched_decomposition_fails(self):
      """Test that attempting to decompose a BasisStatePreparation operation with
      broadcasting raises an error."""
      state = np.array([[1, 0], [1, 1]])
  
      op = qml.BasisStatePreparation(state, wires=[0, 1])
      with pytest.raises(
          ValueError, match="Broadcasting with BasisStatePreparation"
      ):
          _ = op.decomposition()
  
      with pytest.raises(
          ValueError, match="Broadcasting with BasisStatePreparation"
      ):
          _ = qml.BasisStatePreparation.compute_decomposition(
              state, qml.wires.Wires([0, 1])
          )
  
file_path: pennylane/tests/templates/test_state_preparations/test_basis_state_prep.py
imports: import pytest
  import numpy
  import pennylane
label_desc: Use image node_id 6 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_batched_decomposition_fails() without return types