code: def get_unitary(circ, n_wires):
      """Helper function to find unitary of a circuit"""
      dev = qml.device("default.qubit", wires=range(n_wires))
  
      @qml.qnode(dev)
      def unitary_z(basis_state):
          qml.BasisState(basis_state, wires=range(n_wires))
          circ()
          return qml.state()
  
      bitstrings = list(itertools.product([0, 1], repeat=n_wires))
      u = [unitary_z(np.array(bitstring)) for bitstring in bitstrings]
      u = np.array(u).T
      return u
  
file_path: pennylane/tests/transforms/test_qmc_transform.py
imports: import itertools
  import numpy
  import pytest
  from scipy.stats import unitary_group, norm
  import pennylane
  from pennylane.transforms.qmc import _apply_controlled_z, _apply_controlled_v, apply_controlled_Q, quantum_monte_carlo
  from pennylane.templates.subroutines.qmc import _make_V, _make_Z, make_Q
  from pennylane.wires import Wires
label_desc: Use image node_id 2 for calling a global function with example usage: get_unitary(circ, n_wires) and returns: u, qml