{"record":{"id":"e6b6bbca0bcdf4ee","repo":"jax-ml/jax","slug":"only-the-type-1-case-of-eigh-is-implemented","errorCode":null,"errorMessage":"Only the type=1 case of eigh is implemented.","messagePattern":"Only the type=1 case of eigh is implemented\\.","errorType":"validation","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"jax/_src/scipy/linalg.py","lineNumber":401,"sourceCode":"@overload\ndef _eigh(a: ArrayLike, b: ArrayLike | None, lower: bool, eigvals_only: Literal[True],\n          eigvals: None, type: int) -> Array: ...\n\n@overload\ndef _eigh(a: ArrayLike, b: ArrayLike | None, lower: bool, eigvals_only: Literal[False],\n          eigvals: None, type: int) -> tuple[Array, Array]: ...\n\n@overload\ndef _eigh(a: ArrayLike, b: ArrayLike | None, lower: bool, eigvals_only: bool,\n          eigvals: None, type: int) -> Array | tuple[Array, Array]: ...\n\n@jit(static_argnames=('lower', 'eigvals_only', 'eigvals', 'type'))\ndef _eigh(a: ArrayLike, b: ArrayLike | None, lower: bool, eigvals_only: bool,\n          eigvals: None, type: int) -> Array | tuple[Array, Array]:\n  if b is not None:\n    raise NotImplementedError(\"Only the b=None case of eigh is implemented\")\n  if type != 1:\n    raise NotImplementedError(\"Only the type=1 case of eigh is implemented.\")\n  if eigvals is not None:\n    raise NotImplementedError(\n        \"Only the eigvals=None case of eigh is implemented.\")\n\n  a, = promote_dtypes_inexact(jnp.asarray(a))\n  v, w = lax_linalg.eigh(a, lower=lower)\n\n  if eigvals_only:\n    return w\n  else:\n    return w, v\n\n@overload\ndef eigh(a: ArrayLike, b: ArrayLike | None = None, lower: bool = True,\n         eigvals_only: Literal[False] = False, overwrite_a: bool = False,\n         overwrite_b: bool = False, turbo: bool = True, eigvals: None = None,\n         type: int = 1, check_finite: bool = True) -> tuple[Array, Array]: ...\n","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/scipy/linalg.py#L383-L419","documentation":"jax.scipy.linalg.eigh only implements the standard eigenproblem (type=1). The `type` parameter selects which generalized eigenproblem formulation to solve per LAPACK's syevd/heevd family; JAX has only implemented type 1, so any other integer raises NotImplementedError.","triggerScenarios":"Calling jax.scipy.linalg.eigh(a, type=2) or type=3 (also requires b != None, which itself raises a sibling error).","commonSituations":"Porting NumPy/SciPy code that uses scipy.linalg.eigh(a, b, type=2) for generalized eigenvalue problems (e.g. vibronic analysis, LDA/QDA discriminants) to JAX.","solutions":["Drop the type argument (use default type=1) if you only need the ordinary symmetric eigenproblem","For generalized problems, reduce manually: solve eigh(solve(cholesky(b), a)) via a congruence transform with b's Cholesky factor, then map eigenvectors back","Use scipy.linalg.eigh on the host (outside jit) if GPU execution is not required","File/track a feature request on the JAX GitHub repo"],"exampleFix":"// before\nw, v = jax.scipy.linalg.eigh(a, b, type=2)\n// after\nL = jax.scipy.linalg.cholesky(b)\na_whitened = jax.scipy.linalg.solve_triangular(L, a, lower=True)\nw, v = jax.scipy.linalg.eigh(a_whitened.T + a_whitened)  # symmetrize as needed\nv = jax.scipy.linalg.solve_triangular(L.T, v)","handlingStrategy":"validation","validationCode":"if type != 1: raise ValueError('jax eigh supports only type=1')","typeGuard":"null","tryCatchPattern":null,"preventionTips":["Check JAX API parity with SciPy before porting generalized eigensolvers","Wrap SciPy-compatible wrappers in your own compatibility layer that rejects unsupported kwargs"],"tags":["jax","linalg","eigenvalue","not-implemented"],"backgroundTag":"unsupported-parameter-value","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}