code: def _make_Z(dim):
      r"""Calculates the :math:`\mathcal{Z}` unitary which performs a reflection along the all
      :math:`|0\rangle` state.
  
      Args:
          dim (int): dimension of :math:`\mathcal{Z}`
  
      Returns:
          array: the :math:`\mathcal{Z}` unitary
      """
      Z = -np.eye(dim)
      Z[0, 0] = 1
      return Z
  
file_path: pennylane/pennylane/templates/subroutines/qmc.py
imports: import numpy
  import pennylane
  from pennylane.operation import AnyWires, Operation
  from pennylane.ops import QubitUnitary
label_desc: Use image node_id 4 for calling a global function with example usage: _make_Z(dim) and returns: Z