Development of PyQuante 2

Rick Muller, [email protected]

I've been working on a rewrite of the PyQuante code, trying to get a more intuitive module structure and cleaner bindings of routines. The attached has some timing and other test results playing with the code. This isn't really meant as documentation or a gallery of pyquante2 features, but you can see some of them here.

You can fork the code from the pyquante2 github site.

What's new?

There are more modules, and the source code is spread between multiple directories. However, the goal is to have all generally-used modules imported from the main top-level module:

In [1]:
from pyquante2 import rhf,h2,h2o,c6h6,basisset

Many modules have special printing functions to support IPython:

In [2]:
h2o
Out[2]:

Water

Stoichiometry = H2O, Charge = 0, Multiplicity = 1

#AtnoSymbolxyz
08O0.000000.000000.09169
11H1.422960.00000-0.98120
21H-1.422960.00000-0.98120

In [3]:
c6h6
Out[3]:

Benzene

Stoichiometry = H6C6, Charge = 0, Multiplicity = 1

#AtnoSymbolxyz
06C1.865821.865820.00000
16C2.54875-0.682940.00000
26C0.68294-2.548750.00000
36C-1.86582-1.865820.00000
46C-2.548750.682940.00000
56C-0.682942.548750.00000
61H3.317433.317430.00000
71H4.53169-1.214260.00000
81H1.21426-4.531690.00000
91H-3.31743-3.317430.00000
101H-4.531691.214260.00000
111H-1.214264.531690.00000

We also try to have decent printing for those objects:

In [4]:
print c6h6
Stoichiometry = H6C6, Charge = 0, Multiplicity = 1
6 C     1.865817     1.865817     0.000000
6 C     2.548754    -0.682937     0.000000
6 C     0.682937    -2.548754     0.000000
6 C    -1.865817    -1.865817     0.000000
6 C    -2.548754     0.682937     0.000000
6 C    -0.682937     2.548754     0.000000
1 H     3.317430     3.317430     0.000000
1 H     4.531693    -1.214264     0.000000
1 H     1.214264    -4.531693     0.000000
1 H    -3.317430    -3.317430     0.000000
1 H    -4.531693     1.214264     0.000000
1 H    -1.214264     4.531693     0.000000

The solvers have decent printing as well:

In [5]:
h2
Out[5]:

Hydrogen

Stoichiometry = H2, Charge = 0, Multiplicity = 1

#AtnoSymbolxyz
01H0.000000.000000.69218
11H0.000000.00000-0.69218

In [6]:
bfs = basisset(h2)
bfs
Out[6]:
cgbf((0.0, 0.0, 0.69217561132317929),(0, 0, 0),[3.42525091, 0.62391373, 0.1688554],[0.1543289707029839, 0.5353281424384733, 0.44463454202535485])
cgbf((0.0, 0.0, -0.69217561132317929),(0, 0, 0),[3.42525091, 0.62391373, 0.1688554],[0.1543289707029839, 0.5353281424384733, 0.44463454202535485])
In [7]:
solver = rhf(h2,bfs)
solver
Out[7]:

RHF Hamiltonian

Hydrogen

Stoichiometry = H2, Charge = 0, Multiplicity = 1

#AtnoSymbolxyz
01H0.000000.000000.69218
11H0.000000.00000-0.69218

Basis set: sto3g, Nbf: 2

Status: Converged=False

In [8]:
solver.converge()
solver
Out[8]:

RHF Hamiltonian

Hydrogen

Stoichiometry = H2, Charge = 0, Multiplicity = 1

#AtnoSymbolxyz
01H0.000000.000000.69218
11H0.000000.00000-0.69218

Basis set: sto3g, Nbf: 2

Status: Converged=True

#Energy
00.48556
1-1.11710
In [9]:
print solver
RHF Hamiltonian
Stoichiometry = H2, Charge = 0, Multiplicity = 1
1 H     0.000000     0.000000     0.692176
1 H     0.000000     0.000000    -0.692176
Basis set: sto3g, Nbf: 2
Status: Converged = True
0  0.48556
1  -1.11710

Simple orbital printing is built it:

In [10]:
from pyquante2 import lineplot_orbs,contourplot,line
In [11]:
points = line((0,0,-5),(0,0,5))
lineplot_orbs(points,solver.orbs[:,:2],bfs,
    title="Plots of bonding and antibonding orbitals of H2")
In [12]:
contourplot('yz',h2,solver.orbs[:,1],bfs,
    title="Contours of H2 antibonding orbital")

Iterators and convergence

The iterator throws an exception if convergence isn't achieved:

In [13]:
solver = rhf(h2,basisset(h2))
In [14]:
solver
Out[14]:

RHF Hamiltonian

Hydrogen

Stoichiometry = H2, Charge = 0, Multiplicity = 1

#AtnoSymbolxyz
01H0.000000.000000.69218
11H0.000000.00000-0.69218

Basis set: sto3g, Nbf: 2

Status: Converged=False

In [15]:
solver.converge(maxiters=1)
Out[15]:
[0.48556025168474959]
In [16]:
solver.energies
Out[16]:
[0.48556025168474959]

Comparing timings and results with v1

In [17]:
import PyQuante, pyquante2

Tests in the utils unit tests:

In [18]:
print map(PyQuante.pyints.fact2,[0,1,3,8,-1]), map(pyquante2.utils.fact2,[0,1,3,8,-1])
for a,b in [(5,2),(10,5)]:
    print PyQuante.pyints.binomial(a,b),pyquante2.utils.binomial(a,b)
print PyQuante.pyints.Fgamma(0,0),pyquante2.utils.Fgamma(0,0)
[1, 1, 3, 384, 1] [1, 1, 3, 384, 1]
10 10
252 252
0.999999996667 1.0

Test one-e integrals and pgbfs

Tests in the one.py unit tests:

In [19]:
s1 = PyQuante.PGBF.PGBF(1,(0.,0.,0.))
s2 = pyquante2.pgbf(1)
print s1.overlap(s1),pyquante2.S(s2,s2)
print s1.kinetic(s1),pyquante2.T(s2,s2)
print s1.nuclear(s1,(0,0,0)),pyquante2.V(s2,s2,(0,0,0))
1.0 1.0
1.5 1.5
-1.59576911629 -1.59576912161

Confused about the incomplete gamma function at small values. It would be nice to be able to use the scipy routines as a replacement, but they don't seem to give the same results across the board.

In [20]:
from pyquante2.utils import *
from math import gamma
from scipy.special import gammainc
for x in [0.1,2,3,4]:
    print gamma(x),gammainc(x,1e-10),gammainc(x,1e10),gamm_inc(x,1e-10),gamm_inc(x,1e10)
9.51350769867 0.10511370061 1.0 0.999999999991 9.51350769867
1.0 4.99999999967e-21 1.0 4.99999999967e-21 1.0
2.0 1.66666666654e-31 1.0 3.33333333308e-31 2.0
6.0 4.16666666633e-42 1.0 2.4999999998e-41 6.0

This doesn't make any sense.

Test cgbfs with one-e integrals:

In [21]:
from PyQuante.CGBF import CGBF
from pyquante2 import cgbf,S,T
c1 = CGBF((0,0,0),(0,0,0))
c1b = CGBF((0,0,1.0),(0,0,0))
exps,coefs = [],[]
for ex,co in [(3.4252509099999999, 0.15432897000000001),
           (0.62391373000000006, 0.53532813999999995),
           (0.16885539999999999, 0.44463454000000002)]:
    exps.append(ex)
    coefs.append(co)
    c1.add_primitive(ex,co)
    c1b.add_primitive(ex,co)
c1.normalize()
c1b.normalize()

c2 = cgbf(exps=exps,coefs=coefs)
c2b = cgbf((0,0,1.0),exps=exps,coefs=coefs)

print "Overlaps"
print c1.overlap(c1), S(c2,c2)
print c1.overlap(c1b), S(c2,c2b)

print "Kinetics"
print c1.kinetic(c1), T(c2,c2)
print c1.kinetic(c1b), T(c2,c2b)
Overlaps
1.0 1.0
0.796588300697 0.796588300697
Kinetics
0.760031883567 0.760031883567
0.383253671655 0.383253671655

Integral routines and timing:

Timing top level ERI routines

In [22]:
s = pyquante2.pgbf(1)
from pyquante2.ints import two,hgp
%timeit two.ERI(s,s,s,s)
1000 loops, best of 3: 347 us per loop
In [23]:
%timeit hgp.ERI_hgp(s,s,s,s)
1000 loops, best of 3: 238 us per loop
In [24]:
from pyquante2 import ctwo
%timeit ctwo.ERI(s,s,s,s)
100000 loops, best of 3: 6.54 us per loop
In [25]:
%timeit ctwo.ERI_hgp(s,s,s,s)
100000 loops, best of 3: 4.98 us per loop

Nice speedup from Cython, but I had expected more relative speedup between hgp and the normal code. First run of this (little cython optimization) gave 4.4 us from ERI, and 3.84 from hgp. Python was 162 us.

Timing comparison for different vrr routines:

In [26]:
from pyquante2.ctwo import ERI,ERI_hgp,vrr,vrr_recursive,vrr_nonrecursive
from pyquante2.ints.hgp import vrr as pyvrr
In [27]:
zero = array([0,0,0],'d')
%timeit pyvrr(zero,1.,(0,0,0),1.,zero,1.,1., zero,1.,(0,0,0),1.,zero,1.,1.,0)
1000 loops, best of 3: 214 us per loop
In [28]:
%timeit vrr(0,0,0,1.,0,0,0,1.,0,0,0,1.,1.,0,0,0,1.,0,0,0,1.,0,0,0,1.,1.,0)
1000000 loops, best of 3: 1.67 us per loop
In [29]:
%timeit vrr_recursive(0,0,0,1.,0,0,0,1.,0,0,0,1.,1.,0,0,0,1.,0,0,0,1.,0,0,0,1.,1.,0)
1000000 loops, best of 3: 1.87 us per loop
In [30]:
%timeit vrr_nonrecursive(0,0,0,1.,0,0,0,1.,0,0,0,1.,1.,0,0,0,1.,0,0,0,1.,0,0,0,1.,1.,0)
1000000 loops, best of 3: 1.92 us per loop

Again, first time through I had expected more differences between the versions. The python version is 150 us, vrr was 1.21, and vrr_recursive was 1.26. For the added complexity of vrr (storing intermediate quantities) it almost seems worth it to go back to the recursive version.

vrr is now set to the recursive version. I can remove the nonrecursive version if needed.

Comparison of old and new ERI code:

PGBF code:

In [31]:
from PyQuante.PGBF import coulomb
from pyquante2.ctwo import ERI_hgp, ERI

s1 = PyQuante.PGBF.PGBF(1,(0.,0.,0.))
s2 = pyquante2.pgbf(1)

s1b = PyQuante.PGBF.PGBF(1,(0.,0.,1.))
s2b = pyquante2.pgbf(1,(0,0,1))

%timeit coulomb(s1,s1,s1,s1)
%timeit ERI_hgp(s2,s2,s2,s2)
print coulomb(s1,s1,s1,s1), ERI_hgp(s2,s2,s2,s2)
print coulomb(s1,s1,s1b,s1b), ERI_hgp(s2,s2,s2b,s2b), ERI(s2,s2,s2b,s2b)
print coulomb(s1,s1b,s1,s1b), ERI_hgp(s2,s2b,s2,s2b), ERI(s2,s2b,s2,s2b)
100000 loops, best of 3: 5.22 us per loop
100000 loops, best of 3: 6.05 us per loop
1.12837916333 1.12837916333
0.842700790029 0.842700790029 0.842700790029
0.415107496037 0.415107496037 0.415107496037

The new routines run at the same speed, which isn't altogether surprising, but it's nice to know I haven't lost anything due to the Cython wrappers.

CGBF code:

In [32]:
from PyQuante.CGBF import CGBF,coulomb
from pyquante2 import cgbf
from pyquante2.ctwo import ERI_hgp

c1 = CGBF((0,0,0),(0,0,0))
c1b = CGBF((0,0,1.0),(0,0,0))
exps,coefs = [],[]
for ex,co in [(3.4252509099999999, 0.15432897000000001),
           (0.62391373000000006, 0.53532813999999995),
           (0.16885539999999999, 0.44463454000000002)]:
    exps.append(ex)
    coefs.append(co)
    c1.add_primitive(ex,co)
    c1b.add_primitive(ex,co)
c1.normalize()
c1b.normalize()

c2 = cgbf(exps=exps,coefs=coefs)
c2b = cgbf((0,0,1.0),exps=exps,coefs=coefs)

%timeit coulomb(c1,c1,c1,c1)
%timeit ERI_hgp(c2,c2,c2,c2)
%timeit ERI(c2,c2,c2,c2)
print coulomb(c1,c1,c1,c1), ERI_hgp(c2,c2,c2,c2)
print coulomb(c1,c1,c1b,c1b), ERI_hgp(c2,c2,c2b,c2b)
print coulomb(c1,c1b,c1,c1b), ERI_hgp(c2,c2b,c2,c2b)
10000 loops, best of 3: 49.4 us per loop
10000 loops, best of 3: 41.4 us per loop
1000 loops, best of 3: 1.22 ms per loop
0.774605941338 0.774605941338
0.650177460815 0.650177460815
0.455901518744 0.455901518744

SCF examples:

LiH, STO-3G

In [33]:
from PyQuante.Ints import getbasis,getints,getT,getV
from PyQuante.hartree_fock import rhf
from PyQuante.Molecule import Molecule

LiH = Molecule('lih',
                 [(3,( .0000000000, .0000000000, .0000000000)),
                  (1,( .0000000000, .0000000000,1.629912))],
                 units='Angstroms')
bfs = getbasis(LiH,'sto-3g')
nbf = len(bfs)
nocc,nopen = LiH.get_closedopen()
assert nopen==0
S,h,Ints = getints(bfs,LiH)
en,orbe,orbs = rhf(LiH,integrals=(S,h,Ints),verbose=True)
print "SCF completed, E = ",en 
print "S = \n",S
print "h = \n",h
print "I2 = \n",Ints[:5]
SCF completed, E =  -7.86073576968
S = 
[[ 1.          0.24113665  0.          0.          0.          0.06239818]
 [ 0.24113665  1.          0.          0.          0.          0.38780341]
 [ 0.          0.          1.          0.          0.          0.        ]
 [ 0.          0.          0.          1.          0.          0.        ]
 [ 0.          0.          0.          0.          1.          0.50716955]
 [ 0.06239818  0.38780341  0.          0.          0.50716955  1.        ]]
h = 
[[-4.73076107 -1.06286658  0.          0.         -0.01551519 -0.28307001]
 [-1.06286658 -1.39257572  0.          0.         -0.12049949 -0.67475424]
 [ 0.          0.         -1.13302238  0.          0.          0.        ]
 [ 0.          0.          0.         -1.13302238  0.          0.        ]
 [-0.01551519 -0.12049949  0.          0.         -1.22977649 -0.82314252]
 [-0.28307001 -0.67475424  0.          0.         -0.82314252 -1.43835583]]
I2 = 
array('d', [1.6803951639324308, 0.26542036372307215, 0.049941457073764725, 0.39772685976397343, 0.09286014333241713])
In [34]:
from PyQuante.TestMolecules import h2o
bfs = getbasis(h2o,'sto-3g')
nbf = len(bfs)
S,h,Ints = getints(bfs,h2o)
en,orbe,orbs = rhf(h2o,integrals=(S,h,Ints),verbose=True)
print "SCF completed, E = ",en 
print "S = \n",S
print "h = \n",h
print "I2 = \n",Ints[:5]
SCF completed, E =  -74.9598407887
S = 
[[  1.00000000e+00   2.36703937e-01   0.00000000e+00   0.00000000e+00
   -3.95628520e-18   5.58181517e-02   5.58181517e-02]
 [  2.36703937e-01   1.00000000e+00   0.00000000e+00   0.00000000e+00
   -6.93671951e-18   4.84133479e-01   4.84133479e-01]
 [  0.00000000e+00   0.00000000e+00   1.00000000e+00   0.00000000e+00
    0.00000000e+00   3.18049483e-01  -3.18049483e-01]
 [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.00000000e+00
    0.00000000e+00   0.00000000e+00   0.00000000e+00]
 [ -3.95628520e-18  -6.93671951e-18   0.00000000e+00   0.00000000e+00
    1.00000000e+00  -2.39804296e-01  -2.39804296e-01]
 [  5.58181517e-02   4.84133479e-01   3.18049483e-01   0.00000000e+00
   -2.39804296e-01   1.00000000e+00   2.54586613e-01]
 [  5.58181517e-02   4.84133479e-01  -3.18049483e-01   0.00000000e+00
   -2.39804296e-01   2.54586613e-01   1.00000000e+00]]
h = 
[[ -3.27375153e+01  -7.61673386e+00   0.00000000e+00   0.00000000e+00
    1.92563167e-02  -1.81001390e+00  -1.81001390e+00]
 [ -7.61673386e+00  -9.34981296e+00   0.00000000e+00   0.00000000e+00
    2.25272914e-01  -3.83196154e+00  -3.83196154e+00]
 [  0.00000000e+00   0.00000000e+00  -7.63461067e+00   0.00000000e+00
    0.00000000e+00  -2.08476894e+00   2.08476894e+00]
 [  0.00000000e+00   0.00000000e+00   0.00000000e+00  -7.46989436e+00
    0.00000000e+00   0.00000000e+00   0.00000000e+00]
 [  1.92563167e-02   2.25272914e-01   0.00000000e+00   0.00000000e+00
   -7.56353430e+00   1.64578178e+00   1.64578178e+00]
 [ -1.81001390e+00  -3.83196154e+00  -2.08476894e+00   0.00000000e+00
    1.64578178e+00  -5.13309366e+00  -1.64475717e+00]
 [ -1.81001390e+00  -3.83196154e+00   2.08476894e+00   0.00000000e+00
    1.64578178e+00  -1.64475717e+00  -5.13309366e+00]]
I2 = 
array('d', [4.785065388755281, 0.7413803495021389, 0.13687338489814346, 1.1189468626126458, 0.2566333938755287])
In [35]:
from pyquante2 import molecule,lih,basisset,rhf
from pyquante2.ints.integrals import onee_integrals,twoe_integrals
from pyquante2.utils import dmat,trace2,geigh

lih = molecule([
    (3,.0000000000, .0000000000, .0000000000),
    (1, .0000000000, .0000000000,1.629912)],
    units='Angstroms')

bfs = basisset(lih,'sto3g')

i1 = onee_integrals(bfs,lih)
i2 = twoe_integrals(bfs)
print "S = \n",i1.S
print "h = \n",i1.T + i1.V
print "I2 = \n",i2._2e_ints[:5]
s = rhf(lih,bfs)
s.converge()
S = 
[[ 1.          0.24113665  0.          0.          0.          0.06239931]
 [ 0.24113665  1.          0.          0.          0.          0.38780552]
 [ 0.          0.          1.          0.          0.          0.        ]
 [ 0.          0.          0.          1.          0.          0.        ]
 [ 0.          0.          0.          0.          1.          0.50717121]
 [ 0.06239931  0.38780552  0.          0.          0.50717121  1.        ]]
h = 
[[-4.73076276 -1.06286698  0.          0.         -0.01551535 -0.28307525]
 [-1.06286698 -1.39257664  0.          0.         -0.12049997 -0.67475941]
 [ 0.          0.         -1.13302317  0.          0.          0.        ]
 [ 0.          0.          0.         -1.13302317  0.          0.        ]
 [-0.01551535 -0.12049997  0.          0.         -1.22977768 -0.82314683]
 [-0.28307525 -0.67475941  0.          0.         -0.82314683 -1.4383608 ]]
I2 = 
[[[[  1.68039516e+00   2.65420364e-01   0.00000000e+00   0.00000000e+00
      0.00000000e+00   6.67460269e-02]
   [  2.65420364e-01   3.97726860e-01   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.45977260e-01]
   [  0.00000000e+00   0.00000000e+00   3.96639641e-01   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   3.96639641e-01
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      3.96639641e-01   1.77730867e-01]
   [  6.67460269e-02   1.45977260e-01   0.00000000e+00   0.00000000e+00
      1.77730867e-01   3.23596627e-01]]

  [[  2.65420364e-01   4.99414571e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.26228730e-02]
   [  4.99414571e-02   9.28601433e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   3.44386672e-02]
   [  0.00000000e+00   0.00000000e+00   9.28803966e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   9.28803966e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      9.28803966e-02   4.23962450e-02]
   [  1.26228730e-02   3.44386672e-02   0.00000000e+00   0.00000000e+00
      4.23962450e-02   7.77132412e-02]]

  [[  0.00000000e+00   0.00000000e+00   8.98131923e-03   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.37882688e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  8.98131923e-03   1.37882688e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   2.86733880e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   2.86733880e-03   0.00000000e+00
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   8.98131923e-03
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.37882688e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  8.98131923e-03   1.37882688e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   2.86733880e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   2.86733880e-03
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      8.98131923e-03   1.49253636e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      1.37882688e-02   5.61064034e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  8.98131923e-03   1.37882688e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   8.72195152e-03]
   [  1.49253636e-03   5.61064034e-03   0.00000000e+00   0.00000000e+00
      8.72195152e-03   1.47614365e-02]]

  [[  6.67460269e-02   1.26228730e-02   0.00000000e+00   0.00000000e+00
      1.49253636e-03   3.48752569e-03]
   [  1.26228730e-02   2.38897188e-02   0.00000000e+00   0.00000000e+00
      2.89165611e-03   1.03806824e-02]
   [  0.00000000e+00   0.00000000e+00   2.36090454e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   2.36090454e-02
      0.00000000e+00   0.00000000e+00]
   [  1.49253636e-03   2.89165611e-03   0.00000000e+00   0.00000000e+00
      2.44619671e-02   1.33296474e-02]
   [  3.48752569e-03   1.03806824e-02   0.00000000e+00   0.00000000e+00
      1.33296474e-02   2.45457394e-02]]]


 [[[  2.65420364e-01   4.99414571e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.26228730e-02]
   [  4.99414571e-02   9.28601433e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   3.44386672e-02]
   [  0.00000000e+00   0.00000000e+00   9.28803966e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   9.28803966e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      9.28803966e-02   4.23962450e-02]
   [  1.26228730e-02   3.44386672e-02   0.00000000e+00   0.00000000e+00
      4.23962450e-02   7.77132412e-02]]

  [[  3.97726860e-01   9.28601433e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   2.38897188e-02]
   [  9.28601433e-02   2.90562294e-01   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.12630635e-01]
   [  0.00000000e+00   0.00000000e+00   2.90496975e-01   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   2.90496975e-01
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      2.90496975e-01   1.44016166e-01]
   [  2.38897188e-02   1.12630635e-01   0.00000000e+00   0.00000000e+00
      1.44016166e-01   2.78154454e-01]]

  [[  0.00000000e+00   0.00000000e+00   1.37882688e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   6.41843282e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  1.37882688e-02   6.41843282e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.30566993e-02]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.30566993e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.37882688e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   6.41843282e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  1.37882688e-02   6.41843282e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.30566993e-02]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.30566993e-02
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      1.37882688e-02   2.89165611e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      6.41843282e-02   3.30528301e-02]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  1.37882688e-02   6.41843282e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   5.05803326e-02]
   [  2.89165611e-03   3.30528301e-02   0.00000000e+00   0.00000000e+00
      5.05803326e-02   1.04756020e-01]]

  [[  1.45977260e-01   3.44386672e-02   0.00000000e+00   0.00000000e+00
      5.61064034e-03   1.03806824e-02]
   [  3.44386672e-02   1.12630635e-01   0.00000000e+00   0.00000000e+00
      3.30528301e-02   7.09163009e-02]
   [  0.00000000e+00   0.00000000e+00   1.06969865e-01   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.06969865e-01
      0.00000000e+00   0.00000000e+00]
   [  5.61064034e-03   3.30528301e-02   0.00000000e+00   0.00000000e+00
      1.23834010e-01   9.95709532e-02]
   [  1.03806824e-02   7.09163009e-02   0.00000000e+00   0.00000000e+00
      9.95709532e-02   2.17355090e-01]]]


 [[[  0.00000000e+00   0.00000000e+00   8.98131923e-03   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.37882688e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  8.98131923e-03   1.37882688e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   2.86733880e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   2.86733880e-03   0.00000000e+00
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   1.37882688e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   6.41843282e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  1.37882688e-02   6.41843282e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.30566993e-02]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.30566993e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]]

  [[  3.96639641e-01   9.28803966e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   2.36090454e-02]
   [  9.28803966e-02   2.90496975e-01   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.06969865e-01]
   [  0.00000000e+00   0.00000000e+00   3.12945510e-01   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   2.79207231e-01
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      2.79207231e-01   1.34348349e-01]
   [  2.36090454e-02   1.06969865e-01   0.00000000e+00   0.00000000e+00
      1.34348349e-01   2.53941149e-01]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.68691394e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.68691394e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      1.68691394e-02   5.18541969e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.68691394e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   5.18541969e-03   0.00000000e+00
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   2.86733880e-03   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.30566993e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  2.86733880e-03   1.30566993e-02   0.00000000e+00   0.00000000e+00
      5.18541969e-03   5.28151702e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   5.18541969e-03   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   5.28151702e-03   0.00000000e+00
      0.00000000e+00   0.00000000e+00]]]


 [[[  0.00000000e+00   0.00000000e+00   0.00000000e+00   8.98131923e-03
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.37882688e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  8.98131923e-03   1.37882688e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   2.86733880e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   2.86733880e-03
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.37882688e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   6.41843282e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  1.37882688e-02   6.41843282e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.30566993e-02]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.30566993e-02
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.68691394e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.68691394e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]]

  [[  3.96639641e-01   9.28803966e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   2.36090454e-02]
   [  9.28803966e-02   2.90496975e-01   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.06969865e-01]
   [  0.00000000e+00   0.00000000e+00   2.79207231e-01   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   3.12945510e-01
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      2.79207231e-01   1.34348349e-01]
   [  2.36090454e-02   1.06969865e-01   0.00000000e+00   0.00000000e+00
      1.34348349e-01   2.53941149e-01]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      1.68691394e-02   5.18541969e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.68691394e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   5.18541969e-03
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   2.86733880e-03
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.30566993e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  2.86733880e-03   1.30566993e-02   0.00000000e+00   0.00000000e+00
      5.18541969e-03   5.28151702e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   5.18541969e-03
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   5.28151702e-03
      0.00000000e+00   0.00000000e+00]]]


 [[[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      8.98131923e-03   1.49253636e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      1.37882688e-02   5.61064034e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  8.98131923e-03   1.37882688e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   8.72195152e-03]
   [  1.49253636e-03   5.61064034e-03   0.00000000e+00   0.00000000e+00
      8.72195152e-03   1.47614365e-02]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      1.37882688e-02   2.89165611e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      6.41843282e-02   3.30528301e-02]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  1.37882688e-02   6.41843282e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   5.05803326e-02]
   [  2.89165611e-03   3.30528301e-02   0.00000000e+00   0.00000000e+00
      5.05803326e-02   1.04756020e-01]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      1.68691394e-02   5.18541969e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.68691394e-02   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   5.18541969e-03   0.00000000e+00
      0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      1.68691394e-02   5.18541969e-03]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.68691394e-02
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   5.18541969e-03
      0.00000000e+00   0.00000000e+00]]

  [[  3.96639641e-01   9.28803966e-02   0.00000000e+00   0.00000000e+00
      0.00000000e+00   2.44619671e-02]
   [  9.28803966e-02   2.90496975e-01   0.00000000e+00   0.00000000e+00
      0.00000000e+00   1.23834010e-01]
   [  0.00000000e+00   0.00000000e+00   2.79207231e-01   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   2.79207231e-01
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
      3.12945510e-01   1.63177308e-01]
   [  2.44619671e-02   1.23834010e-01   0.00000000e+00   0.00000000e+00
      1.63177308e-01   3.26218201e-01]]

  [[  1.77730867e-01   4.23962450e-02   0.00000000e+00   0.00000000e+00
      8.72195152e-03   1.33296474e-02]
   [  4.23962450e-02   1.44016166e-01   0.00000000e+00   0.00000000e+00
      5.05803326e-02   9.95709532e-02]
   [  0.00000000e+00   0.00000000e+00   1.34348349e-01   0.00000000e+00
      0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.34348349e-01
      0.00000000e+00   0.00000000e+00]
   [  8.72195152e-03   5.05803326e-02   0.00000000e+00   0.00000000e+00
      1.63177308e-01   1.41995363e-01]
   [  1.33296474e-02   9.95709532e-02   0.00000000e+00   0.00000000e+00
      1.41995363e-01   3.17406555e-01]]]]
Out[35]:
[-3.1596039710068511,
 -7.8207331845299244,
 -7.8597189212209964,
 -7.8606098325514955,
 -7.860713927416132,
 -7.8607399825987567]
In [36]:
from pyquante2 import molecule,h2o,basisset,rhf
from pyquante2.ints.integrals import onee_integrals,twoe_integrals
from pyquante2.utils import dmat,trace2,geigh

bfs = basisset(h2o,'sto3g')

i1 = onee_integrals(bfs,h2o)
i2 = twoe_integrals(bfs)
print "S = \n",i1.S
print "h = \n",i1.T + i1.V
print "I2 = \n",i2._2e_ints[:5]
s = rhf(h2o,bfs)
s.converge()
S = 
[[  1.00000000e+00   2.36703937e-01   0.00000000e+00   0.00000000e+00
   -4.36556721e-18   5.58187997e-02   5.58187997e-02]
 [  2.36703937e-01   1.00000000e+00   0.00000000e+00   0.00000000e+00
    0.00000000e+00   4.84136727e-01   4.84136727e-01]
 [  0.00000000e+00   0.00000000e+00   1.00000000e+00   0.00000000e+00
    0.00000000e+00   3.18050818e-01  -3.18050818e-01]
 [  0.00000000e+00   0.00000000e+00   0.00000000e+00   1.00000000e+00
    0.00000000e+00   0.00000000e+00   0.00000000e+00]
 [ -4.36556721e-18   0.00000000e+00   0.00000000e+00   0.00000000e+00
    1.00000000e+00  -2.39805302e-01  -2.39805302e-01]
 [  5.58187997e-02   4.84136727e-01   3.18050818e-01   0.00000000e+00
   -2.39805302e-01   1.00000000e+00   2.54589471e-01]
 [  5.58187997e-02   4.84136727e-01  -3.18050818e-01   0.00000000e+00
   -2.39805302e-01   2.54589471e-01   1.00000000e+00]]
h = 
[[ -3.27375212e+01  -7.61673524e+00   0.00000000e+00   0.00000000e+00
    1.92565169e-02  -1.81003520e+00  -1.81003520e+00]
 [ -7.61673524e+00  -9.34981821e+00   0.00000000e+00   0.00000000e+00
    2.25274817e-01  -3.83199371e+00  -3.83199371e+00]
 [  0.00000000e+00   0.00000000e+00  -7.63461683e+00   0.00000000e+00
    0.00000000e+00  -2.08478101e+00   2.08478101e+00]
 [  0.00000000e+00   0.00000000e+00   0.00000000e+00  -7.46989864e+00
    0.00000000e+00   0.00000000e+00   0.00000000e+00]
 [  1.92565169e-02   2.25274817e-01   0.00000000e+00   0.00000000e+00
   -7.56353965e+00   1.64579197e+00   1.64579197e+00]
 [ -1.81003520e+00  -3.83199371e+00  -2.08478101e+00   0.00000000e+00
    1.64579197e+00  -5.13311455e+00  -1.64478037e+00]
 [ -1.81003520e+00  -3.83199371e+00   2.08478101e+00   0.00000000e+00
    1.64579197e+00  -1.64478037e+00  -5.13311455e+00]]
I2 = 
[[[[  4.78506539e+00   7.41380350e-01   0.00000000e+00 ...,
     -1.09317641e-17   1.77733105e-01   1.77733105e-01]
   [  7.41380350e-01   1.11894686e+00   0.00000000e+00 ...,
     -2.97941395e-18   4.13579000e-01   4.13579000e-01]
   [  0.00000000e+00   0.00000000e+00   1.11581381e+00 ...,
      0.00000000e+00   2.31295029e-01  -2.31295029e-01]
   ..., 
   [ -1.09317641e-17  -2.97941395e-18   0.00000000e+00 ...,
      1.11581381e+00  -1.74392806e-01  -1.74392806e-01]
   [  1.77733105e-01   4.13579000e-01   2.31295029e-01 ...,
     -1.74392806e-01   5.38762938e-01   1.64766439e-01]
   [  1.77733105e-01   4.13579000e-01  -2.31295029e-01 ...,
     -1.74392806e-01   1.64766439e-01   5.38762938e-01]]

  [[  7.41380350e-01   1.36873385e-01   0.00000000e+00 ...,
     -3.29465902e-18   3.25165492e-02   3.25165492e-02]
   [  1.36873385e-01   2.56633394e-01   0.00000000e+00 ...,
     -5.73294162e-19   9.59611007e-02   9.59611007e-02]
   [  0.00000000e+00   0.00000000e+00   2.56683985e-01 ...,
      0.00000000e+00   5.43844411e-02  -5.43844411e-02]
   ..., 
   [ -3.29465902e-18  -5.73294162e-19   0.00000000e+00 ...,
      2.56683985e-01  -4.10050112e-02  -4.10050112e-02]
   [  3.25165492e-02   9.59611007e-02   5.43844411e-02 ...,
     -4.10050112e-02   1.27038426e-01   3.85534447e-02]
   [  3.25165492e-02   9.59611007e-02  -5.43844411e-02 ...,
     -4.10050112e-02   3.85534447e-02   1.27038426e-01]]

  [[  0.00000000e+00   0.00000000e+00   2.44774121e-02 ...,
      0.00000000e+00   1.19158318e-03  -1.19158318e-03]
   [  0.00000000e+00   0.00000000e+00   3.78086072e-02 ...,
      0.00000000e+00   5.72000216e-03  -5.72000216e-03]
   [  2.44774121e-02   3.78086072e-02   0.00000000e+00 ...,
     -3.36278574e-19   1.31229075e-02   1.31229075e-02]
   ..., 
   [  0.00000000e+00   0.00000000e+00  -3.36278574e-19 ...,
      0.00000000e+00  -2.15397470e-03   2.15397470e-03]
   [  1.19158318e-03   5.72000216e-03   1.31229075e-02 ...,
     -2.15397470e-03   1.02011735e-02   6.77626358e-21]
   [ -1.19158318e-03  -5.72000216e-03   1.31229075e-02 ...,
      2.15397470e-03   6.77626358e-21  -1.02011735e-02]]

  ..., 
  [[ -1.09317641e-17  -3.29465902e-18   0.00000000e+00 ...,
      2.44774121e-02  -8.98434932e-04  -8.98434932e-04]
   [ -3.29465902e-18  -5.19621701e-18   0.00000000e+00 ...,
      3.78086072e-02  -4.31279145e-03  -4.31279145e-03]
   [  0.00000000e+00   0.00000000e+00  -5.22260861e-18 ...,
      0.00000000e+00  -2.15397470e-03   2.15397470e-03]
   ..., 
   [  2.44774121e-02   3.78086072e-02   0.00000000e+00 ...,
     -5.89516576e-18   1.18901803e-02   1.18901803e-02]
   [ -8.98434932e-04  -4.31279145e-03  -2.15397470e-03 ...,
      1.18901803e-02  -7.69152401e-03  -2.77201102e-03]
   [ -8.98434932e-04  -4.31279145e-03   2.15397470e-03 ...,
      1.18901803e-02  -2.77201102e-03  -7.69152401e-03]]

  [[  1.77733105e-01   3.25165492e-02   1.19158318e-03 ...,
     -8.98434932e-04   7.82466264e-03   7.70178443e-03]
   [  3.25165492e-02   6.05107138e-02   2.22268203e-03 ...,
     -1.67586721e-03   2.32041931e-02   2.24675658e-02]
   [  1.19158318e-03   2.22268203e-03   6.06194552e-02 ...,
     -1.67895211e-04   1.37576874e-02  -1.21261199e-02]
   ..., 
   [ -8.98434932e-04  -1.67586721e-03  -1.67895211e-04 ...,
      6.05233682e-02  -1.03730794e-02  -1.00494912e-02]
   [  7.82466264e-03   2.32041931e-02   1.37576874e-02 ...,
     -1.03730794e-02   3.10267308e-02   9.22400692e-03]
   [  7.70178443e-03   2.24675658e-02  -1.21261199e-02 ...,
     -1.00494912e-02   9.22400692e-03   2.96592475e-02]]

  [[  1.77733105e-01   3.25165492e-02  -1.19158318e-03 ...,
     -8.98434932e-04   7.70178443e-03   7.82466264e-03]
   [  3.25165492e-02   6.05107138e-02  -2.22268203e-03 ...,
     -1.67586721e-03   2.24675658e-02   2.32041931e-02]
   [ -1.19158318e-03  -2.22268203e-03   6.06194552e-02 ...,
      1.67895211e-04   1.21261199e-02  -1.37576874e-02]
   ..., 
   [ -8.98434932e-04  -1.67586721e-03   1.67895211e-04 ...,
      6.05233682e-02  -1.00494912e-02  -1.03730794e-02]
   [  7.70178443e-03   2.24675658e-02   1.21261199e-02 ...,
     -1.00494912e-02   2.96592475e-02   9.22400692e-03]
   [  7.82466264e-03   2.32041931e-02  -1.37576874e-02 ...,
     -1.03730794e-02   9.22400692e-03   3.10267308e-02]]]


 [[[  7.41380350e-01   1.36873385e-01   0.00000000e+00 ...,
     -3.29465902e-18   3.25165492e-02   3.25165492e-02]
   [  1.36873385e-01   2.56633394e-01   0.00000000e+00 ...,
     -5.73294162e-19   9.59611007e-02   9.59611007e-02]
   [  0.00000000e+00   0.00000000e+00   2.56683985e-01 ...,
      0.00000000e+00   5.43844411e-02  -5.43844411e-02]
   ..., 
   [ -3.29465902e-18  -5.73294162e-19   0.00000000e+00 ...,
      2.56683985e-01  -4.10050112e-02  -4.10050112e-02]
   [  3.25165492e-02   9.59611007e-02   5.43844411e-02 ...,
     -4.10050112e-02   1.27038426e-01   3.85534447e-02]
   [  3.25165492e-02   9.59611007e-02  -5.43844411e-02 ...,
     -4.10050112e-02   3.85534447e-02   1.27038426e-01]]

  [[  1.11894686e+00   2.56633394e-01   0.00000000e+00 ...,
     -5.19621701e-18   6.05107138e-02   6.05107138e-02]
   [  2.56633394e-01   8.17206319e-01   0.00000000e+00 ...,
     -2.38435084e-18   3.36126862e-01   3.36126862e-01]
   [  0.00000000e+00   0.00000000e+00   8.17022603e-01 ...,
      0.00000000e+00   2.03480113e-01  -2.03480113e-01]
   ..., 
   [ -5.19621701e-18  -2.38435084e-18   0.00000000e+00 ...,
      8.17022603e-01  -1.53420797e-01  -1.53420797e-01]
   [  6.05107138e-02   3.36126862e-01   2.03480113e-01 ...,
     -1.53420797e-01   5.08392632e-01   1.45628156e-01]
   [  6.05107138e-02   3.36126862e-01  -2.03480113e-01 ...,
     -1.53420797e-01   1.45628156e-01   5.08392632e-01]]

  [[  0.00000000e+00   0.00000000e+00   3.78086072e-02 ...,
      0.00000000e+00   2.22268203e-03  -2.22268203e-03]
   [  0.00000000e+00   0.00000000e+00   1.80518391e-01 ...,
      0.00000000e+00   4.28953693e-02  -4.28953693e-02]
   [  3.78086072e-02   1.80518391e-01   0.00000000e+00 ...,
     -4.78751979e-19   8.36883904e-02   8.36883904e-02]
   ..., 
   [  0.00000000e+00   0.00000000e+00  -4.78751979e-19 ...,
      0.00000000e+00  -1.86629967e-02   1.86629967e-02]
   [  2.22268203e-03   4.28953693e-02   8.36883904e-02 ...,
     -1.86629967e-02   1.03864238e-01  -4.33680869e-19]
   [ -2.22268203e-03  -4.28953693e-02   8.36883904e-02 ...,
      1.86629967e-02  -4.33680869e-19  -1.03864238e-01]]

  ..., 
  [[ -2.97941395e-18  -5.73294162e-19   0.00000000e+00 ...,
      3.78086072e-02  -1.67586721e-03  -1.67586721e-03]
   [ -5.73294162e-19  -2.38435084e-18   0.00000000e+00 ...,
      1.80518391e-01  -3.23424322e-02  -3.23424322e-02]
   [  0.00000000e+00   0.00000000e+00  -1.21542565e-18 ...,
      0.00000000e+00  -1.86629967e-02   1.86629967e-02]
   ..., 
   [  3.78086072e-02   1.80518391e-01   0.00000000e+00 ...,
     -2.17292961e-18   7.30074931e-02   7.30074931e-02]
   [ -1.67586721e-03  -3.23424322e-02  -1.86629967e-02 ...,
      7.30074931e-02  -7.83119979e-02  -2.43052691e-02]
   [ -1.67586721e-03  -3.23424322e-02   1.86629967e-02 ...,
      7.30074931e-02  -2.43052691e-02  -7.83119979e-02]]

  [[  4.13579000e-01   9.59611007e-02   5.72000216e-03 ...,
     -4.31279145e-03   2.32041931e-02   2.24675658e-02]
   [  9.59611007e-02   3.36126862e-01   4.28953693e-02 ...,
     -3.23424322e-02   1.68271813e-01   1.37634766e-01]
   [  5.72000216e-03   4.28953693e-02   3.40989193e-01 ...,
     -7.84754695e-03   1.23734852e-01  -6.94473081e-02]
   ..., 
   [ -4.31279145e-03  -3.23424322e-02  -7.84754695e-03 ...,
      3.36498015e-01  -9.32941280e-02  -7.42124336e-02]
   [  2.32041931e-02   1.68271813e-01   1.23734852e-01 ...,
     -9.32941280e-02   3.14059122e-01   7.16787171e-02]
   [  2.24675658e-02   1.37634766e-01  -6.94473081e-02 ...,
     -7.42124336e-02   7.16787171e-02   2.12655417e-01]]

  [[  4.13579000e-01   9.59611007e-02  -5.72000216e-03 ...,
     -4.31279145e-03   2.24675658e-02   2.32041931e-02]
   [  9.59611007e-02   3.36126862e-01  -4.28953693e-02 ...,
     -3.23424322e-02   1.37634766e-01   1.68271813e-01]
   [ -5.72000216e-03  -4.28953693e-02   3.40989193e-01 ...,
      7.84754695e-03   6.94473081e-02  -1.23734852e-01]
   ..., 
   [ -4.31279145e-03  -3.23424322e-02   7.84754695e-03 ...,
      3.36498015e-01  -7.42124336e-02  -9.32941280e-02]
   [  2.24675658e-02   1.37634766e-01   6.94473081e-02 ...,
     -7.42124336e-02   2.12655417e-01   7.16787171e-02]
   [  2.32041931e-02   1.68271813e-01  -1.23734852e-01 ...,
     -9.32941280e-02   7.16787171e-02   3.14059122e-01]]]


 [[[  0.00000000e+00   0.00000000e+00   2.44774121e-02 ...,
      0.00000000e+00   1.19158318e-03  -1.19158318e-03]
   [  0.00000000e+00   0.00000000e+00   3.78086072e-02 ...,
      0.00000000e+00   5.72000216e-03  -5.72000216e-03]
   [  2.44774121e-02   3.78086072e-02   0.00000000e+00 ...,
     -3.36278574e-19   1.31229075e-02   1.31229075e-02]
   ..., 
   [  0.00000000e+00   0.00000000e+00  -3.36278574e-19 ...,
      0.00000000e+00  -2.15397470e-03   2.15397470e-03]
   [  1.19158318e-03   5.72000216e-03   1.31229075e-02 ...,
     -2.15397470e-03   1.02011735e-02   6.77626358e-21]
   [ -1.19158318e-03  -5.72000216e-03   1.31229075e-02 ...,
      2.15397470e-03   6.77626358e-21  -1.02011735e-02]]

  [[  0.00000000e+00   0.00000000e+00   3.78086072e-02 ...,
      0.00000000e+00   2.22268203e-03  -2.22268203e-03]
   [  0.00000000e+00   0.00000000e+00   1.80518391e-01 ...,
      0.00000000e+00   4.28953693e-02  -4.28953693e-02]
   [  3.78086072e-02   1.80518391e-01   0.00000000e+00 ...,
     -4.78751979e-19   8.36883904e-02   8.36883904e-02]
   ..., 
   [  0.00000000e+00   0.00000000e+00  -4.78751979e-19 ...,
      0.00000000e+00  -1.86629967e-02   1.86629967e-02]
   [  2.22268203e-03   4.28953693e-02   8.36883904e-02 ...,
     -1.86629967e-02   1.03864238e-01  -4.33680869e-19]
   [ -2.22268203e-03  -4.28953693e-02   8.36883904e-02 ...,
      1.86629967e-02  -4.33680869e-19  -1.03864238e-01]]

  [[  1.11581381e+00   2.56683985e-01   0.00000000e+00 ...,
     -5.22260861e-18   6.06194552e-02   6.06194552e-02]
   [  2.56683985e-01   8.17022603e-01   0.00000000e+00 ...,
     -1.21542565e-18   3.40989193e-01   3.40989193e-01]
   [  0.00000000e+00   0.00000000e+00   8.80159091e-01 ...,
      0.00000000e+00   2.18379651e-01  -2.18379651e-01]
   ..., 
   [ -5.22260861e-18  -1.21542565e-18   0.00000000e+00 ...,
      7.85270201e-01  -1.51065162e-01  -1.51065162e-01]
   [  6.06194552e-02   3.40989193e-01   2.18379651e-01 ...,
     -1.51065162e-01   5.26915942e-01   1.45284425e-01]
   [  6.06194552e-02   3.40989193e-01  -2.18379651e-01 ...,
     -1.51065162e-01   1.45284425e-01   5.26915942e-01]]

  ..., 
  [[  0.00000000e+00   0.00000000e+00  -3.36278574e-19 ...,
      0.00000000e+00  -1.67895211e-04   1.67895211e-04]
   [  0.00000000e+00   0.00000000e+00  -4.78751979e-19 ...,
      0.00000000e+00  -7.84754695e-03   7.84754695e-03]
   [ -3.36278574e-19  -4.78751979e-19   0.00000000e+00 ...,
      4.74444448e-02  -1.14686513e-02  -1.14686513e-02]
   ..., 
   [  0.00000000e+00   0.00000000e+00   4.74444448e-02 ...,
      0.00000000e+00   1.25358845e-02  -1.25358845e-02]
   [ -1.67895211e-04  -7.84754695e-03  -1.14686513e-02 ...,
      1.25358845e-02  -2.95928282e-02  -1.08420217e-19]
   [  1.67895211e-04   7.84754695e-03  -1.14686513e-02 ...,
     -1.25358845e-02  -1.08420217e-19   2.95928282e-02]]

  [[  2.31295029e-01   5.43844411e-02   1.31229075e-02 ...,
     -2.15397470e-03   1.37576874e-02   1.21261199e-02]
   [  5.43844411e-02   2.03480113e-01   8.36883904e-02 ...,
     -1.86629967e-02   1.23734852e-01   6.94473081e-02]
   [  1.31229075e-02   8.36883904e-02   2.18379651e-01 ...,
     -1.14686513e-02   1.14555834e-01  -1.59980511e-02]
   ..., 
   [ -2.15397470e-03  -1.86629967e-02  -1.14686513e-02 ...,
      1.97681017e-01  -6.78492639e-02  -3.65604761e-02]
   [  1.37576874e-02   1.23734852e-01   1.14555834e-01 ...,
     -6.78492639e-02   2.63890558e-01   4.53601710e-02]
   [  1.21261199e-02   6.94473081e-02  -1.59980511e-02 ...,
     -3.65604761e-02   4.53601710e-02   9.39252241e-02]]

  [[ -2.31295029e-01  -5.43844411e-02   1.31229075e-02 ...,
      2.15397470e-03  -1.21261199e-02  -1.37576874e-02]
   [ -5.43844411e-02  -2.03480113e-01   8.36883904e-02 ...,
      1.86629967e-02  -6.94473081e-02  -1.23734852e-01]
   [  1.31229075e-02   8.36883904e-02  -2.18379651e-01 ...,
     -1.14686513e-02  -1.59980511e-02   1.14555834e-01]
   ..., 
   [  2.15397470e-03   1.86629967e-02  -1.14686513e-02 ...,
     -1.97681017e-01   3.65604761e-02   6.78492639e-02]
   [ -1.21261199e-02  -6.94473081e-02  -1.59980511e-02 ...,
      3.65604761e-02  -9.39252241e-02  -4.53601710e-02]
   [ -1.37576874e-02  -1.23734852e-01   1.14555834e-01 ...,
      6.78492639e-02  -4.53601710e-02  -2.63890558e-01]]]


 [[[  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   ..., 
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   ..., 
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   ..., 
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]]

  ..., 
  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   ..., 
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   ..., 
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]]

  [[  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   ..., 
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,
      0.00000000e+00   0.00000000e+00   0.00000000e+00]]]


 [[[ -1.09317641e-17  -3.29465902e-18   0.00000000e+00 ...,
      2.44774121e-02  -8.98434932e-04  -8.98434932e-04]
   [ -3.29465902e-18  -5.19621701e-18   0.00000000e+00 ...,
      3.78086072e-02  -4.31279145e-03  -4.31279145e-03]
   [  0.00000000e+00   0.00000000e+00  -5.22260861e-18 ...,
      0.00000000e+00  -2.15397470e-03   2.15397470e-03]
   ..., 
   [  2.44774121e-02   3.78086072e-02   0.00000000e+00 ...,
     -5.89516576e-18   1.18901803e-02   1.18901803e-02]
   [ -8.98434932e-04  -4.31279145e-03  -2.15397470e-03 ...,
      1.18901803e-02  -7.69152401e-03  -2.77201102e-03]
   [ -8.98434932e-04  -4.31279145e-03   2.15397470e-03 ...,
      1.18901803e-02  -2.77201102e-03  -7.69152401e-03]]

  [[ -2.97941395e-18  -5.73294162e-19   0.00000000e+00 ...,
      3.78086072e-02  -1.67586721e-03  -1.67586721e-03]
   [ -5.73294162e-19  -2.38435084e-18   0.00000000e+00 ...,
      1.80518391e-01  -3.23424322e-02  -3.23424322e-02]
   [  0.00000000e+00   0.00000000e+00  -1.21542565e-18 ...,
      0.00000000e+00  -1.86629967e-02   1.86629967e-02]
   ..., 
   [  3.78086072e-02   1.80518391e-01   0.00000000e+00 ...,
     -2.17292961e-18   7.30074931e-02   7.30074931e-02]
   [ -1.67586721e-03  -3.23424322e-02  -1.86629967e-02 ...,
      7.30074931e-02  -7.83119979e-02  -2.43052691e-02]
   [ -1.67586721e-03  -3.23424322e-02   1.86629967e-02 ...,
      7.30074931e-02  -2.43052691e-02  -7.83119979e-02]]

  [[  0.00000000e+00   0.00000000e+00  -3.36278574e-19 ...,
      0.00000000e+00  -1.67895211e-04   1.67895211e-04]
   [  0.00000000e+00   0.00000000e+00  -4.78751979e-19 ...,
      0.00000000e+00  -7.84754695e-03   7.84754695e-03]
   [ -3.36278574e-19  -4.78751979e-19   0.00000000e+00 ...,
      4.74444448e-02  -1.14686513e-02  -1.14686513e-02]
   ..., 
   [  0.00000000e+00   0.00000000e+00   4.74444448e-02 ...,
      0.00000000e+00   1.25358845e-02  -1.25358845e-02]
   [ -1.67895211e-04  -7.84754695e-03  -1.14686513e-02 ...,
      1.25358845e-02  -2.95928282e-02  -1.08420217e-19]
   [  1.67895211e-04   7.84754695e-03  -1.14686513e-02 ...,
     -1.25358845e-02  -1.08420217e-19   2.95928282e-02]]

  ..., 
  [[  1.11581381e+00   2.56683985e-01   0.00000000e+00 ...,
     -5.89516576e-18   6.05233682e-02   6.05233682e-02]
   [  2.56683985e-01   8.17022603e-01   0.00000000e+00 ...,
     -2.17292961e-18   3.36498015e-01   3.36498015e-01]
   [  0.00000000e+00   0.00000000e+00   7.85270201e-01 ...,
      0.00000000e+00   1.97681017e-01  -1.97681017e-01]
   ..., 
   [ -5.89516576e-18  -2.17292961e-18   0.00000000e+00 ...,
      8.80159091e-01  -1.62638022e-01  -1.62638022e-01]
   [  6.05233682e-02   3.36498015e-01   1.97681017e-01 ...,
     -1.62638022e-01   5.09979865e-01   1.49079118e-01]
   [  6.05233682e-02   3.36498015e-01  -1.97681017e-01 ...,
     -1.62638022e-01   1.49079118e-01   5.09979865e-01]]

  [[ -1.74392806e-01  -4.10050112e-02  -2.15397470e-03 ...,
      1.18901803e-02  -1.03730794e-02  -1.00494912e-02]
   [ -4.10050112e-02  -1.53420797e-01  -1.86629967e-02 ...,
      7.30074931e-02  -9.32941280e-02  -7.42124336e-02]
   [ -2.15397470e-03  -1.86629967e-02  -1.51065162e-01 ...,
      1.25358845e-02  -6.78492639e-02   3.65604761e-02]
   ..., 
   [  1.18901803e-02   7.30074931e-02   1.25358845e-02 ...,
     -1.62638022e-01   7.57254664e-02   5.88677920e-02]
   [ -1.03730794e-02  -9.32941280e-02  -6.78492639e-02 ...,
      7.57254664e-02  -1.98969320e-01  -4.46735990e-02]
   [ -1.00494912e-02  -7.42124336e-02   3.65604761e-02 ...,
      5.88677920e-02  -4.46735990e-02  -1.25906109e-01]]

  [[ -1.74392806e-01  -4.10050112e-02   2.15397470e-03 ...,
      1.18901803e-02  -1.00494912e-02  -1.03730794e-02]
   [ -4.10050112e-02  -1.53420797e-01   1.86629967e-02 ...,
      7.30074931e-02  -7.42124336e-02  -9.32941280e-02]
   [  2.15397470e-03   1.86629967e-02  -1.51065162e-01 ...,
     -1.25358845e-02  -3.65604761e-02   6.78492639e-02]
   ..., 
   [  1.18901803e-02   7.30074931e-02  -1.25358845e-02 ...,
     -1.62638022e-01   5.88677920e-02   7.57254664e-02]
   [ -1.00494912e-02  -7.42124336e-02  -3.65604761e-02 ...,
      5.88677920e-02  -1.25906109e-01  -4.46735990e-02]
   [ -1.03730794e-02  -9.32941280e-02   6.78492639e-02 ...,
      7.57254664e-02  -4.46735990e-02  -1.98969320e-01]]]]
Out[36]:
[-65.138374025697487,
 -74.467494698388464,
 -74.958013783771676,
 -74.959757388633875,
 -74.959839790498989,
 -74.959853191419228]
In [37]:
from pyquante2 import h2o,basisset,rhf
from pyquante2.utils import dmat
from pyquante2.ints.integrals import twoe_integrals,twoe_integrals_compressed
bfs = basisset(h2o,'sto3g')
solver = rhf(h2o,bfs)
solver.converge()
D = dmat(solver.orbs,h2o.nocc())
i2 = twoe_integrals(bfs)
i2c = twoe_integrals_compressed(bfs)
In [38]:
%timeit twoe_integrals(bfs)
10 loops, best of 3: 193 ms per loop
In [39]:
%timeit twoe_integrals_compressed(bfs)
10 loops, best of 3: 182 ms per loop
In [40]:
%timeit i2.get_j(D)
100000 loops, best of 3: 10.1 us per loop
In [41]:
%timeit i2c.get_j(D)
100 loops, best of 3: 4.86 ms per loop
In [*]:
(i2.get_j(D)-i2c.get_j(D)).max()
Out[*]:
2.2204460492503131e-16

There are several significant results here:

  • The uncompressed integrals don't take any longer
  • The get_j() function is much faster.
  • The uncompressed ones are now
In [*]:
from pyquante2 import h2o,basisset,rhf
from pyquante2.utils import dmat
from pyquante2.ints.integrals import twoe_integrals,twoe_integrals_compressed
bfs = basisset(h2o,'6-31g**')
solver = rhf(h2o,bfs)
solver.converge()
D = dmat(solver.orbs,h2o.nocc())
i2 = twoe_integrals(bfs)
i2c = twoe_integrals_compressed(bfs)
In [*]: