> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fincept.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Matrix Decomposition

> Decompose a matrix using various methods: LU decomposition (A = LU, for solving linear systems), Cholesky decomposition (A = LL^T, for positive definite matrices in risk models), QR decomposition (A = QR, for least squares and eigenvalue problems), or Singular Value Decomposition (A = UΣV^T, for dimensionality reduction and pseudoinverses). Essential for numerical stability, solving systems, and matrix analysis. [Tier: BASIC, Credits: 1]



## OpenAPI

````yaml api-specs/numerical.json post /quantlib/numerical/linalg/decompose
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Numerical
  description: >-
    Numerical module endpoints for FinceptQuantLib API. The Numerical module
    (Basic Tier, 1 credit per request) provides comprehensive numerical methods
    including finite difference differentiation, Fast Fourier Transform (FFT),
    numerical integration (quadrature and Monte Carlo), interpolation methods
    (linear, cubic, spline), linear algebra operations (matrix decomposition,
    solving systems), ODE solvers, root finding algorithms, optimization
    methods, and nonlinear least squares fitting. Essential for quantitative
    analysis, scientific computing, and numerical model implementation.
  version: 3.0.0
  contact:
    name: Fincept API Support
    url: https://fincept.in
servers:
  - url: https://api.fincept.in
    description: Fincept API Production Server
security:
  - APIKeyHeader: []
tags:
  - name: quantlib-numerical
    description: >-
      Numerical methods including differentiation, FFT, integration,
      interpolation, linear algebra, ODE solvers, root finding, and optimization
    x-displayName: Numerical
paths:
  /quantlib/numerical/linalg/decompose:
    post:
      tags:
        - quantlib-numerical
      summary: Matrix Decomposition
      description: >-
        Decompose a matrix using various methods: LU decomposition (A = LU, for
        solving linear systems), Cholesky decomposition (A = LL^T, for positive
        definite matrices in risk models), QR decomposition (A = QR, for least
        squares and eigenvalue problems), or Singular Value Decomposition (A =
        UΣV^T, for dimensionality reduction and pseudoinverses). Essential for
        numerical stability, solving systems, and matrix analysis. [Tier: BASIC,
        Credits: 1]
      operationId: matrix_decompose
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - A
              properties:
                A:
                  type: array
                  items:
                    type: array
                    items:
                      type: number
                  description: >-
                    Input matrix (requirements depend on method: LU/QR/SVD work
                    on any, Cholesky requires positive definite symmetric)
                  example:
                    - - 4
                      - 12
                      - -16
                    - - 12
                      - 37
                      - -43
                    - - -16
                      - -43
                      - 98
                method:
                  type: string
                  description: Decomposition method
                  enum:
                    - lu
                    - cholesky
                    - qr
                    - svd
                  default: lu
                  example: cholesky
            example:
              A:
                - - 4
                  - 12
                  - -16
                - - 12
                  - 37
                  - -43
                - - -16
                  - -43
                  - 98
              method: cholesky
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    description: Decomposition result (structure depends on method)
                    oneOf:
                      - properties:
                          L:
                            type: array
                            items:
                              type: array
                              items:
                                type: number
                            description: Lower triangular matrix (LU or Cholesky)
                          U:
                            type: array
                            items:
                              type: array
                              items:
                                type: number
                            description: Upper triangular matrix (LU only)
                          pivots:
                            type: array
                            items:
                              type: integer
                            description: Pivot indices (LU only)
                      - properties:
                          Q:
                            type: array
                            description: Orthogonal matrix (QR)
                          R:
                            type: array
                            description: Upper triangular matrix (QR)
                      - properties:
                          U:
                            type: array
                            description: Left singular vectors (SVD)
                          S:
                            type: array
                            items:
                              type: number
                            description: Singular values (SVD)
                          Vt:
                            type: array
                            description: Right singular vectors transposed (SVD)
              example:
                success: true
                data:
                  L:
                    - - 2
                      - 0
                      - 0
                    - - 6
                      - 1
                      - 0
                    - - -8
                      - 5
                      - 3
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientTierError'
        '422':
          description: Validation Error
      security:
        - APIKeyHeader: []
components:
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Invalid API key
    InsufficientTierError:
      description: API tier insufficient for this endpoint
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Endpoint requires Basic tier or higher
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Get your key at
        https://api.fincept.in/auth/register

````