{"id":19636606,"url":"https://github.com/barton-willis/alt_eigen","last_synced_at":"2026-03-05T04:33:39.591Z","repository":{"id":185305339,"uuid":"673320378","full_name":"barton-willis/alt_eigen","owner":"barton-willis","description":"Maxima language code for expressing eigenvectors in terms of eigenvalues.","archived":false,"fork":false,"pushed_at":"2024-09-01T10:40:24.000Z","size":129,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T21:45:40.124Z","etag":null,"topics":["eigenvalues","eigenvectors","matrix","maxima","nullspace"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barton-willis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-01T11:14:39.000Z","updated_at":"2024-09-01T10:40:28.000Z","dependencies_parsed_at":"2024-06-10T13:27:42.597Z","dependency_job_id":"8c1abf2e-e639-4739-a582-4e5e916235f8","html_url":"https://github.com/barton-willis/alt_eigen","commit_stats":null,"previous_names":["barton-willis/alt_eigen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/barton-willis/alt_eigen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barton-willis%2Falt_eigen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barton-willis%2Falt_eigen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barton-willis%2Falt_eigen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barton-willis%2Falt_eigen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barton-willis","download_url":"https://codeload.github.com/barton-willis/alt_eigen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barton-willis%2Falt_eigen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30110441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eigenvalues","eigenvectors","matrix","maxima","nullspace"],"created_at":"2024-11-11T12:29:57.718Z","updated_at":"2026-03-05T04:33:39.569Z","avatar_url":"https://github.com/barton-willis.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# The alt_eigen package\n\n## Introduction\n\nThe Maxima language `alt_eigen` package expresses eigenvectors in terms of eigenvalues.\n\nTo use this package, you will need to load it manually. Assuming the file\n`alt_eigen.mac` is in a path that Maxima can find, load the package using the command\n\n~~~\n load(\"alt_eigen.mac\")$\n~~~\n\n## Examples\n\nFor our first example, the characteristic polynomial of `matrix([1 , 2],[3 ,-4])` factors over the gaussian integers into a product of first degree terms. So for this matrix, the command `alt_eigen` explicitly finds each eigenvalue and eigenspace:\n\n~~~\n(%i3) M : matrix([1,2],[3,-4]);\n(%o3) matrix([1,2],[3,-4])\n\n(%i4) alt_eigen(M,'var = z, 'maxdegree = 1);\n(%o4) [[z=-5,sspan(matrix([-1],[3]))], [z=2,sspan(matrix([-2],[-1]))]]\n~~~\n\nThe last two arguments to `alt_eigen` are optional and can be in any order.\nThe argument `'var = z` tells Maxima to use the name `z` for the eigenvalue, and the argument `maxdegree = 1` instructs the code to solve every factor of the characteristic polynomial that has degree at most one, where the characteristic polynomial is factored over the gaussian integers.\n\nThe output is a list of lists, with each list member of the form `[eigenvalue, eigenspace]`, where `eigenvalue` is a polynomial in the variable `var` that has been solved for its highest power.\n\nEach eigenspace is represented as the span of a list of column vectors.\nFor the span, the `alt_eigen` package defines a simplifying object `sspan`.\nFor the same purpose, the linear algebra package represents a span using a _nonsimplifying_ `span` object.\n\nFor this $3 \\times 3$ matrix, one factor of the characteristic polynomial has degree two and the other degree one. Thus, when `maxdegree = 1`, one eigenspace is expressed\nin terms of the eigenvalue and the other eigenspace is given explicitly. Changing\nto `maxdegree = 2`, all three eigenspaces are given explicitly:\n\n~~~\n(%i6) M : matrix([1,2,3],[4,5,6],[7,8,9])$\n\n(%i7) alt_eigen(M,'var = z, 'maxdegree = 1);\n(%o7) [[z^2=15*z+18,sspan(matrix([26-2*z],[2-z],[-22]))], \n         [z=0,sspan(matrix([-1],[2],[-1]))]]\n\n(%i8) alt_eigen(M,'var = z, 'maxdegree = 2);\n(%o8) [[z=(3*sqrt(33)+15)/2,sspan(matrix([22-6*sqrt(33)],[-(3*sqrt(33))-11],[-22]))],  \n        [z=-((3*sqrt(33)-15)/2),sspan(matrix([6*sqrt(33)+22],[3*sqrt(33)-11],[-22]))],\n  [z=0,sspan(matrix([-1],[2],[-1]))]]\n~~~\n\nWhen required, the output is enclosed an `assuming` object that includes assumptions about parameters that are necessary for the validity of the answer. Especially when\nused non interactively, a user will need to check if the output is an `assuming` object.\n\n The matrix entries can be symbolic; here is an example\n\n~~~  \n (%i1) M : matrix([1,2],[-1/8,q])$\n (%i2) xxx : alt_eigen(M,'var = z,'maxdegree = 1);\n (%o2) assuming(notequal(-(64*(q-2)*q),0),[[z^2=-((-(4*q*z)-4*z+4*q+1)/4),\n    sspan(matrix([2],[z-1]))]])\n ~~~\n\n Maxima determined that $-64(q-2) q = 0$ is a special case. Substituting $q=2$\n into the above yields `unknown`:\n\n ~~~\n(%i3) subst(q = 2,xxx);\n(%o3) unknown\n ~~~\n\n To find the eigenspace when $q = 2$, you must substitute $q = 2$ before calling `alt_eigen.` But if $q \\neq 2$, say $q = 5$, we can make that substitution in the previous result and find that\n\n ~~~\n(%i5) subst(q=5,xxx);\n(%o5) [[z^2=-((21-24*z)/4),sspan(matrix([2],[z-1]))]]\n ~~~\n\nFor an eigenspace with dimension two or greater, we can optionally apply the\nGram-Schmidt process to find an orthogonal basis for the eigenspace. Here is\nan example\n\n~~~\n(%i2) M : matrix([15714, 24872, 12436], [-1450, -2151, -1160],[-7025, -11240, -5451])$\n\n(%i3) alt_eigen(M,'var = z);\n(%o3) [z=169,[matrix([-8],[5],[0]),matrix([0],[1],[-2])],\n         z=7774,[matrix([3109],[-290],[-1405])]]\n~~~\n\nTo apply Gram-Schmidt to the eigenspace, use the optional argument\n`'orthogonal = true`\n\n~~~\n(%i1) alt_eigen(M,'var = z,'orthogonal = true);\n(%o1) [[z=169,sspan(matrix([-8],[5],[0]),\n             matrix([20],[32],[-89]))],\n   [z=7774,sspan(matrix([3109],[-290],[-1405]))]]\n~~~\n\nWe end with a $5\\times 5$ example. For this example, we anticipate that\n$q = 0$ will be a special case, we start with issuing the Maxima command\n`assume(notequal(q,0))`:\n\n~~~\n(%i4) M : genmatrix(lambda([a,b], if a=b then 1 elseif abs(a-b)=1 then -q else 0),5,5);\n(%o4) matrix([1,-q,0, 0,0],\n   [-q,1,-q,0,0],\n   [0,-q,1,-q,0],\n   [0,0,-q,1,-q],\n   [0,0,0,-q,1])\n(%i5) assume(notequal(q,0))$\n\n(%i6) alt_eigen(M, 'var = z,maxdegree = 1);\n(%o6) [[z^2=2*z+3*q^2-1,sspan(matrix([-q],[z-1],[-2*q],[z-1],[-q]))],\n         [z=1-q,sspan(matrix([1],[1],[0],[-1],[-1]))],\n   [z=q+1,sspan(matrix([1],[-1],[0],[1],[-1]))],\n   [z=1,sspan(matrix([-1],[0],[1],[0],[-1]))]]\n~~~\n\n## Testing\n\nAssuming the file `alt_eigen.mac` is in a path that Maxima can find, to run the tests for this package, issue the command\n~~~\n batch(rtest_alt_eigen,'test);\n~~~\nMaxima version 5.47.0 should complete all the tests with no failures. If you find that some tests fail, please report them to the `alt_eigen` discussion list.\n\n## Name of this package\n\nThe package name `alt_eigen` isn't particularly descriptive. As you likely suspect, the `alt` in the package name is a shortening of the word `alternative,` meaning an alternative to the standard Maxima package for eigenvalues and eigenvectors. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarton-willis%2Falt_eigen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarton-willis%2Falt_eigen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarton-willis%2Falt_eigen/lists"}