Operator and tensor contraction engines computeraided synthesis of

  • Slides: 29
Download presentation
Operator and tensor contraction engines computer-aided synthesis of coupled-cluster programs of any given excitation

Operator and tensor contraction engines computer-aided synthesis of coupled-cluster programs of any given excitation order So Hirata W. R. Wiley Environmental Molecular Sciences Laboratory Pacific Northwest National Laboratory* *Operated by Battelle for the US Department of Energy Sponsored by The US Department of Energy Office of Science, Basic Energy Science

Collaborators n G. Baumgartner, D. Corciorva, R. Pitzer, P. Sadayappan, and J. Wilkins Ohio

Collaborators n G. Baumgartner, D. Corciorva, R. Pitzer, P. Sadayappan, and J. Wilkins Ohio State University n D. Bernholdt Oak Ridge National Laboratory n R. Harrison Pacific Northwest National Laboratory n M. Nooijen Princeton University n J. Ramanujam Louisiana State University

Motivation n The derivation of ab initio many-electron theory formalisms and the implementation of

Motivation n The derivation of ab initio many-electron theory formalisms and the implementation of them into efficient computer programs are often an extremely daunting task and error-prone. This bottleneck has impeded high-performance computing based on ab initio many-electron theories and the development of novel and potentially more complex many-electron theories. With the modern massively parallel supercomputers, such complex but powerful methods as CCSDT, CCSDTQ, EOMCCSDT, EOM-CCSDTQ, etc. would become routine if this bottleneck were to be removed.

Goal n n Develop a high-level computer language which does n Symbolic manipulation of

Goal n n Develop a high-level computer language which does n Symbolic manipulation of second-quantized operators and automatic derivation of working formulas that are ready to be implemented, n Computer-aided (semi-automatic) implementation of these formulas into efficient programs. Such a language will facilitate n Implementation of existing ab initio many-electron methods, that are too complex to be manually written in an efficient program, n Implementation into algorithms that may be optimized for particular computer resource limitations, n Development and application of novel ab initio manyelectron methods expediently.

This study Application to coupled-cluster theory n Operator contraction engine: automatic derivation of coupled-cluster

This study Application to coupled-cluster theory n Operator contraction engine: automatic derivation of coupled-cluster (CC) energy and amplitude equations, n n Tensor contraction engine: semi-automatic synthesis of prototype Python and Fortran 90 CC programs, n n LCCD, LCCSD, CCSDT, CCSDT-1 a, CCSDT-1 b, CCSDT-2, CCSDT-3. LCCD, LCCSD, CCSDT Tensor contraction engine: semi-automatic synthesis of efficient (parallel) Fortran 77 CC programs in the NWChem program suite, with spin, spatial, and permutation symmetry considered, n LCCD, CCD.

History Unconventional CC implementation n Harris (1999) n n Hirata, Nooijen & Bartlett (2000)

History Unconventional CC implementation n Harris (1999) n n Hirata, Nooijen & Bartlett (2000) n n CC: determinant-based, O(N 2 n+4) scaling Kallay & Surjan (2000– 2002) n n n CC, EOM-CC, IP/EA-EOM-CC: determinant-based, O(N !) scaling Olsen (2000) n n CC equations by Maple V CC, EOM-CC: determinant-based, O(N 2 n+4) scaling CC: string-based, O(N 2 n+2) scaling Nooijen and Lotrich (2001) n n Brueckner CCD equations and program Spin-adapted open-shell CCSD equations and program

OCE and TCE n Operator contraction engine (OCE) n n Starting from the simple

OCE and TCE n Operator contraction engine (OCE) n n Starting from the simple CC ansatz (exponential wave function and projection equations), it generates the simplest set of CC working equations (energy and amplitude equations), each being a sum of multiple tensor contraction (A=BCDEF…) of integrals and excitation amplitudes. Tensor contraction engine (TCE) n Given any multiple tensor contraction (A=BCDEF…) expression, it breaks this down into a sequence of elementary tensor contractions (X=BC; Y=XD; Z=YE; …) with a minimal operational/memory cost, factors common multiplication, and implements them into a Python/Fortran 90/Fortran 77 program.

Operator contraction engine n Three ways to derive CC equations n Slater’s rules n

Operator contraction engine n Three ways to derive CC equations n Slater’s rules n n Normal ordered operators (which we elect to use) n n Very general, but impractically tedious even for just deriving MP 3. General and expedient. But, it tends to generate the same term many times. Disconnected terms will arise. Diagrams n Specialized and most expedient. It gives the same term only once. The notion of “connectedness” is evident.

Normal ordered operators n n n CC and many wave-function-based methods are defined in

Normal ordered operators n n n CC and many wave-function-based methods are defined in terms of “second quantized operators. ” Second quantized operators follow such simple rules as n p†q + q†p = dpq, p†q† + q†p† = 0, pq + qp = 0. When considering an expectation value of second quantized operators, it is advantageous to reorder them in what is called “normal order”, so that the rules become even simpler n {…a…}…{…b†…} = dab, {…i†…}…{…j…} = dij.

What OCE does is … n n Starting from a simple CC equation written

What OCE does is … n n Starting from a simple CC equation written with normal ordered operators like to make all possible contractions, and obtain tensor contractions like

OCE program n n n Written in Python 2. 2. Tested for CCD, CCSD,

OCE program n n n Written in Python 2. 2. Tested for CCD, CCSD, and CCSDT. Object oriented. The objects and methods include: n Operator, Amplitude, Summation, n Operator. Sequence n n alreadycontracted(), isunabletocontract(), performcontraction(), performfullcontraction(), hasthesameform(), relabels(), fullyrelabels(), hasnomismatch(), canmerge(), merges(), swapoperators(), swapamplitudes(), etc. List. Operator. Sequence n add(), join(), performcontraction(), performfullcontraction(), simplifywithpermutation(), fullysimplifywithpermutation(), operatorpermutation(), amplitudepermutation(), deletedisconnected(), etc.

How OCE works n n Define all the operators, integrals and amplitudes, and summation

How OCE works n n Define all the operators, integrals and amplitudes, and summation as objects While (not fully contracted) n n n Perform a single operator contraction Count the number of the remaining operators and delete the term if it is leading to a dead end Consolidate two or more terms into one that are identical to each other to renaming the summation indexes (more thorough simplification could be expensive and should be performed only once outside the loop ) End loop Delete disconnected terms Consolidate two or more terms into one that are identical to each other to all possible permutations and renaming of summation indexes

OCE sample input (CCSD VT 2 term) import oce a=oce. Operator("particle", "annihilation", 1) b=oce.

OCE sample input (CCSD VT 2 term) import oce a=oce. Operator("particle", "annihilation", 1) b=oce. Operator("particle", "annihilation", 2) i=oce. Operator("hole", "creation", 3) j=oce. Operator("hole", "creation", 4) p=oce. Operator("general", "creation", 5) q=oce. Operator("general", "creation", 6) r=oce. Operator("general", "annihilation", 7) s=oce. Operator("general", "annihilation", 8) c=oce. Operator("particle", "creation", 9) d=oce. Operator("particle", "creation", 10) k=oce. Operator("hole", "annihilation", 11) l=oce. Operator("hole", "annihilation", 12) sum = oce. Summation([p, q, r, s, c, d, k, l]) v=oce. Amplitude("v", [p, q, r, s], 1) t 2=oce. Amplitude("t", [c, d, k, l], 1) # T 2 b. V=(1/16) Sum(p, q, r, s, c, d, k, l) v(p, q, r, s) t(c, d, k, l) # <0|{i+ j+ b a}{p+ q+ s r}{c+ d+ l k}|0> T 2 b. V=oce. Operator. Sequence(1. 0/16. 0, sum, [v, t 2], [[i, j, b, a], [p, q, s, r], [c, d, l, k]])

OCE sample output (CCSD VT 2 term) >>> T 2 b. V. show() +0.

OCE sample output (CCSD VT 2 term) >>> T 2 b. V. show() +0. 0625 * Sum ( g 5 g 6 g 7 g 8 p 9 p 10 h 11 h 12 ) * v ( g 5 g 6 g 7 g 8 ) * t ( p 9 p 10 h 11 h 12 ) * <0| { h 3+ h 4+ p 2 p 1 } { g 5+ g 6+ g 8 g 7 } { p 9+ p 10+ h 12 h 11 } |0> >>> result = T 2 b. V. performfullcontraction(). . . commencing full operator contraction. . . iteration = 1, number of terms = 2 (before merging terms 4). . . iteration = 2, number of terms = 4 (before merging terms 6). . . iteration = 3, number of terms = 8 (before merging terms 16). . . iteration = 4, number of terms = 14 (before merging terms 21). . . iteration = 5, number of terms = 10 (before merging terms 10). . . iteration = 6, number of terms = 8 (before merging terms 8) >>> result = result. deletedisconnected(). . . 0 disconnected terms have been deleted >>> result = result. fullysimplifywithpermutation (). . . consolidating terms. . . iteration = 1, number of terms = 7 (before merging terms 8). . . iteration = 2, number of terms = 6 (before merging terms 7). . . iteration = 3, number of terms = 6 (before merging terms 6) >>> result. show() -1. 0 * Sum ( p 10 h 11 ) * v ( p 2 h 11 p 10 h 3 ) * t ( p 10 h 11 h 4 ) +1. 0 * Sum ( p 10 h 11 ) * v ( p 1 h 11 p 10 h 3 ) * t ( p 2 p 10 h 11 h 4 ) +1. 0 * Sum ( p 10 h 11 ) * v ( p 2 h 11 p 10 h 4 ) * t ( p 10 h 11 h 3 ) -1. 0 * Sum ( p 10 h 11 ) * v ( p 1 h 11 p 10 h 4 ) * t ( p 2 p 10 h 11 h 3 ) -0. 5 * Sum ( h 11 h 12 ) * v ( h 12 h 11 h 4 h 3 ) * t ( p 2 p 1 h 12 ) -0. 5 * Sum ( p 9 p 10 ) * v ( p 2 p 10 p 9 ) * t ( p 9 p 10 h 4 h 3 )

Tensor contraction engine n n n TCE reads a list of multiple tensor contraction

Tensor contraction engine n n n TCE reads a list of multiple tensor contraction expression such as from, e. g. , an output file of OCE. There are N ! distinct orders in which an N -fold multiple tensor contraction is performed. A = BCDE = B(C(DE)) = ((BC)D)E = ((BD)E)C = ((BD)C)E = ((BE)C)D) = ((BE)D)C = …, etc. TCE finds the best contraction order with the minimal operation/memory costs. The best contraction order for the above example is We further consolidate two or more tensor contractions by factoring the common multiplication operation; AB + AC + AD = A(B+C+D) to reduce the operation cost.

TCE (continued) n TCE then generates n Python/Fortran 90 prototype CC programs for the

TCE (continued) n TCE then generates n Python/Fortran 90 prototype CC programs for the debugging purpose, n n n For closed- and open-shell systems, No spin, spatial symmetry, Permutation symmetry, Tested for LCCD, LCCSD, CCSDT. Fortran 77 production CC program to be compiled as a part of the NWChem program suite n n n For closed- and open-shell systems, Uses Global Arrays and Disk Resident Arrays for parallel computation, Spin and spatial symmetry; no spin adaptation, Permutation symmetry, Sorts the tensor elements (reorder the tensor indices) before performing the contraction by ga_dgemm, Tested for LCCD and CCD.

How TCE works n n n Read a list of multiple tensor contractions Break

How TCE works n n n Read a list of multiple tensor contractions Break down each multiple tensor contraction into a sequence of two-fold tensor contractions with the least operation/memory cost; create an “operation tree” that describes the order of tensor contractions and additions While (not fully factorized) n n n For each pair of two-fold tensor contraction at the same node of operation tree, factor a common multiplication if possible End loop Generate a Python/Fortran 90/Fortran 77 code

TCE sample output (breakdown of a CCSD V T 13 term) >>> import tce

TCE sample output (breakdown of a CCSD V T 13 term) >>> import tce >>> vt 1 t 1 t 1 = tce. File. Tensor. Contractions(“oce. out"). readtensorcontractions() >>> vt 1 t 1 t 1. show() -1. 0*Sum( h 13 h 14 p 11 )*v( h 13 h 14 p 11 h 8 )*t( p 6 h 13 )*t( p 5 h 14 )*t( p 11 h 7 ) +1. 0*Sum( h 13 h 14 p 11 )*v( h 13 h 14 p 11 h 7 )*t( p 6 h 13 )*t( p 5 h 14 )*t( p 11 h 8 ) >>> vt 1 t 1 t 1 = vt 1 t 1 t 1. breakdown(). . . there are 24 ways of breaking down. . . the best breakdown is [2, 1, 4, 3] the sequence with operation=N 0 O 3 V 2, memory=N 0 O 2 V 2 >>> vt 1 t 1 t 1. show(): i 0( p 5 p 6 h 7 h 8 ) += 1. 0*Sum( h 14 )*i 1( h 14 p 6 h 7 h 8 )*t( p 5 h 14 ) i 1( h 14 p 6 h 7 h 8 ) += 1. 0*Sum( p 11 )*i 2( h 14 p 6 h 8 p 11 )*t( p 11 h 7 ) i 2( h 14 p 6 h 8 p 11 ) += 1. 0*Sum( h 13 )*t( p 6 h 13 )*v( h 13 h 14 h 8 p 11 ) i 0( p 5 p 6 h 7 h 8 ) += 1. 0*Sum( h 14 )*i 1( h 14 p 6 h 7 h 8 )*t( p 5 h 14 ) i 1( h 14 p 6 h 7 h 8 ) += 1. 0*Sum( p 11 )*i 2( h 14 p 6 h 7 p 11 )*t( p 11 h 8 ) i 2( h 14 p 6 h 7 p 11 ) += -1. 0*Sum( h 13 )*t( p 6 h 13 )*v( h 13 h 14 h 7 p 11 )

TCE sample output (factorization of a CCSD V T 13 term) >>> vt 1

TCE sample output (factorization of a CCSD V T 13 term) >>> vt 1 t 1 t 1. fullyfactorize(). . . commencing full factorization. . . initial contraction cost 6. . . tensor contraction tier 1. . . 1 terms have been consolidated. . . iteration 1 cost 5. . . tensor contraction tier 2. . . tensor contraction tier 3. . . tensor contraction tier 4. . . tensor contraction tier 5. . . exiting full factorization. . . final contraction cost 5 <tce. Operation. Tree instance at 0 x 8197 e 94> >>> vt 1 t 1 t 1. show(): i 0( p 5 p 6 h 7 h 8 ) += 1. 0*Sum( h 14 )*i 1( h 14 p 6 h 7 h 8 )*t( p 5 h 14 ) i 1( h 14 p 6 h 7 h 8 ) += 1. 0*Sum( p 11 )*i 2( h 14 p 6 h 8 p 11 )*t( p 11 h 7 ) i 2( h 14 p 6 h 8 p 11 ) += 1. 0*Sum( h 13 )*t( p 6 h 13 )*v( h 13 h 14 h 8 p 11 ) i 1( h 14 p 6 h 7 h 8 ) += 1. 0*Sum( p 11 )*i 2( h 14 p 6 h 7 p 11 )*t( p 11 h 8 ) i 2( h 14 p 6 h 7 p 11 ) += -1. 0*Sum( h 13 )*t( p 6 h 13 )*v( h 13 h 14 h 7 p 11 )

TCE sample output (a Fortran 77 program) >>> vt 1 t 1 t 1.

TCE sample output (a Fortran 77 program) >>> vt 1 t 1 t 1. fortran 77(“vt 1 t 1 t 1”) Caller routine C C SUBROUTINE vt 1 t 1 t 1(geom, nirreps) This is a Fortran 77 program generated by Tensor Contraction Engine v. 1. 0 (c) All rights reserved by Battelle & Pacific Northwest Nat'l Lab (2002) IMPLICIT NONE INTEGER geom INTEGER nirreps CALL CREATEFILE_2('i 0', 'particle', 'hole') CALL CREATEFILE_2('i 1', 'hole', 'particle', 'hole') CALL CREATEFILE_2('i 2', 'hole', 'particle') CALL vt 1 t 1 t 1_1_1_1( geom, nirreps, 't 1', 'v 2', 'i 2') CALL vt 1 t 1 t 1_1_1(geom, nirreps, 'i 2', 't 1', 'i 1') CALL DELETEFILE_2('i 2', 'hole', 'particle') CALL CREATEFILE_2('i 2', 'hole', 'particle') CALL vt 1 t 1 t 1_1_2_1( geom, nirreps, 't 1', 'v 2', 'i 2') CALL vt 1 t 1 t 1_1_2(geom, nirreps, 'i 2', 't 1', 'i 1') CALL DELETEFILE_2('i 2', 'hole', 'particle') CALL vt 1 t 1 t 1_1(geom, nirreps, 'i 1', 't 1', 'i 0') CALL DELETEFILE_2('i 1', 'hole', 'particle', 'hole') RETURN END

(Fortran 77 program, continued) SUBROUTINE vt 1 t 1 t 1_1(geom, nirreps, filenamea, filenameb,

(Fortran 77 program, continued) SUBROUTINE vt 1 t 1 t 1_1(geom, nirreps, filenamea, filenameb, filenamec) This is a Fortran 77 program generated by Tensor Contraction Engine v. 1. 0 (c) All rights reserved by Battelle & Pacific Northwest Nat'l Lab (2002) i 0( p 5 p 6 h 7 h 8 ) += 1. 0*Sum( h 14 )*i 1( h 14 p 6 h 7 h 8 )*t( p 5 h 14 ) IMPLICIT NONE #include "global. fh" #include "mafdecls. fh" INTEGER geom INTEGER nirreps INTEGER p 5 INTEGER spin_p 5. . . DOUBLE PRECISION element CHARACTER*(*) filenamea CHARACTER*(*) filenameb CHARACTER*(*) filenamec DO spin_p 5 = 1, 2 DO spin_p 6 = 1, 2 DO spin_h 7 = 1, 2 DO spin_h 8 = 1, 2 IF ( spin_p 5 + spin_p 6 - spin_h 7 - spin_h 8. eq. 0) THEN DO spin_h 14 = 1, 2 IF ( spin_h 14 + spin_p 6 - spin_h 7 - spin_h 8. eq. 0) THEN Spin loops C C C

Symmetry loops (Fortran 77 program, continued) DO sym_p 5 = 1, nirreps DO sym_p

Symmetry loops (Fortran 77 program, continued) DO sym_p 5 = 1, nirreps DO sym_p 6 = 1, nirreps DO sym_h 7 = 1, nirreps DO sym_h 8 = 1, nirreps sym_tot = 1 CALL SYM_PRODUCT(geom, sym_tot, sym_p 5, sym_tot) CALL SYM_PRODUCT(geom, sym_tot, sym_p 6, sym_tot) CALL SYM_PRODUCT(geom, sym_tot, sym_h 7, sym_tot) CALL SYM_PRODUCT(geom, sym_tot, sym_h 8, sym_tot) IF (sym_tot. eq. 1) THEN DO sym_h 14 = 1, nirreps sym_tot = 1 CALL SYM_PRODUCT(geom, sym_tot, sym_h 14, sym_tot) CALL SYM_PRODUCT(geom, sym_tot, sym_p 6, sym_tot) CALL SYM_PRODUCT(geom, sym_tot, sym_h 7, sym_tot) CALL SYM_PRODUCT(geom, sym_tot, sym_h 8, sym_tot) IF (sym_tot. eq. 1) THEN CALL GET_RANGE(range_h 14, 'hole', spin_h 14, sym_h 14) CALL GET_RANGE(range_p 6, 'particle', spin_p 6, sym_p 6) CALL GET_RANGE(range_h 7, 'hole', spin_h 7, sym_h 7) CALL GET_RANGE(range_h 8, 'hole', spin_h 8, sym_h 8) CALL GET_RANGE(range_p 5, 'particle', spin_p 5, sym_p 5) dima 1 = range_h 14 * range_p 6 * range_h 7 * range_h 8 dimb 1 = range_p 5 * range_h 14

Sorting tensor elements (Fortran 77 program, continued) IF ((dima 1. gt. 0). and. (dimb

Sorting tensor elements (Fortran 77 program, continued) IF ((dima 1. gt. 0). and. (dimb 1. gt. 0)) THEN IF (. not. GA_CREATE( mt_dbl, dima 1, 1, 'noname', -1, g_a)) CALL ERRQUI &T('vt 1 t 1 t 1_1', 0) CALL GET_BLOCK_2(filenamea, g_a, 'hole', 'particle', 'hole', spi &n_h 14, spin_p 6, spin_h 7, spin_h 8, sym_h 14, sym_p 6, sym_h 7, sym_h 8) dima 1_sort = range_h 14 dima 2_sort = range_p 6 * range_h 7 * range_h 8 IF (. not. GA_CREATE( mt_dbl, dima 1_sort, dima 2_sort, 'noname', -1, g_a &_sort)) CALL ERRQUIT('vt 1 t 1 t 1_1', 1) DO h 14 = 1, range_h 14 DO p 6 = 1, range_p 6 DO h 7 = 1, range_h 7 DO h 8 = 1, range_h 8 idima 1 = h 14 + range_h 14 * ((p 6 - 1) + range_p 6 * ((h 7 - 1) + rang &e_h 7 * ((h 8 - 1)))) idima 1_sort = h 14 idima 2_sort = p 6 + range_p 6 * ((h 7 - 1) + range_h 7 * ((h 8 - 1))) CALL GA_GET(g_a, idima 1, 1, 1, element, 1) CALL GA_PUT(g_a_sort, idima 1_sort, idima 2_so &rt, element, 1) ENDDO

Matrix multiplication (Fortran 77 program, continued) IF (. not. GA_DESTROY(g_a)) CALL ERRQUIT('vt 1 t

Matrix multiplication (Fortran 77 program, continued) IF (. not. GA_DESTROY(g_a)) CALL ERRQUIT('vt 1 t 1 t 1_1', 2) IF (. not. GA_CREATE( mt_dbl, dimb 1, 1, 'noname', -1, g_b)) CALL ERRQUI &T('vt 1 t 1 t 1_1', 3) CALL GET_BLOCK_1(filenameb, g_b, 'particle', 'hole', spin_p 5, spin_h 14, &sym_p 5, sym_h 14) dimb 1_sort = range_h 14 dimb 2_sort = range_p 5 IF (. not. GA_CREATE( mt_dbl, dimb 1_sort, dimb 2_sort, 'noname', -1, g_b &_sort)) CALL ERRQUIT('vt 1 t 1 t 1_1', 4) DO p 5 = 1, range_p 5 DO h 14 = 1, range_h 14 idimb 1 = p 5 + range_p 5 * ((h 14 - 1)) idimb 1_sort = h 14 idimb 2_sort = p 5 CALL GA_GET(g_b, idimb 1, 1, 1, element, 1) CALL GA_PUT(g_b_sort, idimb 1_sort, idimb 2_so &rt, element, 1) ENDDO IF (. not. GA_DESTROY(g_b)) CALL ERRQUIT('vt 1 t 1 t 1_1', 5) IF (. not. GA_CREATE( mt_dbl, dima 2_sort, dimb 2_sort, 'noname', -1, g_c &_sort)) CALL ERRQUIT('vt 1 t 1 t 1_1', 6) CALL GA_DGEMM('T', 'N', dima 2_sort, dimb 2_sort, dima 1_sort, 1. 0 d 0, g_a_s &ort, g_b_sort, 0. 0 d 0, g_c_sort) IF (. not. GA_DESTROY(g_a_sort)) CALL ERRQUIT('vt 1 t 1 t 1_1', 7) IF (. not. GA_DESTROY(g_b_sort)) CALL ERRQUIT('vt 1 t 1 t 1_1', 8)

Demonstrative CC calculation (Water molecule CCSDT/STO-3 G) ============================ CC program generated by Tensor Contraction

Demonstrative CC calculation (Water molecule CCSDT/STO-3 G) ============================ CC program generated by Tensor Contraction Engine v 1. 0 ============================ Itr Residual Correlation Energy ----------------------1 0. 636309128191076 0. 00000000 2 0. 274784803456930 -0. 035867246923201 3 0. 112062167906955 -0. 045406888275035 4 0. 047665736569952 -0. 048438428974424 5 0. 021104976729436 -0. 049517957446161 6 0. 009763209811528 -0. 049933533729053 7 0. 004714355612446 -0. 050102544271580 8 0. 002357073655214 -0. 050174170563998 9 0. 001206855030316 -0. 050205550178195 10 0. 000626818888628 -0. 050219692509363 11 0. 000328134369413 -0. 050226226879313 12 0. 000172488766754 -0. 050229313181301 13 0. 000090868505520 -0. 050230799211318 14 0. 000047929280526 -0. 050231526647050 15 0. 000025302118622 -0. 050231887730092 16 0. 000013367119606 -0. 050232069037719 17 0. 000007067375183 -0. 050232160931932 18 0. 000003739864999 -0. 050232207858807 19 0. 000001980960704 -0. 050232231966068 20 0. 000001050415903 -0. 050232244408981 21 0. 000000557636262 -0. 050232250855253 -----------------------

Future extension n n n CC properties, analytical gradients Equation-of-motion CC for excited states

Future extension n n n CC properties, analytical gradients Equation-of-motion CC for excited states Many-body perturbation theory and perturbative correction to CC and EOM-CC Configuration interaction Multi-reference CC, PT, CI Spin adaptation

OCE sample output (CCSD T 2 equation) +1. 0 * v ( p 6

OCE sample output (CCSD T 2 equation) +1. 0 * v ( p 6 p 5 h 8 h 7 ) +1. 0 * Sum ( h 13 ) * f ( h 13 h 7 ) * t ( p 6 p 5 h 13 h 8 ) -1. 0 * Sum ( h 13 ) * f ( h 13 h 8 ) * t ( p 6 p 5 h 13 h 7 ) -1. 0 * Sum ( p 10 ) * f ( p 6 p 10 ) * t ( p 5 p 10 h 8 h 7 ) +1. 0 * Sum ( p 10 ) * f ( p 5 p 10 ) * t ( p 6 p 10 h 8 h 7 ) -1. 0 * Sum ( p 10 h 13 ) * v ( p 6 h 13 p 10 h 7 ) * t ( p 5 p 10 h 13 h 8 ) +1. 0 * Sum ( p 10 h 13 ) * v ( p 5 h 13 p 10 h 7 ) * t ( p 6 p 10 h 13 h 8 ) +1. 0 * Sum ( p 10 h 13 ) * v ( p 6 h 13 p 10 h 8 ) * t ( p 5 p 10 h 13 h 7 ) -1. 0 * Sum ( p 10 h 13 ) * v ( p 5 h 13 p 10 h 8 ) * t ( p 6 p 10 h 13 h 7 ) -0. 5 * Sum ( h 13 h 14 ) * v ( h 14 h 13 h 8 h 7 ) * t ( p 6 p 5 h 13 h 14 ) -0. 5 * Sum ( p 9 p 10 ) * v ( p 6 p 5 p 10 p 9 ) * t ( p 9 p 10 h 8 h 7 ) -0. 5 * Sum ( p 10 p 12 h 15 h 16 ) * v ( h 16 h 15 p 12 p 10 ) * t ( p 6 p 10 h 8 h 7 ) * t ( p 5 p 12 h 15 h 16 ) +0. 25 * Sum ( p 12 p 10 h 15 h 16 ) * v ( h 16 h 15 p 10 p 12 ) * t ( p 12 p 10 h 8 h 7 ) * t ( p 6 p 5 h 16 ) +0. 5 * Sum ( p 10 p 12 h 15 h 16 ) * v ( h 16 h 15 p 12 p 10 ) * t ( p 5 p 10 h 8 h 7 ) * t ( p 6 p 12 h 15 h 16 ) -0. 5 * Sum ( h 16 p 10 p 12 h 15 ) * v ( h 16 h 15 p 12 p 10 ) * t ( p 6 p 5 h 16 h 7 ) * t ( p 10 p 12 h 15 h 8 ) +1. 0 * Sum ( p 10 h 16 p 12 h 15 ) * v ( h 16 h 15 p 12 p 10 ) * t ( p 6 p 10 h 16 h 7 ) * t ( p 5 p 12 h 15 h 8 ) -0. 5 * Sum ( p 12 p 10 h 16 h 15 ) * v ( h 16 h 15 p 10 p 12 ) * t ( p 12 p 10 h 16 h 7 ) * t ( p 6 p 5 h 15 h 8 ) -1. 0 * Sum ( p 10 h 16 p 12 h 15 ) * v ( h 16 h 15 p 12 p 10 ) * t ( p 5 p 10 h 16 h 7 ) * t ( p 6 p 12 h 15 h 8 ) etc.

TCE sample output (a Python program) >>> vt 1 t 1 t 1. pythongen(“vt

TCE sample output (a Python program) >>> vt 1 t 1 t 1. pythongen(“vt 1 t 1 t 1”) def vt 1 t 1 t 1(N, nall, nocc, i 0, i 1, t 1, i 2, v 2): # This is a Python program generated by Tensor Contraction Engine v. 1. 0 # (c) All rights reserved by Battelle & Pacific Northwest Nat'l Lab (2002) for spin 14 in range(2): for h 14 in range(spin 14* nall[0], spin 14*nall[0]+nocc[spin 14]): for spin 6 in range(2): for p 6 in range(spin 6* nall[0]+nocc[spin 6], spin 6*nall[0]+nall[spin 6]): for spin 8 in range(2): for h 8 in range(spin 8* nall[0], spin 8*nall[0]+nocc[spin 8]): for spin 11 in range(2): for p 11 in range(spin 11* nall[0]+nocc[spin 11], spin 11*nall[0]+nall[spin 11]): i 2[((((h 14)*N+p 6)*N+h 8)*N+p 11)]=0. 0 for spin 13 in range(2): for h 13 in range(spin 13* nall[0], spin 13*nall[0]+nocc[spin 13]): i 2[((((h 14)*N+p 6)*N+h 8)*N+p 11)]=i 2[((((h 14)*N+p 6)*N+h 8)*N+p 11)] +(1. 0)*t 1[((p 6)*N+h 13)]*v 2[((((h 13)*N+h 14)*N+h 8)*N+p 11)] for spin 14 in range(2): for h 14 in range(spin 14* nall[0], spin 14*nall[0]+nocc[spin 14]): for spin 6 in range(2): for p 6 in range(spin 6* nall[0]+nocc[spin 6], spin 6*nall[0]+nall[spin 6]): . . .

TCE sample output (a Fortran 90 program) >>> vt 1 t 1 t 1.

TCE sample output (a Fortran 90 program) >>> vt 1 t 1 t 1. fortran 90(“vt 1 t 1 t 1”) SUBROUTINE vt 1 t 1 t 1(N, nall, nocc, i 0, i 1, t 1, i 2, v 2) ! This is a Fortran 90 program generated by Tensor Contraction Engine v. 1. 0 ! (c) All rights reserved by Battelle & Pacific Northwest Nat'l Lab (2002) IMPLICIT NONE INTEGER : : spin 14. . . DOUBLE PRECISION : : v 2(*) DO spin 14=0, 1 DO h 14=spin 14*nall(0)+1, spin 14*nall(0)+nocc(spin 14) DO spin 6=0, 1 DO p 6=spin 6*nall(0)+nocc(spin 6)+1, spin 6*nall(0)+nall(spin 6) DO spin 8=0, 1 DO h 8=spin 8*nall(0)+1, spin 8*nall(0)+nocc(spin 8) DO spin 11=0, 1 DO p 11=spin 11*nall(0)+nocc(spin 11)+1, spin 11*nall(0)+nall(spin 11) i 2(((((h 14 -1)*N+p 6 -1)*N+h 8 -1)*N+p 11))=0. 0 d 0 DO spin 13=0, 1 DO h 13=spin 13*nall(0)+1, spin 13*nall(0)+nocc(spin 13) i 2(((((h 14 -1)*N+p 6 -1)*N+h 8 -1)*N+p 11))=i 2(((((h 14 -1)*N+p 6 -1)*N+h 8 -1)*N+p 11))& +(1. 0 d 0)*t 1(((p 6 -1)*N+h 13))*v 2(((((h 13 -1)*N+h 14 -1)*N+h 8 -1)*N+p 11)) ENDDO. . .