class_docstr: Unit tests for transpile function
class_docstr_tok: ["Unit","tests","for","transpile","function"]
docstr: Test that transpile works with state measurement process.
docstr_tok: ["Test","that","transpile","works","with","state","measurement","process","."]
code: def test_transpile_state(self):
      """Test that transpile works with state measurement process."""
  
      tape = qml.tape.QuantumScript(
          [qml.PauliX(0), qml.CNOT((0, 2))], [qml.state()], shots=100
      )
      batch, fn = qml.transforms.transpile(
          tape, coupling_map=[(0, 1), (1, 2)]
      )
  
      assert len(batch) == 1
      assert fn(("a",)) == "a"
  
      assert batch[0][0] == qml.PauliX(0)
      assert batch[0][1] == qml.SWAP((1, 2))
      assert batch[0][2] == qml.CNOT((0, 1))
      assert batch[0][3] == qml.state()
      assert batch[0].shots == tape.shots
  
imports: from math import isclose
  import pytest
  from pennylane import numpy
  import pennylane
  from pennylane.transforms.transpile import transpile
label_desc: Use image node_id 12 for calling the TestTranspile obj's underlying member method code with example usage: obj.test_transpile_state() without return types