{
  "id": "task_libraries:matrix/python",
  "path": "/exapedia/python-matrix-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python matrix libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python matrix libraries store matrices and run linear algebra on them, from multiplication and inversion to decompositions and solvers. A sparse format stores only the nonzero entries of a matrix rather than every cell. These libraries let machine learning models, simulations, and data pipelines process large grids of numbers."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python matrix libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#numpy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F133"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#scipy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F151"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sympy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F168"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pytorch",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F185"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#dask",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F203"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jax",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F222"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#tensorflow",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F241"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pytensor",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F260"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F261"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F269"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F264"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F262"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#numpy",
          "label": [
            {
              "t": "text",
              "text": "NumPy"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F134"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Sparse matrices",
            "GPU matrix execution"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#numpy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F133"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#scipy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F151"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sympy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F168"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pytorch",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F185"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#dask",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F203"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#jax",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F222"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#tensorflow",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F241"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F252"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pytensor",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F260"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F270"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F271"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "numpy",
          "name": [
            {
              "t": "fact",
              "fact": "F133"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/numpy/numpy"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/numpy"
            },
            {
              "label": "Docs",
              "href": "https://numpy.org/doc/stable/reference/routines.linalg.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F10"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F136"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://numpy.org/doc/stable/reference/routines.linalg.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F133"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F11"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F12"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/scikit-learn/scikit-learn",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F149"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def row_norms(X, squared=False):\n    \"\"\"Row-wise (squared) Euclidean norm of X.\n\n    Equivalent to np.sqrt((X * X).sum(axis=1)), but also supports sparse\n    matrices and does not create an X.shape-sized temporary.\n\n    Performs no input validation.\n\n    Parameters\n    ----------\n    X : array-like\n        The input array.\n    squared : bool, default=False\n        If True, return squared norms.\n\n    Returns\n    -------\n    array-like\n        The row-wise (squared) Euclidean norm of X.\n    \"\"\"\n    if sparse.issparse(X):\n        X = X.tocsr()\n        norms = csr_row_norms(X)\n        if not squared:\n            norms = np.sqrt(norms)\n    else:\n        xp, _ = get_namespace(X)\n        if _is_numpy_namespace(xp):\n            X = np.asarray(X)\n            norms = np.einsum(\"ij,ij->i\", X, X)\n            norms = xp.asarray(norms)\n        else:\n            norms = xp.sum(xp.multiply(X, X), axis=1)\n        if not squared:\n            norms = xp.sqrt(norms)\n    return norms\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/scikit-learn/scikit-learn/blob/a30a70e39ef550a01ea7234e9cf10d3d821df9cd/sklearn/utils/extmath.py#L58-L93",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F148"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20numpy%20for%20matrix%20and%20linear%20algebra%20operations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F133"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import numpy as np\n\na = np.array([[1, 2], [3, 5]])\n\nb = np.array([1, 2])\n\nx = np.linalg.solve(a, b)\n\nx\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://numpy.org/doc/stable/reference/generated/numpy.linalg.solve.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "numpy.linalg.solve.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F138"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "scipy",
          "name": [
            {
              "t": "fact",
              "fact": "F151"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/scipy/scipy"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/scipy"
            },
            {
              "label": "Docs",
              "href": "https://docs.scipy.org/doc/scipy/reference/linalg.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F36"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.scipy.org/doc/scipy/reference/linalg.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F151"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F37"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/deepmodeling/jax-fem",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F166"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def scipy_spsolve(A, b):\n    logger.debug(\"Scipy Solver - Solving linear system with scipy.sparse.linalg.spsolve\")\n    indptr, indices, data = A.getValuesCSR()\n    Asp = scipy.sparse.csr_matrix((data, indices, indptr))\n    # SciPy's spsolve uses UMFPACK only when scikits.umfpack is installed and\n    # applicable; otherwise it falls back to SuperLU.\n    x = scipy.sparse.linalg.spsolve(Asp, onp.array(b))\n\n    # TODO: try https://jax.readthedocs.io/en/latest/_autosummary/jax.experimental.sparse.linalg.spsolve.html\n    # x = jax.experimental.sparse.linalg.spsolve(av, aj, ai, b)\n\n    logger.debug(\"Scipy Solver - Finished solving, linear solve res = %.3g\",\n                 np.linalg.norm(Asp @ x - b))\n    return x\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/deepmodeling/jax-fem/blob/01d11bdb57aa76dcfe7189e0e77d067960c2a6ac/jax_fem/solver.py#L89-L102",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F165"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20scipy%20for%20matrix%20and%20linear%20algebra%20operations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F151"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import numpy as np\n\na = np.array([[3, 2, 0], [1, -1, 0], [0, 5, 1]])\n\nb = np.array([2, 4, -1])\n\nfrom scipy.linalg import solve\n\nx = solve(a, b)\n\nx\n\na @ x == b\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.solve.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "scipy.linalg.solve.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F156"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "sympy",
          "name": [
            {
              "t": "fact",
              "fact": "F168"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/sympy/sympy"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/sympy"
            },
            {
              "label": "Docs",
              "href": "https://docs.sympy.org/latest/modules/matrices/matrices.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F62"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.sympy.org/latest/modules/matrices/matrices.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F168"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F63"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F70"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/Phylliade/ikpy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F183"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _apply_geometric_transformations(self, theta, mu, symbolic):\n\n    if symbolic:\n        # Angle symbolique qui paramètre la rotation du joint en cours\n        symbolic_frame_matrix = np.eye(4)\n\n        # Apply translation matrix\n        symbolic_frame_matrix = symbolic_frame_matrix * sympy.Matrix(geometry.homogeneous_translation_matrix(*self.origin_translation))\n\n        # Apply orientation matrix\n        symbolic_frame_matrix = symbolic_frame_matrix * geometry.cartesian_to_homogeneous(geometry.rpy_matrix(*self.origin_orientation))\n\n        # Apply rotation matrix\n        if self.has_rotation:\n            symbolic_frame_matrix = symbolic_frame_matrix * geometry.cartesian_to_homogeneous(geometry.symbolic_axis_rotation_matrix(self.rotation, theta), matrix_type=\"sympy\")\n\n        # Apply translation\n        if self.has_translation:\n            translation_vector = self.translation * mu\n            symbolic_frame_matrix = symbolic_frame_matrix * geometry.get_symbolic_translation_matrix(translation_vector)\n\n        symbolic_frame_matrix = sympy.lambdify([theta, mu], symbolic_frame_matrix, \"numpy\")\n\n        return symbolic_frame_matrix\n\n    else:\n        # Init the transformation matrix\n        frame_matrix = np.eye(4)\n\n        # First, apply translation matrix\n        frame_matrix = np.dot(frame_matrix, geometry.homogeneous_translation_matrix(*self.origin_translation))\n\n        # Apply orientation\n        frame_matrix = np.dot(frame_matrix, geometry.cartesian_to_homogeneous(geometry.rpy_matrix(*self.origin_orientation)))\n\n        # Apply rotation matrix\n        if self.has_rotation:\n            frame_matrix = np.dot(frame_matrix, geometry.cartesian_to_homogeneous(geometry.axis_rotation_matrix(self.rotation, theta)))\n\n        # Apply translation\n        if self.has_translation:\n            translation_vector = self.translation * mu\n            frame_matrix = np.dot(frame_matrix, geometry.get_translation_matrix(translation_vector))\n\n        return frame_matrix\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/Phylliade/ikpy/blob/95b289b1239fb644b1c2e9b799f5a7ec43d7bc37/src/ikpy/link.py#L231-L275",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F182"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20sympy%20for%20matrix%20and%20linear%20algebra%20operations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F168"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from sympy import Matrix\n\nM = Matrix(3, 3, [0, 1, 1, 1, 0, 0, 1, 1, 1])\n\nM.eigenvals()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.sympy.org/latest/modules/matrices/matrices.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "matrices.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F173"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pytorch",
          "name": [
            {
              "t": "fact",
              "fact": "F185"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/pytorch/pytorch"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/torch"
            },
            {
              "label": "Docs",
              "href": "https://docs.pytorch.org/docs/2.15/linalg.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F88"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.pytorch.org/docs/2.15/linalg.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F185"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F89"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F90"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F91"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F92"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F93"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F94"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F95"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F96"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/nerfstudio-project/nerfstudio",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F201"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def focus_of_attention(poses: Float[Tensor, \"*num_poses 4 4\"], initial_focus: Float[Tensor, \"3\"]) -> Float[Tensor, \"3\"]:\n    \"\"\"Compute the focus of attention of a set of cameras. Only cameras\n    that have the focus of attention in front of them are considered.\n\n     Args:\n        poses: The poses to orient.\n        initial_focus: The 3D point views to decide which cameras are initially activated.\n\n    Returns:\n        The 3D position of the focus of attention.\n    \"\"\"\n    # References to the same method in third-party code:\n    # https://github.com/google-research/multinerf/blob/1c8b1c552133cdb2de1c1f3c871b2813f6662265/internal/camera_utils.py#L145\n    # https://github.com/bmild/nerf/blob/18b8aebda6700ed659cb27a0c348b737a5f6ab60/load_llff.py#L197\n    active_directions = -poses[:, :3, 2:3]\n    active_origins = poses[:, :3, 3:4]\n    # initial value for testing if the focus_pt is in front or behind\n    focus_pt = initial_focus\n    # Prune cameras which have the current have the focus_pt behind them.\n    active = torch.sum(active_directions.squeeze(-1) * (focus_pt - active_origins.squeeze(-1)), dim=-1) > 0\n    done = False\n    # We need at least two active cameras, else fallback on the previous solution.\n    # This may be the \"poses\" solution if no cameras are active on first iteration, e.g.\n    # they are in an outward-looking configuration.\n    while torch.sum(active.int()) > 1 and not done:\n        active_directions = active_directions[active]\n        active_origins = active_origins[active]\n        # https://en.wikipedia.org/wiki/Line–line_intersection#In_more_than_two_dimensions\n        m = torch.eye(3) - active_directions * torch.transpose(active_directions, -2, -1)\n        mt_m = torch.transpose(m, -2, -1) @ m\n        focus_pt = torch.linalg.inv(mt_m.mean(0)) @ (mt_m @ active_origins).mean(0)[:, 0]\n        active = torch.sum(active_directions.squeeze(-1) * (focus_pt - active_origins.squeeze(-1)), dim=-1) > 0\n        if active.all():\n            # the set of active cameras did not change, so we're done.\n            done = True\n    return focus_pt\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/nerfstudio-project/nerfstudio/blob/50e0e3c70c775e89333256213363badbf074f29d/nerfstudio/cameras/camera_utils.py#L514-L549",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F200"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20torch%20for%20matrix%20and%20linear%20algebra%20operations&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F185"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import torch\n\nA = torch.randn(3, 3)\nb = torch.randn(3)\nx = torch.linalg.solve(A, b)\nprint(x)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.pytorch.org/docs/2.15/generated/torch.linalg.solve.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "torch.linalg.solve.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F190"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "dask",
          "name": [
            {
              "t": "fact",
              "fact": "F203"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/dask/dask"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/dask"
            },
            {
              "label": "Docs",
              "href": "https://docs.dask.org/en/stable/array-api.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F210"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.dask.org/en/stable/array-api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F203"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/dask/dask-ml",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F220"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def fit_transform(self, X, y=None):\n    \"\"\"Fit model to X and perform dimensionality reduction on X.\n\n    Parameters\n    ----------\n    X : array-like, shape (n_samples, n_features)\n        Training data.\n\n    y : Ignored\n\n    Returns\n    -------\n    X_new : array, shape (n_samples, n_components)\n        Reduced version of X. This will always be a dense array, of the\n        same type as the input array. If ``X`` was a ``dask.array``, then\n        ``X_new`` will be a ``dask.array`` with the same chunks along the\n        first dimension.\n    \"\"\"\n    X = self._check_array(X)\n    if self.algorithm not in {\"tsqr\", \"randomized\"}:\n        raise ValueError(\n            \"`algorithm` must be 'tsqr' or 'randomized', not '{}'\".format(\n                self.algorithm\n            )\n        )\n    if self.algorithm == \"tsqr\":\n        u, s, v = da.linalg.svd(X)\n        u = u[:, : self.n_components]\n        s = s[: self.n_components]\n        v = v[: self.n_components]\n    else:\n        u, s, v = da.linalg.svd_compressed(\n            X, self.n_components, n_power_iter=self.n_iter, seed=self.random_state\n        )\n    if not DASK_2_26_0:\n        u, v = svd_flip(u, v)\n\n    X_transformed = u * s\n    explained_var = X_transformed.var(axis=0)\n    full_var = X.var(axis=0).sum()\n    explained_variance_ratio = explained_var / full_var\n\n    if self.compute:\n        v, explained_var, explained_variance_ratio, s = compute(\n            v, explained_var, explained_variance_ratio, s\n        )\n    self.components_ = v\n    self.explained_variance_ = explained_var\n    self.explained_variance_ratio_ = explained_variance_ratio\n    self.singular_values_ = s\n    self.n_features_in_ = X.shape[1]\n    return X_transformed\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/dask/dask-ml/blob/fcc8111ac686e086985902f2050b3b17464966dc/dask_ml/decomposition/truncated_svd.py#L157-L208",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F219"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=dask%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F203"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import dask.array as da\n\nx = da.eye(2, chunks=2)\nu, s, v = da.linalg.svd(x)\nprint(s.compute())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.dask.org/en/stable/array-api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "array-api.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F208"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "jax",
          "name": [
            {
              "t": "fact",
              "fact": "F222"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/jax-ml/jax"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/jax"
            },
            {
              "label": "Docs",
              "href": "https://docs.jax.dev/en/latest/jax.numpy.linalg.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F229"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.jax.dev/en/latest/jax.numpy.linalg.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F222"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/deepmodeling/jax-fem",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F239"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def operator_to_matrix(operator_fn, problem):\n    \"\"\"Only used for when debugging.\n    Can be used to print the matrix, check the conditional number, etc.\n    \"\"\"\n    J = jax.jacfwd(operator_fn)(np.zeros(problem.num_total_dofs_all_vars))\n    return J\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/deepmodeling/jax-fem/blob/01d11bdb57aa76dcfe7189e0e77d067960c2a6ac/jax_fem/solver.py#L382-L387",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F238"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=jax%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F222"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import jax.numpy as jnp\n\nx = jnp.array([[1., 2., 3.], [4., 5., 7.]])\nprint(jnp.linalg.norm(x))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.jax.dev/en/latest/_autosummary/jax.numpy.linalg.norm.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "jax.numpy.linalg.norm.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F227"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "tensorflow",
          "name": [
            {
              "t": "fact",
              "fact": "F241"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/tensorflow/tensorflow"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/tensorflow"
            },
            {
              "label": "Docs",
              "href": "https://www.tensorflow.org/api_docs/python/tf/linalg"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F248"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://www.tensorflow.org/api_docs/python/tf/linalg",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F241"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F258"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F259"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/tensorflow/probability",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F258"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def sparse_or_dense_matmul(sparse_or_dense_a,\n                           dense_b,\n                           validate_args=False,\n                           name=None,\n                           **kwargs):\n  \"\"\"Returns (batched) matmul of a SparseTensor (or Tensor) with a Tensor.\n\n  Args:\n    sparse_or_dense_a: `SparseTensor` or `Tensor` representing a (batch of)\n      matrices.\n    dense_b: `Tensor` representing a (batch of) matrices, with the same batch\n      shape as `sparse_or_dense_a`. The shape must be compatible with the shape\n      of `sparse_or_dense_a` and kwargs.\n    validate_args: When `True`, additional assertions might be embedded in the\n      graph.\n      Default value: `False` (i.e., no graph assertions are added).\n    name: Python `str` prefixed to ops created by this function.\n      Default value: 'sparse_or_dense_matmul'.\n    **kwargs: Keyword arguments to `tf.sparse_tensor_dense_matmul` or\n      `tf.matmul`.\n\n  Returns:\n    product: A dense (batch of) matrix-shaped Tensor of the same batch shape and\n    dtype as `sparse_or_dense_a` and `dense_b`. If `sparse_or_dense_a` or\n    `dense_b` is adjointed through `kwargs` then the shape is adjusted\n    accordingly.\n  \"\"\"\n  with tf.name_scope(name or 'sparse_or_dense_matmul'):\n    dense_b = tf.convert_to_tensor(\n        dense_b, dtype_hint=tf.float32, name='dense_b')\n\n    if validate_args:\n      assert_a_rank_at_least_2 = assert_util.assert_rank_at_least(\n          sparse_or_dense_a,\n          rank=2,\n          message='Input `sparse_or_dense_a` must have at least 2 dimensions.')\n      assert_b_rank_at_least_2 = assert_util.assert_rank_at_least(\n          dense_b,\n          rank=2,\n          message='Input `dense_b` must have at least 2 dimensions.')\n      with tf.control_dependencies(\n          [assert_a_rank_at_least_2, assert_b_rank_at_least_2]):\n        sparse_or_dense_a = tf.identity(sparse_or_dense_a)\n        dense_b = tf.identity(dense_b)\n\n    if isinstance(sparse_or_dense_a, (tf.SparseTensor, tf1.SparseTensorValue)):\n      return _sparse_tensor_dense_matmul(sparse_or_dense_a, dense_b, **kwargs)\n    else:\n      return tf.matmul(sparse_or_dense_a, dense_b, **kwargs)\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/tensorflow/probability/blob/df8c454f10495cc8584d0540e202911b61bce312/tensorflow_probability/python/math/linalg.py#L837-L885",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F257"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=tensorflow%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F241"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import tensorflow as tf\n\na = tf.constant([[1., 2.], [3., 4.]])\nprint(tf.linalg.matmul(a, a))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://www.tensorflow.org/api_docs/python/tf/linalg/matmul",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F246"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pytensor",
          "name": [
            {
              "t": "fact",
              "fact": "F260"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/pymc-devs/pytensor"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pytensor"
            },
            {
              "label": "Docs",
              "href": "https://pytensor.readthedocs.io/en/latest/library/tensor/linalg.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F267"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F261"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F269"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F263"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F262"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pytensor.readthedocs.io/en/latest/library/tensor/linalg.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F260"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import pytensor\nimport pytensor.tensor as pt\n\nx = pt.matrix(\"x\")\nf = pytensor.function([x], pt.linalg.det(x))\nprint(f([[1., 2.], [3., 4.]]))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pytensor.readthedocs.io/en/latest/library/tensor/linalg.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "linalg.html"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pytensor%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F260"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F265"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python matrix library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#numpy",
          "label": [
            {
              "t": "text",
              "text": "NumPy"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits dense matrices on the CPU. "
        },
        {
          "t": "link",
          "href": "#scipy",
          "label": [
            {
              "t": "text",
              "text": "SciPy"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits sparse matrices and adds solvers that work on them. "
        },
        {
          "t": "link",
          "href": "#pytorch",
          "label": [
            {
              "t": "text",
              "text": "PyTorch"
            }
          ]
        },
        {
          "t": "text",
          "text": " and "
        },
        {
          "t": "link",
          "href": "#jax",
          "label": [
            {
              "t": "text",
              "text": "JAX"
            }
          ]
        },
        {
          "t": "text",
          "text": " suit matrix work on GPUs and other accelerators."
        }
      ]
    },
    {
      "q": "How do I multiply matrices in Python?",
      "a": [
        {
          "t": "link",
          "href": "#numpy",
          "label": [
            {
              "t": "text",
              "text": "NumPy"
            }
          ]
        },
        {
          "t": "text",
          "text": " multiplies two arrays as matrices with the @ operator or the matmul function."
        }
      ]
    },
    {
      "q": "What is a NumPy matrix?",
      "a": [
        {
          "t": "link",
          "href": "#numpy",
          "label": [
            {
              "t": "text",
              "text": "NumPy"
            }
          ]
        },
        {
          "t": "text",
          "text": " represents a matrix as a two-dimensional ndarray, the same array type it uses for every other shape."
        }
      ]
    },
    {
      "q": "How do I create a sparse matrix in Python?",
      "a": [
        {
          "t": "link",
          "href": "#scipy",
          "label": [
            {
              "t": "text",
              "text": "SciPy"
            }
          ]
        },
        {
          "t": "text",
          "text": " provides sparse arrays and matrices in several storage formats, each with its own operations. The legacy csr_matrix class remains documented alongside the newer sparse arrays."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, numpy",
      "display": "NumPy",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, numpy",
      "display": "1.1B",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, numpy",
      "display": "BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, numpy",
      "display": "2.5.4, Oct 2026",
      "asOf": "2026-10-10"
    },
    "F5": {
      "label": "Package release date, numpy",
      "display": "Oct 2026",
      "asOf": "2026-10-10"
    },
    "F6": {
      "label": "Repository stars, numpy",
      "display": "33.4K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Solves linear systems, numpy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Eigenvalues, numpy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Install, numpy",
      "display": "pip install numpy",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "What it does, numpy",
      "display": "Computes numerical linear algebra using arrays and BLAS/LAPACK routines.",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "strengths lead, numpy",
      "display": "Uses arrays for matrix products",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "strengths, numpy",
      "display": "Use @ for products between two-dimensional arrays.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, numpy",
      "display": "Solves dense linear systems",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, numpy",
      "display": "Call linalg.solve for square systems with independent rows.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "limitations lead, numpy",
      "display": "Solve requires full-rank square systems",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "limitations, numpy",
      "display": "Use lstsq for least-squares solutions when solve assumptions fail.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, numpy",
      "display": "Matrix class is discouraged",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, numpy",
      "display": "Use two-dimensional arrays for new linear algebra code.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "Quickstart, numpy",
      "display": "import numpy as np\n\na = np.array([[1, 2], [3, 5]])\n\nb = np.array([1, 2])\n\nx = np.linalg.solve(a, b)\n\nx\n",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "Project function, numpy",
      "display": "def row_norms(X, squared=False):\n    \"\"\"Row-wise (squared) Euclidean norm of X.\n\n    Equivalent to np.sqrt((X * X).sum(axis=1)), but also supports sparse\n    matrices and does not create an X.shape-sized temporary.\n\n    Performs no input validation.\n\n    Parameters\n    ----------\n    X : array-like\n        The input array.\n    squared : bool, default=False\n        If True, return squared norms.\n\n    Returns\n    -------\n    array-like\n        The row-wise (squared) Euclidean norm of X.\n    \"\"\"\n    if sparse.issparse(X):\n        X = X.tocsr()\n        norms = csr_row_norms(X)\n        if not squared:\n            norms = np.sqrt(norms)\n    else:\n        xp, _ = get_namespace(X)\n        if _is_numpy_namespace(xp):\n            X = np.asarray(X)\n            norms = np.einsum(\"ij,ij->i\", X, X)\n            norms = xp.asarray(norms)\n        else:\n            norms = xp.sum(xp.multiply(X, X), axis=1)\n        if not squared:\n            norms = xp.sqrt(norms)\n    return norms\n",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Project function reference, numpy",
      "display": "extmath.py · row_norms()",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project repository, numpy",
      "display": "scikit-learn/scikit-learn",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project stars, scikit-learn/scikit-learn",
      "display": "68.2K",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project push date, scikit-learn/scikit-learn",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F25": {
      "label": "Library name, scipy",
      "display": "SciPy",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Monthly downloads, scipy",
      "display": "379.9M",
      "asOf": "2026-11-16"
    },
    "F27": {
      "label": "License, scipy",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Package release, scipy",
      "display": "1.18.1, Aug 2026",
      "asOf": "2026-08-21"
    },
    "F29": {
      "label": "Package release date, scipy",
      "display": "Aug 2026",
      "asOf": "2026-08-21"
    },
    "F30": {
      "label": "Repository stars, scipy",
      "display": "15.2K",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Sparse matrices, scipy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Solves linear systems, scipy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Eigenvalues, scipy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Matrix exponentials, scipy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Install, scipy",
      "display": "pip install scipy",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "What it does, scipy",
      "display": "Provides sparse matrix storage, numerical solvers, and matrix functions.",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "strengths lead, scipy",
      "display": "Solves sparse linear systems",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths, scipy",
      "display": "Use spsolve with sparse coefficients and vector or matrix right-hand sides.",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths lead, scipy",
      "display": "Computes matrix exponentials",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths, scipy",
      "display": "Use expm for the matrix exponential rather than element-wise exponentiation.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "limitations lead, scipy",
      "display": "Sparse arrays need sparse-aware operations",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations, scipy",
      "display": "Use sparse operations or convert explicitly before applying NumPy functions.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations lead, scipy",
      "display": "Incorrect structure hints corrupt solutions",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations, scipy",
      "display": "Only set assume_a when the matrix has the stated structure.",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "Quickstart, scipy",
      "display": "import numpy as np\n\na = np.array([[3, 2, 0], [1, -1, 0], [0, 5, 1]])\n\nb = np.array([2, 4, -1])\n\nfrom scipy.linalg import solve\n\nx = solve(a, b)\n\nx\n\na @ x == b\n",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Project function, scipy",
      "display": "def scipy_spsolve(A, b):\n    logger.debug(\"Scipy Solver - Solving linear system with scipy.sparse.linalg.spsolve\")\n    indptr, indices, data = A.getValuesCSR()\n    Asp = scipy.sparse.csr_matrix((data, indices, indptr))\n    # SciPy's spsolve uses UMFPACK only when scikits.umfpack is installed and\n    # applicable; otherwise it falls back to SuperLU.\n    x = scipy.sparse.linalg.spsolve(Asp, onp.array(b))\n\n    # TODO: try https://jax.readthedocs.io/en/latest/_autosummary/jax.experimental.sparse.linalg.spsolve.html\n    # x = jax.experimental.sparse.linalg.spsolve(av, aj, ai, b)\n\n    logger.debug(\"Scipy Solver - Finished solving, linear solve res = %.3g\",\n                 np.linalg.norm(Asp @ x - b))\n    return x\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function reference, scipy",
      "display": "solver.py · scipy_spsolve()",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project repository, scipy",
      "display": "deepmodeling/jax-fem",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project stars, deepmodeling/jax-fem",
      "display": "784",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project push date, deepmodeling/jax-fem",
      "display": "Oct 2026",
      "asOf": "2026-10-09"
    },
    "F51": {
      "label": "Library name, sympy",
      "display": "SymPy",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Monthly downloads, sympy",
      "display": "163.1M",
      "asOf": "2026-11-16"
    },
    "F53": {
      "label": "License, sympy",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Package release, sympy",
      "display": "1.14.0, Apr 2025",
      "asOf": "2025-04-27"
    },
    "F55": {
      "label": "Package release date, sympy",
      "display": "Apr 2025",
      "asOf": "2025-04-27"
    },
    "F56": {
      "label": "Repository stars, sympy",
      "display": "15.1K",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Sparse matrices, sympy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Solves linear systems, sympy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Eigenvalues, sympy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Matrix exponentials, sympy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Install, sympy",
      "display": "pip install sympy",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "What it does, sympy",
      "display": "Performs matrix algebra with symbolic entries and exact expressions.",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "strengths lead, sympy",
      "display": "Works with symbolic matrix entries",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths, sympy",
      "display": "Keep symbolic values in matrix calculations.",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths lead, sympy",
      "display": "Returns eigenvalue multiplicities",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths, sympy",
      "display": "Use eigenvals for eigenvalues and their algebraic multiplicities.",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "limitations lead, sympy",
      "display": "Symbolic zeros can be inconclusive",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations, sympy",
      "display": "Pass iszerofunc when simplification cannot identify zero entries.",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations lead, sympy",
      "display": "Mutable matrices restrict expression use",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations, sympy",
      "display": "Use ImmutableMatrix inside expressions that require immutable values.",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Quickstart, sympy",
      "display": "from sympy import Matrix\n\nM = Matrix(3, 3, [0, 1, 1, 1, 0, 0, 1, 1, 1])\n\nM.eigenvals()\n",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Project function, sympy",
      "display": "def _apply_geometric_transformations(self, theta, mu, symbolic):\n\n    if symbolic:\n        # Angle symbolique qui paramètre la rotation du joint en cours\n        symbolic_frame_matrix = np.eye(4)\n\n        # Apply translation matrix\n        symbolic_frame_matrix = symbolic_frame_matrix * sympy.Matrix(geometry.homogeneous_translation_matrix(*self.origin_translation))\n\n        # Apply orientation matrix\n        symbolic_frame_matrix = symbolic_frame_matrix * geometry.cartesian_to_homogeneous(geometry.rpy_matrix(*self.origin_orientation))\n\n        # Apply rotation matrix\n        if self.has_rotation:\n            symbolic_frame_matrix = symbolic_frame_matrix * geometry.cartesian_to_homogeneous(geometry.symbolic_axis_rotation_matrix(self.rotation, theta), matrix_type=\"sympy\")\n\n        # Apply translation\n        if self.has_translation:\n            translation_vector = self.translation * mu\n            symbolic_frame_matrix = symbolic_frame_matrix * geometry.get_symbolic_translation_matrix(translation_vector)\n\n        symbolic_frame_matrix = sympy.lambdify([theta, mu], symbolic_frame_matrix, \"numpy\")\n\n        return symbolic_frame_matrix\n\n    else:\n        # Init the transformation matrix\n        frame_matrix = np.eye(4)\n\n        # First, apply translation matrix\n        frame_matrix = np.dot(frame_matrix, geometry.homogeneous_translation_matrix(*self.origin_translation))\n\n        # Apply orientation\n        frame_matrix = np.dot(frame_matrix, geometry.cartesian_to_homogeneous(geometry.rpy_matrix(*self.origin_orientation)))\n\n        # Apply rotation matrix\n        if self.has_rotation:\n            frame_matrix = np.dot(frame_matrix, geometry.cartesian_to_homogeneous(geometry.axis_rotation_matrix(self.rotation, theta)))\n\n        # Apply translation\n        if self.has_translation:\n            translation_vector = self.translation * mu\n            frame_matrix = np.dot(frame_matrix, geometry.get_translation_matrix(translation_vector))\n\n        return frame_matrix\n",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project function reference, sympy",
      "display": "link.py · _apply_geometric_transformations()",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Project repository, sympy",
      "display": "Phylliade/ikpy",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project stars, Phylliade/ikpy",
      "display": "1.0K",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Project push date, Phylliade/ikpy",
      "display": "Nov 2026",
      "asOf": "2026-11-10"
    },
    "F77": {
      "label": "Library name, torch",
      "display": "PyTorch",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Monthly downloads, torch",
      "display": "59.4M",
      "asOf": "2026-11-16"
    },
    "F79": {
      "label": "License, torch",
      "display": "Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND ISC AND MIT AND Zlib",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Package release, torch",
      "display": "2.15.0, Oct 2026",
      "asOf": "2026-10-28"
    },
    "F81": {
      "label": "Package release date, torch",
      "display": "Oct 2026",
      "asOf": "2026-10-28"
    },
    "F82": {
      "label": "Repository stars, torch",
      "display": "105.6K",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Sparse matrices, torch",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "Solves linear systems, torch",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Eigenvalues, torch",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Matrix exponentials, torch",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "Install, torch",
      "display": "pip install torch",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "What it does, torch",
      "display": "Computes linear algebra over tensors, including batches of matrices.",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "strengths lead, torch",
      "display": "Solves batches of linear systems",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "strengths, torch",
      "display": "Pass batched matrices to linalg.solve instead of looping over each system.",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "strengths lead, torch",
      "display": "Offers compressed sparse tensor layouts",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "strengths, torch",
      "display": "Store sparse matrices using supported coordinate or compressed layouts.",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "limitations lead, torch",
      "display": "Sparse operator coverage is incomplete",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "limitations, torch",
      "display": "Check that the selected sparse layout supports the required operation.",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "limitations lead, torch",
      "display": "Eigenvector gradients need distinct eigenvalues",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "limitations, torch",
      "display": "Repeated eigenvalues prevent finite eigenvector gradients.",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Quickstart, torch",
      "display": "import torch\nimport numpy as np\n\n\nA = torch.randn(3, 3)\n\nb = torch.randn(3)\n\nx = torch.linalg.solve(A, b)\n\ntorch.allclose(A @ x, b)\n\nA = torch.randn(2, 3, 3)\n\nB = torch.randn(2, 3, 4)\n\nX = torch.linalg.solve(A, B)\n\nX.shape\n\ntorch.allclose(A @ X, B)\n\nA = torch.randn(2, 3, 3)\n\nb = torch.randn(3, 1)\n\nx = torch.linalg.solve(A, b) # b is broadcasted to size (2, 3, 1)\n\nx.shape\n\ntorch.allclose(A @ x, b)\n\nb = torch.randn(3)\n\nx = torch.linalg.solve(A, b) # b is broadcasted to size (2, 3)\n\nx.shape\n\nAx = A @ x.unsqueeze(-1)\n\ntorch.allclose(Ax, b.unsqueeze(-1).expand_as(Ax))\n",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Project function, torch",
      "display": "def focus_of_attention(poses: Float[Tensor, \"*num_poses 4 4\"], initial_focus: Float[Tensor, \"3\"]) -> Float[Tensor, \"3\"]:\n    \"\"\"Compute the focus of attention of a set of cameras. Only cameras\n    that have the focus of attention in front of them are considered.\n\n     Args:\n        poses: The poses to orient.\n        initial_focus: The 3D point views to decide which cameras are initially activated.\n\n    Returns:\n        The 3D position of the focus of attention.\n    \"\"\"\n    # References to the same method in third-party code:\n    # https://github.com/google-research/multinerf/blob/1c8b1c552133cdb2de1c1f3c871b2813f6662265/internal/camera_utils.py#L145\n    # https://github.com/bmild/nerf/blob/18b8aebda6700ed659cb27a0c348b737a5f6ab60/load_llff.py#L197\n    active_directions = -poses[:, :3, 2:3]\n    active_origins = poses[:, :3, 3:4]\n    # initial value for testing if the focus_pt is in front or behind\n    focus_pt = initial_focus\n    # Prune cameras which have the current have the focus_pt behind them.\n    active = torch.sum(active_directions.squeeze(-1) * (focus_pt - active_origins.squeeze(-1)), dim=-1) > 0\n    done = False\n    # We need at least two active cameras, else fallback on the previous solution.\n    # This may be the \"poses\" solution if no cameras are active on first iteration, e.g.\n    # they are in an outward-looking configuration.\n    while torch.sum(active.int()) > 1 and not done:\n        active_directions = active_directions[active]\n        active_origins = active_origins[active]\n        # https://en.wikipedia.org/wiki/Line–line_intersection#In_more_than_two_dimensions\n        m = torch.eye(3) - active_directions * torch.transpose(active_directions, -2, -1)\n        mt_m = torch.transpose(m, -2, -1) @ m\n        focus_pt = torch.linalg.inv(mt_m.mean(0)) @ (mt_m @ active_origins).mean(0)[:, 0]\n        active = torch.sum(active_directions.squeeze(-1) * (focus_pt - active_origins.squeeze(-1)), dim=-1) > 0\n        if active.all():\n            # the set of active cameras did not change, so we're done.\n            done = True\n    return focus_pt\n",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Project function reference, torch",
      "display": "camera_utils.py · focus_of_attention()",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Project repository, torch",
      "display": "nerfstudio-project/nerfstudio",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Project stars, nerfstudio-project/nerfstudio",
      "display": "12.2K",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Project push date, nerfstudio-project/nerfstudio",
      "display": "Jul 2025",
      "asOf": "2025-07-29"
    },
    "F103": {
      "label": "Developer need",
      "display": "Using arrays for matrix products",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Why choose numpy",
      "display": "native array matrix multiplication",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need in introduction",
      "display": "using arrays for matrix products",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "When to consider scipy",
      "display": "sparse coefficient storage and sparse solving are required",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need",
      "display": "Solving sparse numerical systems",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Why choose scipy",
      "display": "sparse-system solver APIs",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Developer need in introduction",
      "display": "solving sparse numerical systems",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "When to consider sympy",
      "display": "matrix entries must stay symbolic",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Developer need",
      "display": "Working with symbolic entries",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "Why choose sympy",
      "display": "symbolic matrix expressions",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "Developer need in introduction",
      "display": "working with symbolic entries",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "When to consider numpy",
      "display": "array-based numerical matrix products fit the task",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "Developer need",
      "display": "Solving batches of tensor systems",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "Why choose torch",
      "display": "batched linear solves",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "Developer need in introduction",
      "display": "solving batches of tensor systems",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "Page introduction",
      "display": "Python matrix libraries let developers compute with matrices and solve linear algebra problems.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Should new NumPy code use the matrix class?",
      "display": "NumPy recommends arrays rather than its legacy matrix class for linear algebra.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: What does the matrix product operator do?",
      "display": "For two-dimensional NumPy arrays, @ is the preferred matrix product operator.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: When should NumPy solve be replaced with least squares?",
      "display": "solve expects a square, full-rank coefficient matrix; use lstsq when those assumptions fail.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Can NumPy operations be applied directly to SciPy sparse arrays?",
      "display": "Use sparse-aware operations or convert explicitly; NumPy typically treats sparse arrays as generic objects.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: What does SciPy spsolve accept?",
      "display": "It solves sparse systems with a vector or matrix right-hand side.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Can a SciPy matrix-structure hint produce a wrong answer?",
      "display": "An incorrect diagonal assume_a setting produces an incorrect solution in the own example.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Is a matrix exponential the same as element-wise exponentiation?",
      "display": "SciPy expm computes the matrix exponential.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Is a matrix exponential the same as element-wise exponentiation?",
      "display": "PyTorch separately exposes matrix_exp for a square matrix.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: What does SymPy return for eigenvalues?",
      "display": "eigenvals returns a dictionary mapping eigenvalues to algebraic multiplicities.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: Why can a symbolic matrix operation fail on a zero expression?",
      "display": "SymPy zero testing can return an inconclusive result for complicated expressions.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "FAQ: Why can a symbolic matrix operation fail on a zero expression?",
      "display": "iszerofunc lets the caller supply a custom zero test.",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "FAQ: Can a mutable SymPy matrix be embedded in another expression?",
      "display": "Matrix cannot occupy contexts requiring immutability; use ImmutableMatrix there.",
      "asOf": "2026-11-17"
    },
    "F131": {
      "label": "FAQ: Can PyTorch solve a batch of matrix systems?",
      "display": "linalg.solve supports batched coefficient matrices and broadcasts compatible right-hand sides.",
      "asOf": "2026-11-17"
    },
    "F132": {
      "label": "FAQ: Are eigenvector gradients well behaved at repeated eigenvalues?",
      "display": "PyTorch eig eigenvector gradients are only finite with distinct eigenvalues and become unstable near repeated values.",
      "asOf": "2026-11-17"
    },
    "F133": {
      "label": "Library name, numpy",
      "display": "NumPy",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Monthly downloads, numpy",
      "display": "1.1B",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "License, numpy",
      "display": "BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Package release, numpy",
      "display": "2.5.5",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Package release date, numpy",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Install, numpy",
      "display": "pip install numpy",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Quickstart, numpy",
      "display": "import numpy as np\n\na = np.array([[1, 2], [3, 5]])\n\nb = np.array([1, 2])\n\nx = np.linalg.solve(a, b)\n\nx\n",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Repository stars, numpy",
      "display": "33.4K",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Sparse matrices, numpy",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "GPU matrix execution, numpy",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Python prerequisite, numpy",
      "display": ">=3.12",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Runtime and setup, numpy",
      "display": "Whole original doctest inputs with import, arrays and solve, retaining the final expression. Prompts/expected output separated by the standard doctest parser without execution; no statements or numbers changed. REPL/source-form review remains Open.",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Project integration constraints, numpy",
      "display": "Dense NumPy branch calls asarray, einsum(\"ij,ij->i\",X,X), and sqrt(...,out=norms). Current2.5 accepts these operands/subscripts/output buffer. Sparse/array-API branches are host integrations, not counted as extra NumPy operations.",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Published distribution license expression, numpy",
      "display": "BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Project function, numpy",
      "display": "def row_norms(X, squared=False):\n    \"\"\"Row-wise (squared) Euclidean norm of X.\n\n    Equivalent to np.sqrt((X * X).sum(axis=1)), but also supports sparse\n    matrices and does not create an X.shape-sized temporary.\n\n    Performs no input validation.\n\n    Parameters\n    ----------\n    X : array-like\n        The input array.\n    squared : bool, default=False\n        If True, return squared norms.\n\n    Returns\n    -------\n    array-like\n        The row-wise (squared) Euclidean norm of X.\n    \"\"\"\n    if sparse.issparse(X):\n        X = X.tocsr()\n        norms = csr_row_norms(X)\n        if not squared:\n            norms = np.sqrt(norms)\n    else:\n        xp, _ = get_namespace(X)\n        if _is_numpy_namespace(xp):\n            X = np.asarray(X)\n            norms = np.einsum(\"ij,ij->i\", X, X)\n            norms = xp.asarray(norms)\n        else:\n            norms = xp.sum(xp.multiply(X, X), axis=1)\n        if not squared:\n            norms = xp.sqrt(norms)\n    return norms\n",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Project source file, numpy",
      "display": "sklearn/utils/extmath.py",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Project full_name, numpy",
      "display": "scikit-learn/scikit-learn",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Project stargazers_count, numpy",
      "display": "68.2K",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Library name, scipy",
      "display": "SciPy",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Monthly downloads, scipy",
      "display": "392.1M",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "License, scipy",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Package release, scipy",
      "display": "1.18.1",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Package release date, scipy",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Install, scipy",
      "display": "pip install scipy",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Quickstart, scipy",
      "display": "import numpy as np\n\na = np.array([[3, 2, 0], [1, -1, 0], [0, 5, 1]])\n\nb = np.array([2, 4, -1])\n\nfrom scipy.linalg import solve\n\nx = solve(a, b)\n\nx\n\na @ x == b\n",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Repository stars, scipy",
      "display": "15.2K",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Sparse matrices, scipy",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "GPU matrix execution, scipy",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Python prerequisite, scipy",
      "display": ">=3.12",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Runtime and setup, scipy",
      "display": "Whole original own block including NumPy input creation, SciPy solve and matrix-product equality check. Prompts/expected output separated without running it. It illustrates a fixed small example, not a general floating-point residual tolerance recommendation. No array, solve or check ran.",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Project integration constraints, scipy",
      "display": "Current1.18 CSR constructor accepts (data,indices,indptr); spsolve accepts coefficient sparse matrix and dense right-hand side. PETSc getValuesCSR and NumPy onp.array are host prerequisites, not additional SciPy native calls.",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Project function, scipy",
      "display": "def scipy_spsolve(A, b):\n    logger.debug(\"Scipy Solver - Solving linear system with scipy.sparse.linalg.spsolve\")\n    indptr, indices, data = A.getValuesCSR()\n    Asp = scipy.sparse.csr_matrix((data, indices, indptr))\n    # SciPy's spsolve uses UMFPACK only when scikits.umfpack is installed and\n    # applicable; otherwise it falls back to SuperLU.\n    x = scipy.sparse.linalg.spsolve(Asp, onp.array(b))\n\n    # TODO: try https://jax.readthedocs.io/en/latest/_autosummary/jax.experimental.sparse.linalg.spsolve.html\n    # x = jax.experimental.sparse.linalg.spsolve(av, aj, ai, b)\n\n    logger.debug(\"Scipy Solver - Finished solving, linear solve res = %.3g\",\n                 np.linalg.norm(Asp @ x - b))\n    return x\n",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Project source file, scipy",
      "display": "jax_fem/solver.py",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Project full_name, scipy",
      "display": "deepmodeling/jax-fem",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Project stargazers_count, scipy",
      "display": "784",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Library name, sympy",
      "display": "SymPy",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Monthly downloads, sympy",
      "display": "169.9M",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "License, sympy",
      "display": "BSD",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Package release, sympy",
      "display": "1.14.0",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Package release date, sympy",
      "display": "Apr 2025",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Install, sympy",
      "display": "pip install sympy",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Quickstart, sympy",
      "display": "from sympy import Matrix\n\nM = Matrix(3, 3, [0, 1, 1, 1, 0, 0, 1, 1, 1])\n\nM.eigenvals()\n",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Repository stars, sympy",
      "display": "15.1K",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Sparse matrices, sympy",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "GPU matrix execution, sympy",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Python prerequisite, sympy",
      "display": ">=3.9",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Runtime and setup, sympy",
      "display": "Whole original own import, Matrix construction and eigenvals input sequence. Standard doctest parsing removes prompts/expected display only. Exact source numbers and final expression remain; no symbolic calculation ran.",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project integration constraints, sympy",
      "display": "Current1.14 Matrix accepts the project numeric homogeneous translation matrix; symbolic matrix products feed lambdify([theta,mu],matrix,\"numpy\"). These positional args and NumPy-module selector remain public. Host geometry helpers and numeric else-branch are preserved, not relabeled SymPy native calls.",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Project function, sympy",
      "display": "def _apply_geometric_transformations(self, theta, mu, symbolic):\n\n    if symbolic:\n        # Angle symbolique qui paramètre la rotation du joint en cours\n        symbolic_frame_matrix = np.eye(4)\n\n        # Apply translation matrix\n        symbolic_frame_matrix = symbolic_frame_matrix * sympy.Matrix(geometry.homogeneous_translation_matrix(*self.origin_translation))\n\n        # Apply orientation matrix\n        symbolic_frame_matrix = symbolic_frame_matrix * geometry.cartesian_to_homogeneous(geometry.rpy_matrix(*self.origin_orientation))\n\n        # Apply rotation matrix\n        if self.has_rotation:\n            symbolic_frame_matrix = symbolic_frame_matrix * geometry.cartesian_to_homogeneous(geometry.symbolic_axis_rotation_matrix(self.rotation, theta), matrix_type=\"sympy\")\n\n        # Apply translation\n        if self.has_translation:\n            translation_vector = self.translation * mu\n            symbolic_frame_matrix = symbolic_frame_matrix * geometry.get_symbolic_translation_matrix(translation_vector)\n\n        symbolic_frame_matrix = sympy.lambdify([theta, mu], symbolic_frame_matrix, \"numpy\")\n\n        return symbolic_frame_matrix\n\n    else:\n        # Init the transformation matrix\n        frame_matrix = np.eye(4)\n\n        # First, apply translation matrix\n        frame_matrix = np.dot(frame_matrix, geometry.homogeneous_translation_matrix(*self.origin_translation))\n\n        # Apply orientation\n        frame_matrix = np.dot(frame_matrix, geometry.cartesian_to_homogeneous(geometry.rpy_matrix(*self.origin_orientation)))\n\n        # Apply rotation matrix\n        if self.has_rotation:\n            frame_matrix = np.dot(frame_matrix, geometry.cartesian_to_homogeneous(geometry.axis_rotation_matrix(self.rotation, theta)))\n\n        # Apply translation\n        if self.has_translation:\n            translation_vector = self.translation * mu\n            frame_matrix = np.dot(frame_matrix, geometry.get_translation_matrix(translation_vector))\n\n        return frame_matrix\n",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Project source file, sympy",
      "display": "src/ikpy/link.py",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Project full_name, sympy",
      "display": "Phylliade/ikpy",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Project stargazers_count, sympy",
      "display": "1.0K",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Library name, torch",
      "display": "PyTorch",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Monthly downloads, torch",
      "display": "59.5M",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "License, torch",
      "display": "Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND ISC AND MIT AND Zlib",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Package release, torch",
      "display": "2.15.0",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Package release date, torch",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Install, torch",
      "display": "pip install torch",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Quickstart, torch",
      "display": "import torch\n\nA = torch.randn(3, 3)\nb = torch.randn(3)\nx = torch.linalg.solve(A, b)\nprint(x)\n",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Repository stars, torch",
      "display": "105.6K",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Sparse matrices, torch",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "GPU matrix execution, torch",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Python prerequisite, torch",
      "display": ">=3.11",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Runtime and setup, torch",
      "display": "Python>=3.11 and selected PyTorch package on a supported CPU platform. Coherent first official solve case: random3x3coefficient matrix and3vector RHS, one solve, ordinary print glue. Coefficient matrix must be nonsingular; no seeded/expected output or numerical guarantee. Later unrelated broadcast/batch examples and unused NumPy import omitted in disclosed recipe.",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Project integration constraints, torch",
      "display": "Current2.15 eye(3), transpose(input,-2,-1), inverse of square batched mean normal matrix, Tensor matmul, reductions,indexing,and squeeze remain supported. CPU/default dtype eye in unchanged function constrains poses/initial_focus to compatible device/dtype; no automatic GPU repair claimed.",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Published distribution license expression, torch",
      "display": "Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND ISC AND MIT AND Zlib",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Project function, torch",
      "display": "def focus_of_attention(poses: Float[Tensor, \"*num_poses 4 4\"], initial_focus: Float[Tensor, \"3\"]) -> Float[Tensor, \"3\"]:\n    \"\"\"Compute the focus of attention of a set of cameras. Only cameras\n    that have the focus of attention in front of them are considered.\n\n     Args:\n        poses: The poses to orient.\n        initial_focus: The 3D point views to decide which cameras are initially activated.\n\n    Returns:\n        The 3D position of the focus of attention.\n    \"\"\"\n    # References to the same method in third-party code:\n    # https://github.com/google-research/multinerf/blob/1c8b1c552133cdb2de1c1f3c871b2813f6662265/internal/camera_utils.py#L145\n    # https://github.com/bmild/nerf/blob/18b8aebda6700ed659cb27a0c348b737a5f6ab60/load_llff.py#L197\n    active_directions = -poses[:, :3, 2:3]\n    active_origins = poses[:, :3, 3:4]\n    # initial value for testing if the focus_pt is in front or behind\n    focus_pt = initial_focus\n    # Prune cameras which have the current have the focus_pt behind them.\n    active = torch.sum(active_directions.squeeze(-1) * (focus_pt - active_origins.squeeze(-1)), dim=-1) > 0\n    done = False\n    # We need at least two active cameras, else fallback on the previous solution.\n    # This may be the \"poses\" solution if no cameras are active on first iteration, e.g.\n    # they are in an outward-looking configuration.\n    while torch.sum(active.int()) > 1 and not done:\n        active_directions = active_directions[active]\n        active_origins = active_origins[active]\n        # https://en.wikipedia.org/wiki/Line–line_intersection#In_more_than_two_dimensions\n        m = torch.eye(3) - active_directions * torch.transpose(active_directions, -2, -1)\n        mt_m = torch.transpose(m, -2, -1) @ m\n        focus_pt = torch.linalg.inv(mt_m.mean(0)) @ (mt_m @ active_origins).mean(0)[:, 0]\n        active = torch.sum(active_directions.squeeze(-1) * (focus_pt - active_origins.squeeze(-1)), dim=-1) > 0\n        if active.all():\n            # the set of active cameras did not change, so we're done.\n            done = True\n    return focus_pt\n",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Project source file, torch",
      "display": "nerfstudio/cameras/camera_utils.py",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Project full_name, torch",
      "display": "nerfstudio-project/nerfstudio",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Project stargazers_count, torch",
      "display": "12.2K",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Library name, dask",
      "display": "Dask Array",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Monthly downloads, dask",
      "display": "31.6M",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "License, dask",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Package release, dask",
      "display": "2026.8.0",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Package release date, dask",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Install, dask",
      "display": "pip install \"dask[array]\"",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Quickstart, dask",
      "display": "import dask.array as da\n\nx = da.eye(2, chunks=2)\nu, s, v = da.linalg.svd(x)\nprint(s.compute())\n",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Official description, dask",
      "display": "Runs PyData workloads in parallel with task scheduling.",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Quickstart source file, dask",
      "display": "array-api and generated/dask.array.linalg.svd.html",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Repository stars, dask",
      "display": "14.0K",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Sparse matrices, dask",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "GPU matrix execution, dask",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Python prerequisite, dask",
      "display": ">=3.10",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Runtime and setup, dask",
      "display": "Python>=3.10 and dask[array] extra. One2x2chunk avoids SVD multi-chunk restrictions. compute() materializes the lazy singular values using local scheduler; no cluster or service required.",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Project integration constraints, dask",
      "display": "Module binds da=dask.array and compute=dask.compute. Native svd(X) branch requires applicable single-axis chunking; compressed branch passes rank,n_power_iter,seed supported by current API. Array var(axis=0),sum(),arithmetic,and optional compute(*collections) remain current. Host estimator validation/sign flip are separate helpers.",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Project function, dask",
      "display": "def fit_transform(self, X, y=None):\n    \"\"\"Fit model to X and perform dimensionality reduction on X.\n\n    Parameters\n    ----------\n    X : array-like, shape (n_samples, n_features)\n        Training data.\n\n    y : Ignored\n\n    Returns\n    -------\n    X_new : array, shape (n_samples, n_components)\n        Reduced version of X. This will always be a dense array, of the\n        same type as the input array. If ``X`` was a ``dask.array``, then\n        ``X_new`` will be a ``dask.array`` with the same chunks along the\n        first dimension.\n    \"\"\"\n    X = self._check_array(X)\n    if self.algorithm not in {\"tsqr\", \"randomized\"}:\n        raise ValueError(\n            \"`algorithm` must be 'tsqr' or 'randomized', not '{}'\".format(\n                self.algorithm\n            )\n        )\n    if self.algorithm == \"tsqr\":\n        u, s, v = da.linalg.svd(X)\n        u = u[:, : self.n_components]\n        s = s[: self.n_components]\n        v = v[: self.n_components]\n    else:\n        u, s, v = da.linalg.svd_compressed(\n            X, self.n_components, n_power_iter=self.n_iter, seed=self.random_state\n        )\n    if not DASK_2_26_0:\n        u, v = svd_flip(u, v)\n\n    X_transformed = u * s\n    explained_var = X_transformed.var(axis=0)\n    full_var = X.var(axis=0).sum()\n    explained_variance_ratio = explained_var / full_var\n\n    if self.compute:\n        v, explained_var, explained_variance_ratio, s = compute(\n            v, explained_var, explained_variance_ratio, s\n        )\n    self.components_ = v\n    self.explained_variance_ = explained_var\n    self.explained_variance_ratio_ = explained_variance_ratio\n    self.singular_values_ = s\n    self.n_features_in_ = X.shape[1]\n    return X_transformed\n",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Project source file, dask",
      "display": "dask_ml/decomposition/truncated_svd.py",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Project full_name, dask",
      "display": "dask/dask-ml",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Project stargazers_count, dask",
      "display": "951",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Library name, jax",
      "display": "JAX",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Monthly downloads, jax",
      "display": "12.8M",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "License, jax",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Package release, jax",
      "display": "0.12.1",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Package release date, jax",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Install, jax",
      "display": "pip install jax",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Quickstart, jax",
      "display": "import jax.numpy as jnp\n\nx = jnp.array([[1., 2., 3.], [4., 5., 7.]])\nprint(jnp.linalg.norm(x))\n",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Official description, jax",
      "display": "Differentiates, compiles, and transforms NumPy code.",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Quickstart source file, jax",
      "display": "_autosummary/jax.numpy.linalg.norm.html and README.md",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Repository stars, jax",
      "display": "36.6K",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Sparse matrices, jax",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "GPU matrix execution, jax",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Python prerequisite, jax",
      "display": ">=3.12",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Runtime and setup, jax",
      "display": "Python>=3.12, compatible jaxlib resolved by package. CPU-first matrix Frobenius norm call; GPU/TPU needs separate compatible backend installation. JAX default32bit precision is not silently changed.",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Project integration constraints, jax",
      "display": "Whole module imports jax.numpy as np. jacfwd(operator_fn) returns derivative callable; zeros(problem.num_total_dofs_all_vars) is its numeric input. For intended differentiable vector-to-vector operator, Jacobian is a matrix. No SciPy/PETSc operation counted as JAX.",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Project function, jax",
      "display": "def operator_to_matrix(operator_fn, problem):\n    \"\"\"Only used for when debugging.\n    Can be used to print the matrix, check the conditional number, etc.\n    \"\"\"\n    J = jax.jacfwd(operator_fn)(np.zeros(problem.num_total_dofs_all_vars))\n    return J\n",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Project source file, jax",
      "display": "jax_fem/solver.py",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Project full_name, jax",
      "display": "deepmodeling/jax-fem",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Project stargazers_count, jax",
      "display": "784",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Library name, tensorflow",
      "display": "TensorFlow",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Monthly downloads, tensorflow",
      "display": "12.4M",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "License, tensorflow",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Package release, tensorflow",
      "display": "2.21.0",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Package release date, tensorflow",
      "display": "Mar 2026",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Install, tensorflow",
      "display": "pip install tensorflow",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Quickstart, tensorflow",
      "display": "import tensorflow as tf\n\na = tf.constant([[1., 2.], [3., 4.]])\nprint(tf.linalg.matmul(a, a))\n",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Official description, tensorflow",
      "display": "Provides an open source machine learning framework.",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Quickstart source file, tensorflow",
      "display": "tf.linalg.matmul and tf.constant API pages",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Repository stars, tensorflow",
      "display": "201.6K",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Sparse matrices, tensorflow",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "GPU matrix execution, tensorflow",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Python prerequisite, tensorflow",
      "display": ">=3.10",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Runtime and setup, tensorflow",
      "display": "Python>=3.10 and supported TensorFlow platform. Basic eager2x2matrix product, no model,dataset,server,or GPU setup required. Optional GPU hardware/drivers remain separate.",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Project integration constraints, tensorflow",
      "display": "Original module imports tensorflow.compat.v2 as tf and compat.v1 as tf1. Current public name_scope,convert_to_tensor(dtype_hint=float32,name),control_dependencies,identity,and matmul remain supported. SparseTensor/SparseTensorValue type check uses declared public compatibility container. Caller-provided **kwargs must match chosen native matmul/helper; arbitrary future/unknown keys are not certified.",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Project function, tensorflow",
      "display": "def sparse_or_dense_matmul(sparse_or_dense_a,\n                           dense_b,\n                           validate_args=False,\n                           name=None,\n                           **kwargs):\n  \"\"\"Returns (batched) matmul of a SparseTensor (or Tensor) with a Tensor.\n\n  Args:\n    sparse_or_dense_a: `SparseTensor` or `Tensor` representing a (batch of)\n      matrices.\n    dense_b: `Tensor` representing a (batch of) matrices, with the same batch\n      shape as `sparse_or_dense_a`. The shape must be compatible with the shape\n      of `sparse_or_dense_a` and kwargs.\n    validate_args: When `True`, additional assertions might be embedded in the\n      graph.\n      Default value: `False` (i.e., no graph assertions are added).\n    name: Python `str` prefixed to ops created by this function.\n      Default value: 'sparse_or_dense_matmul'.\n    **kwargs: Keyword arguments to `tf.sparse_tensor_dense_matmul` or\n      `tf.matmul`.\n\n  Returns:\n    product: A dense (batch of) matrix-shaped Tensor of the same batch shape and\n    dtype as `sparse_or_dense_a` and `dense_b`. If `sparse_or_dense_a` or\n    `dense_b` is adjointed through `kwargs` then the shape is adjusted\n    accordingly.\n  \"\"\"\n  with tf.name_scope(name or 'sparse_or_dense_matmul'):\n    dense_b = tf.convert_to_tensor(\n        dense_b, dtype_hint=tf.float32, name='dense_b')\n\n    if validate_args:\n      assert_a_rank_at_least_2 = assert_util.assert_rank_at_least(\n          sparse_or_dense_a,\n          rank=2,\n          message='Input `sparse_or_dense_a` must have at least 2 dimensions.')\n      assert_b_rank_at_least_2 = assert_util.assert_rank_at_least(\n          dense_b,\n          rank=2,\n          message='Input `dense_b` must have at least 2 dimensions.')\n      with tf.control_dependencies(\n          [assert_a_rank_at_least_2, assert_b_rank_at_least_2]):\n        sparse_or_dense_a = tf.identity(sparse_or_dense_a)\n        dense_b = tf.identity(dense_b)\n\n    if isinstance(sparse_or_dense_a, (tf.SparseTensor, tf1.SparseTensorValue)):\n      return _sparse_tensor_dense_matmul(sparse_or_dense_a, dense_b, **kwargs)\n    else:\n      return tf.matmul(sparse_or_dense_a, dense_b, **kwargs)\n",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Project source file, tensorflow",
      "display": "tensorflow_probability/python/math/linalg.py",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Project full_name, tensorflow",
      "display": "tensorflow/probability",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Project stargazers_count, tensorflow",
      "display": "4.4K",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "Library name, pytensor",
      "display": "PyTensor",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Monthly downloads, pytensor",
      "display": "1.5M",
      "asOf": "2026-11-20"
    },
    "F262": {
      "label": "License, pytensor",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F263": {
      "label": "Package release, pytensor",
      "display": "3.3.8",
      "asOf": "2026-11-20"
    },
    "F264": {
      "label": "Package release date, pytensor",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F265": {
      "label": "Install, pytensor",
      "display": "pip install pytensor",
      "asOf": "2026-11-20"
    },
    "F266": {
      "label": "Quickstart, pytensor",
      "display": "import pytensor\nimport pytensor.tensor as pt\n\nx = pt.matrix(\"x\")\nf = pytensor.function([x], pt.linalg.det(x))\nprint(f([[1., 2.], [3., 4.]]))\n",
      "asOf": "2026-11-20"
    },
    "F267": {
      "label": "Official description, pytensor",
      "display": "Compiles mathematical expressions for evaluation on CPUs and GPUs.",
      "asOf": "2026-11-20"
    },
    "F268": {
      "label": "Quickstart source file, pytensor",
      "display": "library/tensor/linalg.html and tutorial/adding.html",
      "asOf": "2026-11-20"
    },
    "F269": {
      "label": "Repository stars, pytensor",
      "display": "654",
      "asOf": "2026-11-20"
    },
    "F270": {
      "label": "Sparse matrices, pytensor",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F271": {
      "label": "GPU matrix execution, pytensor",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F272": {
      "label": "Python prerequisite, pytensor",
      "display": "<3.15,>=3.12",
      "asOf": "2026-11-20"
    },
    "F273": {
      "label": "Runtime and setup, pytensor",
      "display": "Python>=3.12, NumPy/SciPy dependencies, and supported PyTensor compilation environment. Native default optimized compilation may use C implementations; FAST_COMPILE is separately documented pure-Python mode. This recipe compiles/evaluates only if user runs it; no graph/compiler executed here.",
      "asOf": "2026-11-20"
    },
    "F274": {
      "label": "Project integration constraints, pytensor",
      "display": "Whole module imports pytensor.tensor as pt and declares JITTER_DEFAULT. Current3.3.8 identity_like(K,dtype=None) accepts a symbolic matrix and returns same-shape/type identity tensor. Adding scalar*jitter to K uses public tensor arithmetic.",
      "asOf": "2026-11-20"
    },
    "F275": {
      "label": "Optional accelerator prerequisites, pytensor",
      "display": "Install JAX separately and configure a supported GPU backend; PyTensor JAX mode compiles only supported graph operations.",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python matrix libraries NumPy SciPy SymPy PyTorch code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
