示例#1
0
import seaborn
import matplotlib.pyplot as plt

import re

Z = 1

print("Please enter the atomic number.")

Z = input('[default: %d] ' % Z)
if Z.strip() == '':
    Z = 1
Z = float(Z)  ## allow for effective atomic numbers

h = hfnum.HF(Z)
h.resetGrid(1, 1.0 / 32.0,
            int((np.log(10.0) + 10 + np.log(Z)) / (1.0 / 32.0)) + 1,
            np.exp(-10) / Z)

config = ""
while config.strip() == "":
    print("Please enter the electron configuration in the format: 1s2 2s2 2p3")
    config = input("")
    if config.strip() == "":
        print(
            "Configuration %s does not match the allowed electron configuration format."
            % i)
        print("Please enter a valid electron configuration.")
        print(
            "The format is a list of elements separated by spaces, where each element has the syntax: [principal number][angular momentum sub-shell][electron multiplicity]."
示例#2
0
sys.path.append("../lib/")
sys.path.append("lib/")

import numpy as np
import hfnum

import seaborn
import matplotlib.pyplot as plt

Z = 1

# log grid
dx = 0.5e-1
N = 421
rmin = 1e-8
h = hfnum.HF()
h.resetGrid(1, dx, int(N), rmin)
h.setZ(Z)
h.method(3)

orb = hfnum.Orbital(2, 1, "+NNNNN")

h.addOrbital(orb)

NiterSCF = 1
Niter = 100
F0stop = 1e-6
r = np.asarray(h.getR())
h.solve(NiterSCF, Niter, F0stop)

h.save('output/results_H_2p.txt')
示例#3
0

readline.set_completer_delims(' \t\n;')
readline.parse_and_bind("tab: complete")
readline.set_completer(complete)
print('What is the input file to load?')
print(
    'Examples are any result*.txt file in the output directory. The ones with dft in their name are to be used with load_result_dft.py instead, so please do not load them with this script.'
)
print('[feel free to use TAB to auto-complete]')
fname = input('')

#print "Loading result from file %s" % fname

# random initialisation
h = hfnum.HF(fname)
#h.load(fname)

r = np.asarray(h.getR())
#print "r:", r

for n in range(0, h.getNOrbitals()):
    print(
        "Energy for orbital %10s: %10.6f Hartree = %15.8f eV" %
        (h.getOrbitalName(n), h.getOrbital_E(n), h.getOrbital_E(n) * hfnum.eV))

E0 = h.getE0()
print("Total ground energy: %10.6f Hartree = %15.8f eV" % (E0, E0 * hfnum.eV))

o = []
v = h.getNucleusPotential()