code: def chirped(X: np.ndarray) -> float:
      lam = np.linspace(500, 800, 50)
      n = np.array([1, 1.4142135623730951, 1.7320508075688772])
      type_ = np.concatenate(([0], np.tile([2, 1], int(np.size(X) / 2)), [2]))  # type: ignore
      hauteur = np.concatenate(([0], X, [0]))  # type: ignore
      r = np.zeros(np.size(lam)) + 0j
      for m in range(0, np.size(lam)):
          # Specific to this substrate.
          tmp = np.tan(2 * np.pi * n[type_] * hauteur / lam[m])
          Z = 1.7320508075688772
          for k in range(np.size(type_) - 1, 0, -1):
              Z = (Z - 1j * n[type_[k]] * tmp[k]) / (
                  1 - 1j * tmp[k] * Z / n[type_[k]]
              )
          # Specific to air.
          r[m] = (1 - Z) / (1 + Z)
      # c=1-np.mean(abs(r)**2)
      c = 1 - np.real(np.sum(r * np.conj(r)) / np.size(lam))
      return float(c)
  
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 2 for calling a global function with example usage: chirped(X) and returns: float