Automated generation of expressions for matrix elements of arbitrary n-particle operators in the basis of Slater determinants using the Wick theorem.
Let us evaluate expressions for matrix elements of one- and two-particle effective interaction operators in the (0h2p) Fock space sector. These expressions will be used to construct effective Hamiltonian operator in the Fock-space multireference coupled cluster calculation. We have (in terms of second-quantized operators):
where
The input file for wick contains definitions of both one- and two-particle interaction operators and bra/ket Slater determinants:
#
# comments start with '#'
# Heff operator matrix elements for the Fock-space sector 0h2p
#
# define indices used in determinants and operators
holes i j k
particles a b c d
any p q r s t u
# define determinants
operator bra 1.0 { b a }
operator ket 1.0 { c+ d+ }
# define operators
operator heff1 1.0 { p+ q }
operator heff2 0.5 { p+ q+ s r }
# task
? bra heff1 ket
? bra heff2 ket
Note that one can define several tasks in the single input file (we calculate first matrix elements for the one-particle operator and then for the two-particle one). Run:
python main.py 02-heff.inp | tee 02-heff.out
Output will contain optimized expression for matrix elements:
(0) + 1.0 heff1 [ b d ] d_ac
(1) - 1.0 heff1 [ b c ] d_ad
(2) - 1.0 heff1 [ a d ] d_bc
(3) + 1.0 heff1 [ a c ] d_bd
and
(0) + 1.0 heff2 [ b a d c ]
(1) - 1.0 heff2 [ b a c d ]
Note that these expressions do not imply the antisymmetry of the operators. If one uses the Goldstone-Brandow antisymmetrized formalism to deal with diagrams, one have to drop off redundant terms by hands. In this case the last expression should be:
(0) + 1.0 heff2 [ b a d c ]
Expressions in higher Fock space sectors (0h3p, 1h2p, etc) are evaluated in a completely same manner (see the examples directory). All expressions for