Comments (11)
It can be done by following the example in the documentation (just added).
So for instance if you already have a device.TBT.nc
one may do the following which adds
import numpy as np
import sisl
# The important thing is that we should know the number of orbitals per atom
geom = sisl.get_sile('device.TBT.nc').read_geometry()
dH = sisl.Hamiltonian(geom, dtype=np.complex128)
orb_diag = geom.a2o(range(10, 14), all=True)
for o in orb_diag:
dH[o, o] = 1.j
sisl.get_sile('delta.dH.nc', 'w').write_delta(dH)
Let me know if you have other inquiries.
from sisl.
I test it and think it is working. This code explains a lot. Thank you.
from sisl.
Great, will mark as resolved.
from sisl.
Sorry for not doing the test carefully. I do get the delta.dH.nc fil. However, when redoing the tbtrans calculation, I get
tbtrans: Using buffer atoms with dH method. tbtrans: Ensure no buffer orbitals used in dH!
and
Error occured in NCDF: NetCDF: Invalid argument Status number: -36 ncdf: Stopped due to error in NetCDF file ncdf-Node 0
I checked the atom index and I thought it should not be in the buffer atom list. Just wondering what leads to this problem.
from sisl.
It most definitely is in the buffer list.
Remember, when you do programming in Python it is 0-based indexing, while in the input it is 1-based.
from sisl.
However, note that in future versions of tbtrans, this check has been removed because it is not important. However, it should still run.
from sisl.
Hmm, I do check the atom and orbital index carefully... Even I only assign delta to only an atom and looped the index of this atom, the same error exists. I notice the file delta.dH.nc is not large, can I print all the file contents to see if anything is going wrong?
The error message posted:
`Error occured in NCDF:
Retrieving information about: RedH in file: delta.dH.nc
Error occured in NCDF:
Retrieving information about: RedH in file: delta.dH.nc
Error occured in NCDF:
NetCDF: Variable not found
Status number: -49
NetCDF: Variable not found
Status number: -49
NetCDF: Variable not found
Status number: -49
ncdf: Stopped due to error in NetCDF file
ncdf-Node 8
ncdf: Stopped due to error in NetCDF file
ncdf-Node 2`
from sisl.
Ah, yes.
This is my mistake.
I would suggest you to download the latest commit for siesta-4.1 and use the TBtrans in that version.
https://bazaar.launchpad.net/~siesta-maint/siesta/rel-4.1/tarball/846
The reason is that I found out that the
As for sisl, I quickly adopted this convention, hence the variable name change.
So, please download the latest 4.1 commit and use that.
from sisl.
I used 4.1-b3. Will have a try on the new version.
from sisl.
Exactly. ;)
from sisl.
That version you mentioned works properly.
from sisl.
Related Issues (20)
- Reading DFTB+ matrices
- Reading fhiaims matrices
- Problems with sisl.io test suite? HOT 4
- `translate2uc` for sparse orbital matrices HOT 12
- Slicing read_* methods HOT 15
- Siles and opening them while retaining position HOT 1
- MD return values -- what should they be HOT 13
- Interpolate from grid. HOT 5
- Issue generating wave functions when atoms are in cell boundaries HOT 11
- Clean repeat usage
- Remove required dependency of netCDF4 HOT 4
- sisl.viz Grid plot uses Grid.geometry instead of Grid.lattice HOT 8
- Change isinstance spmatrix to issparse + isinstance (...
- Passivate edges in carbon nanostructures HOT 5
- Writing appended geometries with similar atomic species to siesta_nc results in faulty file
- Add 3.12 wheels HOT 1
- Unable to create Hamiltonian from geometry HOT 2
- Calling `geometry.close` with `ret_isc=True` returns wrong indices HOT 1
- Calling `geometry.close` with `ret_isc=True` and a single radius fails. HOT 2
- Replace argparse CLI with typer. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sisl.