<jupyter_start><jupyter_text>Data<jupyter_code>from SCFInitialGuess.utilities.dataset import ScreenedData

target = "P"

data = ScreenedData(r_max=10)

data.include(data_path = "../../dataset/MethanT/", postfix = "MethanT", target=target)
data.include(data_path = "../../dataset/MethanT2/", postfix = "MethanT2", target=target)
data.include(data_path = "../../dataset/MethanT3/", postfix = "MethanT3", target=target)
data.include(data_path = "../../dataset/MethanT4/", postfix = "MethanT4", target=target)

data.include(data_path = "../../dataset/EthanT/",  postfix = "EthanT", target=target)
data.include(data_path = "../../dataset/EthanT2/", postfix = "EthanT2", target=target)
data.include(data_path = "../../dataset/EthanT3/", postfix = "EthanT3", target=target)
data.include(data_path = "../../dataset/EthanT4/",  postfix = "EthanT4", target=target)
data.include(data_path = "../../dataset/EthanT5/",  postfix = "EthanT5", target=target)
data.include(data_path = "../../dataset/EthanT6/",  postfix = "EthanT6", target=target)

data.include(data_path = "../../dataset/EthenT/",  postfix = "EthenT", target=target)
data.include(data_path = "../../dataset/EthenT2/", postfix = "EthenT2", target=target)
data.include(data_path = "../../dataset/EthenT3/", postfix = "EthenT3", target=target)
data.include(data_path = "../../dataset/EthenT4/",  postfix = "EthenT4", target=target)
data.include(data_path = "../../dataset/EthenT5/",  postfix = "EthenT5", target=target)
data.include(data_path = "../../dataset/EthenT6/",  postfix = "EthenT6", target=target)


data.include(data_path = "../../dataset/EthinT/",  postfix = "EthinT", target=target)
data.include(data_path = "../../dataset/EthinT2/", postfix = "EthinT2", target=target)
data.include(data_path = "../../dataset/EthinT3/", postfix = "EthinT3", target=target)

#data.include(data_path = "../../dataset/QM9/", postfix = "QM9-300")
len(data.molecules[2])<jupyter_output><empty_output><jupyter_text>Calculate Guesses<jupyter_code>from pyscf.scf import hf
p_gwh = [hf.init_guess_by_wolfsberg_helmholtz(mol.get_pyscf_molecule()) for mol in data.molecules[2]]
p_sad = [hf.init_guess_by_atom(mol.get_pyscf_molecule()) for mol in data.molecules[2]]
p_gwh = np.array(p_gwh)
p_sad = np.array(p_sad)<jupyter_output><empty_output><jupyter_text>Evaluate GWH<jupyter_code>p = np.arange(9)
p.reshape(-1, int(np.sqrt(np.prod(p.shape))))
from SCFInitialGuess.utilities.analysis import analyze_raw_batch
result = analyze_raw_batch(
    p_gwh,
    data.T[2],
    data.S[2],
    data.molecules[2]
)
from SCFInitialGuess.utilities.analysis import format_raw

print(format_raw(result))
from SCFInitialGuess.utilities.analysis import mf_initializer
from SCFInitialGuess.utilities.analysis import measure_iterations, statistics
from SCFInitialGuess.utilities.usermessages import Messenger as msg
msg.print_level = 3

    
iterations = np.array(measure_iterations(
    mf_initializer, 
    p_gwh, 
    data.molecules[2]
))

max_cycle = mf_initializer(
    data.molecules[2][0].get_pyscf_molecule()
).max_cycle

print(statistics(iterations))
print(statistics(iterations[iterations != max_cycle]))
print(np.sum(max_cycle == np.array(iterations)))

from SCFInitialGuess.utilities.analysis import mf_initializer_damping as mf_initializer
from SCFInitialGuess.utilities.analysis import measure_iterations, statistics
    
iterations = np.array(measure_iterations(
    mf_initializer, 
    p_gwh, 
    data.molecules[2]
))

max_cycle = mf_initializer(
    data.molecules[2][0].get_pyscf_molecule()
).max_cycle

print(statistics(iterations))
print(statistics(iterations[iterations != max_cycle]))
print(np.sum(max_cycle == np.array(iterations)))
from SCFInitialGuess.utilities.analysis import mf_initializer_diis as mf_initializer
from SCFInitialGuess.utilities.analysis import statistics
    
iterations = np.array(measure_iterations(
    mf_initializer, 
    p_gwh, 
    data.molecules[2]
))

max_cycle = mf_initializer(
    data.molecules[2][0].get_pyscf_molecule()
).max_cycle


from SCFInitialGuess.utilities.analysis import statistics
    
print(statistics(iterations))
print(statistics(iterations[iterations != max_cycle]))
print(np.sum(max_cycle == np.array(iterations)))
print(np.sum(max_cycle == np.array(iterations)) / len(data.molecules[2]))<jupyter_output>(14.234157303370786, 4.2922979908985095)
(14.234157303370786, 4.2922979908985095)
0
0.0<jupyter_text>Evaluate SAD<jupyter_code>result = analyze_raw_batch(
    p_sad,
    data.T[2],
    data.S[2],
    data.molecules[2]
)
print(format_raw(result))
from SCFInitialGuess.utilities.analysis import mf_initializer
from SCFInitialGuess.utilities.analysis import measure_iterations, statistics
from SCFInitialGuess.utilities.usermessages import Messenger as msg
msg.print_level = 0

    
iterations = np.array(measure_iterations(
    mf_initializer, 
    p_sad, 
    data.molecules[2]
))

max_cycle = mf_initializer(
    data.molecules[2][0].get_pyscf_molecule()
).max_cycle

print(statistics(iterations))
print(statistics(iterations[iterations != max_cycle]))
print(np.sum(max_cycle == np.array(iterations)))

from SCFInitialGuess.utilities.analysis import mf_initializer_damping as mf_initializer

    
iterations = np.array(measure_iterations(
    mf_initializer, 
    p_sad, 
    data.molecules[2]
))

max_cycle = mf_initializer(
    data.molecules[2][0].get_pyscf_molecule()
).max_cycle

print(statistics(iterations))
print(statistics(iterations[iterations != max_cycle]))
print(np.sum(max_cycle == np.array(iterations)))
from SCFInitialGuess.utilities.analysis import mf_initializer_diis as mf_initializer

    
iterations = np.array(measure_iterations(
    mf_initializer, 
    p_sad, 
    data.molecules[2]
))

max_cycle = mf_initializer(
    data.molecules[2][0].get_pyscf_molecule()
).max_cycle

print(statistics(iterations))
print(statistics(iterations[iterations != max_cycle]))
print(np.sum(max_cycle == np.array(iterations)))<jupyter_output>(10.818876404494382, 2.2159794741080003)
(10.818876404494382, 2.2159794741080003)
0
{'fraction_non_alphanumeric': 0.14556016597510374, 'fraction_numerical': 0.03468879668049792, 'mean_word_length': 5.6219780219780215, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '275598', 'license': 'MIT', 'n_tokens_mistral': 2368, 'n_tokens_neox': 2216, 'n_words': 321, 'path': 'thesis/notebooks/Application/ClassicalGuesses.ipynb', 'repo_name': 'jcartus/SCFInitialGuess', 'size': '6025'}