code: def creneau(
      k0: float,
      a0: float,
      pol: float,
      e1: float,
      e2: float,
      a: float,
      n: int,
      x0: float,
  ) -> tp.Tuple[np.ndarray, np.ndarray]:
      nmod = int(n / 2)
      alpha = np.diag(a0 + 2 * np.pi * np.arange(-nmod, nmod + 1))
      if pol == 0:
          M = alpha * alpha - k0 * k0 * marche(e1, e2, a, n, x0)
          L, E = np.linalg.eig(M)
          L = np.sqrt(-L + 0j)
          L = (1 - 2 * (np.imag(L) < -1e-15)) * L
          P = np.block([[E], [np.matmul(E, np.diag(L))]])
      else:
          U = marche(1 / e1, 1 / e2, a, n, x0)
          T = np.linalg.inv(U)
          M = (
              np.matmul(
                  np.matmul(
                      np.matmul(T, alpha),
                      np.linalg.inv(marche(e1, e2, a, n, x0)),
                  ),
                  alpha,
              )
              - k0 * k0 * T
          )
          L, E = np.linalg.eig(M)
          L = np.sqrt(-L + 0j)
          L = (1 - 2 * (np.imag(L) < -1e-15)) * L
          P = np.block([[E], [np.matmul(np.matmul(U, E), np.diag(L))]])
      return P, L
  
file_path: nevergrad/nevergrad/functions/photonics/photonics.py
imports: import typing
  from pathlib import Path
  import numpy
  from scipy.linalg import toeplitz
label_desc: Use image node_id 6 for calling a global function with example usage: creneau(k0, a0, pol, e1, e2, a, n, x0) and returns: P,  L