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","`"]
docstr: Expands a Symplectic matrix S to act on the entire subsystem.
  
  Args:
      S (array): a :math:`2M\times 2M` Symplectic matrix
      wires (Wires): wires of the modes that S acts on
  
  Returns:
      array: the resulting :math:`2N\times 2N` Symplectic matrix
docstr_tok: ["Expands","a","Symplectic","matrix","S","to","act","on","the","entire","subsystem",".","Args",":","S","(","array",")",":","a",":","math",":","`","2M\\times","2M","`","Symplectic","matrix","wires","(","Wires",")",":","wires","of","the","modes","that","S","acts","on","Returns",":","array",":","the","resulting",":","math",":","`","2N\\times","2N","`","Symplectic","matrix"]
code: def expand(self, S, wires):
      r"""Expands a Symplectic matrix S to act on the entire subsystem.
  
      Args:
          S (array): a :math:`2M\times 2M` Symplectic matrix
          wires (Wires): wires of the modes that S acts on
  
      Returns:
          array: the resulting :math:`2N\times 2N` Symplectic matrix
      """
      if self.num_wires == 1:
          # total number of wires is 1, simply return the matrix
          return S
  
      N = self.num_wires
      w = wires.toarray()
  
      M = len(S) // 2
      S2 = np.identity(2 * N)
  
      if M != len(wires):
          raise ValueError(
              "Incorrect number of subsystems for provided operation."
          )
  
      S2[w.reshape(-1, 1), w.reshape(1, -1)] = S[:M, :M].copy()  # XX
      S2[(w + N).reshape(-1, 1), (w + N).reshape(1, -1)] = S[
          M:, M:
      ].copy()  # PP
      S2[w.reshape(-1, 1), (w + N).reshape(1, -1)] = S[
          :M, M:
      ].copy()  # XP
      S2[(w + N).reshape(-1, 1), w.reshape(1, -1)] = S[
          M:, :M
      ].copy()  # PX
  
      return S2
  
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 5 for calling the DefaultGaussian obj's underlying member method code with example usage: obj.expand(S, wires) and returns: S2, S