7878println (read (" iron_afm_energies.json" , String))
7979
8080# Once JSON3 is loaded, additionally a convenience function for saving
81- # a parsable summary of `scfres` objects using `save_scfres` is available:
81+ # a summary of `scfres` objects using `save_scfres` is available:
8282
8383using JSON3
8484save_scfres (" iron_afm.json" , scfres)
8585
86+ # Similarly a summary of the band data (occupations, eigenvalues, εF, etc.)
87+ # for post-processing can be dumped using `save_bands`:
88+ save_bands (" iron_afm_scfres.json" , scfres)
89+
90+ # Notably this function works both for the results obtained
91+ # by `self_consistent_field` as well as `compute_bands`:
92+ bands = compute_bands (scfres, kline_density= 10 )
93+ save_bands (" iron_afm_bands.json" , bands)
94+
8695# ## Writing and reading JLD2 files
8796# The full state of a DFTK self-consistent field calculation can be
8897# stored on disk in form of an [JLD2.jl](https://github.com/JuliaIO/JLD2.jl) file.
@@ -99,6 +108,6 @@ save_scfres("iron_afm.jld2", scfres);
99108# See [Saving SCF results on disk and SCF checkpoints](@ref) for details.
100109
101110# (Cleanup files generated by this notebook.)
102- rm ( " iron_afm.vts" )
103- rm ( " iron_afm.jld2 " )
104- rm ( " iron_afm_energies .json" )
111+ rm .([ " iron_afm.vts" , " iron_afm.jld2 " ,
112+ " iron_afm.json " , " iron_afm_energies.json " , " iron_afm_scfres.json " ,
113+ " iron_afm_bands .json" ] )
0 commit comments