Skip to content

Btd green rework - #1025

Merged
zerothi merged 6 commits into
mainfrom
btd-green-rework
Oct 12, 2026
Merged

zerothi merged 6 commits into
mainfrom
btd-green-rework

Conversation

@zerothi

@zerothi zerothi commented Oct 12, 2026

Copy link
Copy Markdown
Owner

f"{self.__class__.__name__}(permute='electrode') requires at most 2 electrodes"
)
kwargs = dict(zip(("start", "end"), dense))
permute = btd_partition(csr, method=permute, dense=dense, **kwargs)
import re
from abc import ABC, abstractmethod
from collections.abc import Mapping
from typing import Literal, Optional, Self
Comment on lines +22 to +32
from .test_electrode import (
ETA,
NCELL,
K,
_cell_orbs,
_electrode,
_electrodes,
_expand,
_reference,
_system,
)
@zerothi
zerothi force-pushed the btd-green-rework branch 3 times, most recently from a941baa to e362d80 Compare October 12, 2026 10:45
The code was done in Cython for improved performance.

It still hasn't been checked in the code for DeviceGreen
that is to come.

Assisted-by: Claude:claude-opus-5-5
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.41475% with 104 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.13%. Comparing base (bc0375a) to head (90af313).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/sisl_toolbox/btd/_green.py 80.83% 64 Missing ⚠️
src/sisl_toolbox/btd/_electrode.py 94.04% 38 Missing ⚠️
src/sisl/physics/self_energy.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1025      +/-   ##
==========================================
- Coverage   86.45%   86.13%   -0.32%     
==========================================
  Files         419      422       +3     
  Lines       55495    57335    +1840     
==========================================
+ Hits        47979    49387    +1408     
- Misses       7516     7948     +432     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Also clarified the API here and there.

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Assisted-by: claude-code:claude-opus-5.5

forgot to add the tests

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Assisted-by: claude-code:claude-opus-5.5
The new electrode implementations are easier in the API
configuration.

Tests are still underway, and should be done.

Now the devicegreen uses electrodes to read the data.
And then it tries to figure out where to place the stuff.

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Assisted-by: claude-code:claude-opus-5.5

streamlined the permutebtd class

Also cleaned the internal namedtuple.

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Assisted-by: claude-code:claude-opus-5.5
Now fdfsile can read lists, and it can also read from
block values. Simpler to extract default key-value pairs inside a block.

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Assisted-by: claude-code:claude-opus-5.5

finalized certain tests for non-orthogonal basis sets

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Assisted-by: claude-code:claude-opus-5.5
Signed-off-by: Nick Papior <nickpapior@gmail.com>
Assisted-by: claude-code:claude-opus-5.5

Moved pivot to permute, better name

Also added eta to str representation of self-energies.

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Assisted-by: claude-code:claude-opus-5.5
Simpler Python API allowed easier pure Python NEGF calculations.
Made the permutation stuff orb/atom agnostic. Now the callee
has to decide what it passes.

Fully implemented the downfolding algorithm for NEGF
without any restrictions on the electrode region.
It can do, no downfolding, full downfolding, or
partial electrode downfolding.

Full reading of fdf with checks and assertions here
and there. This still needs some more careful
checks, but should be more-or-less ready.

Amended documentation for end-users so its simpler
to get something up and running!

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Assisted-by: claude-code:claude-opus-5-5

added changelogs

Signed-off-by: Nick Papior <nickpapior@gmail.com>
Assisted-by: claude-code:claude-opus-5-5

removed reverse test for cuthill_mckee

added importorskip to netcdf for the tests requiring it

forgot the final importorskip
@zerothi
zerothi merged commit c5497e3 into main Oct 12, 2026
3 checks passed
@zerothi
zerothi deleted the btd-green-rework branch October 12, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pivoting matrices for reducing bandwidth

2 participants