code: def basic_entangler_circuit_exact_state(
      n_wires, sub_wires, interface="autograd"
  ):
      dev = qml.device("default.qubit", wires=n_wires)
  
      @qml.qnode(dev, interface=interface)
      def circuit(x):
          qml.BasicEntanglerLayers(weights=x, wires=range(n_wires))
          return qml.density_matrix(sub_wires)
  
      return circuit
  
imports: from functools import partial
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.shadows.transforms import _replace_obs
label_desc: Use image node_id 5 for calling a global function with example usage: basic_entangler_circuit_exact_state(n_wires, sub_wires, interface) and returns: circuit, qml