Comments (8)
Let's close that and leave it at named tuples for the time being
from dftk.jl.
Possibly the fact that I'm having trouble figuring this out precisely means we should keep these concepts separate, and just have a struct for scfres
like we have right now.
from dftk.jl.
Maybe the way to go is actually to have a state
datastructure collecting the results we have obtained from a DFT run in one datastructure.
from dftk.jl.
We might want to revisit this.
psi, occ, rho, rho_diff for spin, orbital energies, fermi level, possibly a few other fields. I think the only sensible way to do it is to have all fields nullable, which isn't great but I don't see any other way. Usage: pass to energy_hamiltonian
, to the terms, to the callbacks, return from the SCFs. We can have a constructor that takes psi and energies and computes the rest, which would simplify the code in the SCF. Let's discuss that sometime.
from dftk.jl.
So the only difference to the named tuple would be the constructor, do I get that right? In that case I would have a function to do that in a structured way. I really do not see why you do need a proper struct for that.
In my experience with structured objects for this sort of result state, it often happens that they get very quickly very clunky (because it is so convenient to stuff everything into it). So I really would be careful with it. But yes, let's talk about it.
from dftk.jl.
Actually now that I see a little the code of the new structure I see what you mean. It is really super annoying to pass basis and ρ around for everything.
from dftk.jl.
Right. The problem is that there are many uses we can do of such a structure:
- Postprocessing
- Compute an energy
- Compute a Hamiltonian
Each of these use different parts (eg, at least without hybrids, we can compute a Hamiltonian just with just the density). Consistency is also tricky: if the struct contains psi, occupation and rho, does it mean that rho is constructed from psi and occupation? Or that psi and occupation are constructed from the hamiltonian associated to rho? That's why I was suggesting having all fields as nullable, and not imposing too strict a contract on them. Could go either way as to whether we want a struct or a named tuple. Structs have the advantage of readability: when you see state::ElectronicState, you just have to look at ElectronicState to see what's in there.
from dftk.jl.
Also in favor of state: gives a unified place for the documentation of these things, eg the storage format of psi
from dftk.jl.
Related Issues (20)
- Stresses need an unreasonable amount of memory and runtime
- Space group numbers and symmetries
- Fix phase when possible HOT 2
- Make sure guess_density returns something with correct total charge
- Include `Manifest.toml` in the repo? HOT 2
- Use BenchmarkCI to automatically detect major runtime regressions HOT 3
- Gpu CI Failure HOT 2
- Maybe plot non-converged bands differently HOT 8
- Exact exchange status
- Document symmetries differences wrt other codes HOT 2
- Change of dimension in last kpoint when using non-converging scf HOT 4
- GPU broken HOT 6
- Check normalization of pseudo wave functions
- Custom pseudopotential identifier fails on irrfbz_path HOT 1
- Threading + MPI HOT 6
- `compute_bands` doesn't work for a non-atomic system in 3D. HOT 2
- Eigensolver not converged HOT 1
- Fast Bessel transform?
- PAW
- Incompatible with TestItemRunner 1.0 HOT 1
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 dftk.jl.