<commit_before>#!/usr/bin/env python
import numpy
import scipy.linalg
from pyscf import gto
from pyscf import scf
from pyscf import ao2mo

mol = gto.Mole()
mol.build(verbose=4)
mol.nelectron = 6

n = 12

mf = scf.RHF(mol)
h1 = numpy.zeros((n,n))
for i in range(n-1):
    h1[i,i+1] = h1[i+1,i] = -1.0
h1[n-1,0] = h1[0,n-1] = -1.0
eri = numpy.zeros((n,n,n,n))
for i in range(n):
    eri[i,i,i,i] = 4.0

e,c = scipy.linalg.eigh(h1)
dm0 = numpy.dot(c[:,:3],c[:,:3].T) * 2
hf_energy_initguess = 0

mf.get_hcore = lambda *args: h1
mf.get_ovlp = lambda *args: numpy.eye(n)
mf._eri = ao2mo.restore(8, eri, n)

# dm0 is the initial guess
mf.scf(dm)<commit_msg>Tiniest error<commit_after>#!/usr/bin/env python
import numpy
import scipy.linalg
from pyscf import gto
from pyscf import scf
from pyscf import ao2mo

mol = gto.Mole()
mol.build(verbose=4)
mol.nelectron = 6

n = 12

mf = scf.RHF(mol)
h1 = numpy.zeros((n,n))
for i in range(n-1):
    h1[i,i+1] = h1[i+1,i] = -1.0
h1[n-1,0] = h1[0,n-1] = -1.0
eri = numpy.zeros((n,n,n,n))
for i in range(n):
    eri[i,i,i,i] = 4.0

e,c = scipy.linalg.eigh(h1)
dm0 = numpy.dot(c[:,:3],c[:,:3].T) * 2
hf_energy_initguess = 0

mf.get_hcore = lambda *args: h1
mf.get_ovlp = lambda *args: numpy.eye(n)
mf._eri = ao2mo.restore(8, eri, n)

# dm0 is the initial guess
mf.scf(dm0)
{'fraction_non_alphanumeric': 0.1903300076745971, 'fraction_numerical': 0.051419800460475826, 'mean_word_length': 3.9022556390977443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '5616607', 'n_tokens_mistral': 697, 'n_tokens_neox': 669, 'n_words': 144}