Example #1
0
 def _extract_results_if_not_present(myinput, resultdir):
     resultshelf = os.path.join(resultdir, ssc.DENSCOMP_RESULT_FILE)
     if sc.shelf_exists(resultshelf):
         return
     calculator = AtomCompressionResult(myinput.calculator)
     output = calculator.get_output(resultdir)
     result = {
         'potentials': output.get_potentials(),
         'density': output.get_density012()
     }
     sc.store_as_shelf(resultshelf, result)
Example #2
0
 def _extract_results_if_not_present(myinput, shells, resultdir):
     resultshelf = os.path.join(resultdir, ssc.WAVECOMP_RESULT_FILE)
     if sc.shelf_exists(resultshelf):
         return
     calculator = AtomCompressionResult(myinput.calculator)
     output = calculator.get_output(resultdir)
     resultdict = {}
     for nn, ll in shells:
         # Needs name as shelf allows only strings as keys
         shellname = sc.shell_ind_to_name(nn, ll)
         resultdict[shellname] = output.get_wavefunction012(0, nn, ll)
     sc.store_as_shelf(resultshelf, resultdict)
Example #3
0
 def _convert_results(self, res_spinavg, res_spin, hubbus, spinws):
     results = {
         "eigenvalues": res_spinavg.valence_eigvals[:, 0],
         "occupations": 2.0 * res_spinavg.valence_occs[:, 0],
         "h**o": np.array(res_spinavg.h**o, dtype=int),
     }
     if res_spin is not None:
         results["spinpol_energy"] = res_spin.etot - res_spinavg.etot
     else:
         results["spinpol_energy"] = 0.0
     results["hubbardu"] = hubbus
     results["spinw"] = spinws
     sc.store_as_shelf(os.path.join(self._workdir, ssc.ATOM_RESULT_FILE),
                       results)
Example #4
0
 def _extract_results_if_not_present(myinput, occshells, resultdir):
     resultshelf = os.path.join(resultdir, ssc.DENSCOMP_RESULT_FILE)
     if sc.shelf_exists(resultshelf):
         return
     calculator = AtomCompressionResult(myinput.calculator)
     output = calculator.get_output(resultdir)
     result = {
         'potentials': output.get_potentials(),
         'density': output.get_density012()
     }
     for qn, _ in occshells:
         nn = qn[0]
         ll = qn[1]
         # needs name as shelf allows only strings as keys
         shellname = sc.shell_ind_to_name(nn, ll)
         result[shellname] = output.get_wavefunction012(0, nn, ll)
     sc.store_as_shelf(resultshelf, result)
Example #5
0
 def _store_results(result, workdir):
     result_file = os.path.join(workdir, ssc.TWOCNT_RESULT_FILE)
     sc.store_as_shelf(result_file, hamiltonian=result.get_hamiltonian(),
                       overlap=result.get_overlap())