Skip to content

Commit

Permalink
Convert demo to python (#9)
Browse files Browse the repository at this point in the history
* convert demo to python

* Update scratch/demo.qmd

Co-authored-by: afmagee42 <[email protected]>

---------

Co-authored-by: afmagee42 <[email protected]>
  • Loading branch information
swo and afmagee42 committed Dec 2, 2024
1 parent b55e8fb commit 351aa89
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 25 deletions.
78 changes: 54 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scratch/demo.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ By definition, $v$ and $\lambda$ are an eigenvector and eigenvalue of $K$ if $Kv
# do the eigenvalue analysis
e = np.linalg.eig(K)
# which eigenvalue is the dominant one?
i = np.argmax(e.eigenvalues)
i = np.argmax(np.abs(e.eigenvalues))
dominant_eigenvalue = e.eigenvalues[i]
# get the corresponding eigenvector
v = e.eigenvectors[:, i]
Expand Down

0 comments on commit 351aa89

Please sign in to comment.