class_docstr: Default Gaussian device for PennyLane.
  
  Args:
      wires (int, Iterable[Number, str]): Number of subsystems represented by the device,
          or iterable that contains unique labels for the subsystems as numbers (i.e., ``[-1, 0, 2]``)
          or strings (``['ancilla', 'q1', 'q2']``). Default 1 if not specified.
      shots (None, int): How many times the circuit should be evaluated (or sampled) to estimate
          the expectation values. If ``None``, the results are analytically computed and hence deterministic.
      hbar (float): (default 2) the value of :math:`\hbar` in the commutation
          relation :math:`[\x,\p]=i\hbar`
class_docstr_tok: ["Default","Gaussian","device","for","PennyLane",".","Args",":","wires","(","int",",","Iterable","[","Number",",","str","]",")",":","Number","of","subsystems","represented","by","the","device",",","or","iterable","that","contains","unique","labels","for","the","subsystems","as","numbers","(","i.e.",",","``","[","-1",",","0",",","2","]","``",")","or","strings","(","``","[","'ancilla","'",",","'q1","'",",","'q2","'","]","``",")",".","Default","1","if","not","specified",".","shots","(","None",",","int",")",":","How","many","times","the","circuit","should","be","evaluated","(","or","sampled",")","to","estimate","the","expectation","values",".","If","``","None","``",",","the","results","are","analytically","computed","and","hence","deterministic",".","hbar","(","float",")",":","(","default","2",")","the","value","of",":","math",":","`","\\hbar","`","in","the","commutation","relation",":","math",":","`","[","\\x",",","\\p","]","=i\\hbar","`"]
code: def apply(self, operation, wires, par):
      # translate to wire labels used by device
      device_wires = self.map_wires(wires)
  
      if operation == "Displacement":
          self._state = displacement(
              self._state,
              device_wires.labels[0],
              par[0] * cmath.exp(1j * par[1]),
          )
          return  # we are done here
  
      if operation == "GaussianState":
          if len(device_wires) != self.num_wires:
              raise ValueError(
                  "GaussianState covariance matrix or means vector is "
                  "the incorrect size for the number of subsystems."
              )
          self._state = self._operation_map[operation](
              *par, hbar=self.hbar
          )
          return  # we are done here
  
      if operation == "Snapshot":
          if self._debugger and self._debugger.active:
              gaussian = {
                  "cov_matrix": self._state[0].copy(),
                  "means": self._state[1].copy(),
              }
              self._debugger.snapshots[
                  len(self._debugger.snapshots)
              ] = gaussian
          return  # we are done here
  
      if "State" in operation:
          # set the new device state
          cov, mu = self._operation_map[operation](*par, hbar=self.hbar)
          # state preparations only act on at most 1 subsystem
          self._state = set_state(
              self._state, device_wires[:1], cov, mu
          )
          return  # we are done here
  
      # get the symplectic matrix
      S = self._operation_map[operation](*par)
  
      # expand the symplectic to act on the proper subsystem
      S = self.expand(S, device_wires)
  
      # apply symplectic matrix to the means vector
      means = S @ self._state[1]
      # apply symplectic matrix to the covariance matrix
      cov = S @ self._state[0] @ S.T
  
      self._state = [cov, means]
  
imports: import math
  import cmath
  import numpy
  from scipy.special import factorial
  import pennylane
  from pennylane.ops import Identity
  from pennylane import Device
  from .._version import __version__
label_desc: Use image node_id 4 for calling the DefaultGaussian obj's underlying member method code with example usage: obj.apply(operation, wires, par) without return types