Skip to content

Conversation

jarrodmillman
Copy link
Member

Still needs work (but it runs now):

$ python advanced/scipy_sparse/examples/lobpcg_sakurai.py
/home/jarrod/src/scientific-python-lectures/advanced/scipy_sparse/examples/lobpcg_sakurai.py:47: UserWarning: Exited at iteration 500 with accuracies 
[1158100.72206623    8047.95297708    6596.98347933]
not reaching the requested tolerance 1e-06.
Use iteration 0 instead with accuracy 
2.0908717846394285.

  eigs, vecs, resnh = sp.sparse.linalg.lobpcg(
/home/jarrod/src/scientific-python-lectures/advanced/scipy_sparse/examples/lobpcg_sakurai.py:47: UserWarning: Exited postprocessing with accuracies 
[5.4496576  0.42115509 0.40180266]
not reaching the requested tolerance 1e-06.
  eigs, vecs, resnh = sp.sparse.linalg.lobpcg(
Results by LOBPCG for n=2500

[1.6384843  0.17288616 0.16788489]

Exact eigenvalues

[0.06250005 0.0625002  0.06250044]

Elapsed time 1.311448997
/home/jarrod/src/scientific-python-lectures/advanced/scipy_sparse/examples/lobpcg_sakurai.py:64: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
  plt.show()

According to the notes, we should be seeing:

$ python examples/lobpcg_sakurai.py
Results by LOBPCG for n=2500

[ 0.06250083  0.06250028  0.06250007]

Exact eigenvalues

[ 0.06250005  0.0625002   0.06250044]

Elapsed time 7.01

@jarrodmillman jarrodmillman requested a review from stefanv July 5, 2024 17:51
Co-authored-by: Stefan van der Walt <sjvdwalt@gmail.com>
@jarrodmillman
Copy link
Member Author

@stefanv Any idea how to fix the code?

@stefanv
Copy link
Member

stefanv commented Jul 5, 2024

Should be better now.

@jarrodmillman jarrodmillman merged commit 5704874 into scipy-lectures:main Jul 8, 2024
@jarrodmillman jarrodmillman added this to the 2024.2 release milestone Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants