jabirali / bodge

Numerical library for working with clean superconductors in Python using the Bogoliubov-de Gennes formalism
MIT License
2 stars 1 forks source link

potential regression in benchmarks.py #3

Closed mdavezac closed 1 month ago

mdavezac commented 1 month ago

I'm trying to run the benchmarks for openjournals/joss-reviews#7134, but I'm getting:

Traceback (most recent call last):
  File "./misc/benchmark.py", line 143, in <module>
    H1, T1 = bench_bodge(L, W)
  File "./misc/benchmark.py", line 120, in bench_bodge
    H = system(format="csr")
TypeError: 'Hamiltonian' object is not callable

Any ideas?

jabirali commented 1 month ago

Hi, thanks for checking the benchmarks.

I changed the Hamiltonian class a bit before submitting to JOSS, including that I renamed Hamiltonian.__call__(format=...) (which implemented the magic system(format=...) syntax above) to Hamiltonian.matrix(format=...) to make the conversion more explicit. I think the only change needed is to change system(...) to system.matrix(...) in the benchmark code, but I'll have a quick look now to see if I've overlooked anything else :)

jabirali commented 1 month ago

Thanks for notifying me about this.

I pushed a quick fix to the main branch now, with the update mentioned above the benchmark script is working again for me :).

Remember also to do a pip install kwant if you haven't already, to fetch the library that I'm benchmarking against as well. I added a quick note of this to the top of the benchmark script now.

jabirali commented 1 month ago

I guess the benchmark script is fixed now, so I'll close this issue as resolved. But please feel free to reopen it if you have any more problems, and I'd be happy to help.