code: def circuit_decomposed(features, pad_with=None):
      """AmplitudeEmbedding circuit reexpressed as manual state preparation.
      This function expects the length of the features to match."""
      num_wires = 3 if pad_with is None else 4
      if pad_with is not None:
          # and need to pad manually in order to double the size of the vector
          # from 8 (3 qubits) to 16 (4 qubits). Also, normalize
          features = qml.math.hstack(
              [features, qml.math.ones_like(features) * pad_with]
          )
          shape = qml.math.shape(features)
          norm = qml.math.reshape(
              qml.math.linalg.norm(features, axis=-1), (*shape[:-1], 1)
          )
          features = features / norm
      # need to cast to complex tensor, which is implicitly done in the template
      qml.StatePrep(
          qml.math.cast(features, np.complex128), wires=range(num_wires)
      )
      return qml.state()
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: circuit_decomposed(features, pad_with) and returns: qml