2
$\begingroup$

I was able to calculate the one and two-body integrals for the H2 with the following code

from qiskit.chemistry.drivers import PySCFDriver, UnitsType

atom = 'H .0 .0 .0; H .0 .0 0.74' 
distance_unit = UnitsType.ANGSTROM
basis = 'sto3g'

driver = PySCFDriver(atom, unit=distance_unit, basis=basis)

molecule = driver.run()

h1 = molecule.one_body_integrals
h2 = molecule.two_body_integrals
print( h1 ) 
print( h2 ) 

and the results is

[[-1.25330979  0.          0.          0.        ]
 [ 0.         -0.47506885  0.          0.        ]
 [ 0.          0.         -1.25330979  0.        ]
 [ 0.          0.          0.         -0.47506885]]
[[[[-0.33737796  0.          0.          0.        ]
   [ 0.         -0.09060523  0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]]

  [[ 0.         -0.09060523  0.          0.        ]
   [-0.3318557   0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]]

  [[ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [-0.33737796  0.          0.          0.        ]
   [ 0.         -0.09060523  0.          0.        ]]

  [[ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.         -0.09060523  0.          0.        ]
   [-0.3318557   0.          0.          0.        ]]]


 [[[ 0.         -0.3318557   0.          0.        ]
   [-0.09060523  0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]]

  [[-0.09060523  0.          0.          0.        ]
   [ 0.         -0.34882575  0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]]

  [[ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.         -0.3318557   0.          0.        ]
   [-0.09060523  0.          0.          0.        ]]

  [[ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [-0.09060523  0.          0.          0.        ]
   [ 0.         -0.34882575  0.          0.        ]]]


 [[[ 0.          0.         -0.33737796  0.        ]
   [ 0.          0.          0.         -0.09060523]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]]

  [[ 0.          0.          0.         -0.09060523]
   [ 0.          0.         -0.3318557   0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]]

  [[ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.         -0.33737796  0.        ]
   [ 0.          0.          0.         -0.09060523]]

  [[ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.          0.         -0.09060523]
   [ 0.          0.         -0.3318557   0.        ]]]


 [[[ 0.          0.          0.         -0.3318557 ]
   [ 0.          0.         -0.09060523  0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]]

  [[ 0.          0.         -0.09060523  0.        ]
   [ 0.          0.          0.         -0.34882575]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]]

  [[ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.          0.         -0.3318557 ]
   [ 0.          0.         -0.09060523  0.        ]]

  [[ 0.          0.          0.          0.        ]
   [ 0.          0.          0.          0.        ]
   [ 0.          0.         -0.09060523  0.        ]
   [ 0.          0.          0.         -0.34882575]]]]

This immediately raises the question of how qiskit labels the two-body integrals. If we look at the definition of second quantized Hamiltonian

$ H = \sum_{i,j}h_{ij}a^\dagger_i a_j + \frac{1}{2}\sum_{i,j,k,l}h_{ijkl}a^\dagger_ia^\dagger_ja_ka_l $

then we realize that $h_{0000}=0$, whereas qiskit gives -0.33737796. The answer for the integrals is given in the following table. Any helps are really appreciated.

enter image description here

$\endgroup$
0
$\begingroup$

Something to keep in mind is that integrals often hold two forms of symmetries - not only the symmetries enumerated in that table between the indices, but also the spins of the orbitals. I think this is explained well in Microsoft's documents. For example, if the input file notes $a^\dagger_0 a^\dagger_1 a_1 a_0$, we need to consider the potential permutations and the potential spins. So, we'd consider $a^\dagger_{0, \sigma} a^\dagger_{1, \rho} a_{1, \rho} a_{0, \sigma} $, and all of the permutations of the numbers, and all combinations of $\sigma, \rho \in \{ \uparrow, \downarrow \}$, where $\{ \uparrow, \downarrow \}$ are the spins.

So, while the $a^\dagger_0 a^\dagger_0 a_0 a_0$ may be invalid, $a^\dagger_{0, \uparrow}, a^\dagger_{0, \downarrow} a_{0, \downarrow} a_{0, \uparrow} $ is totally valid after indexing.

Admittedly, I have not dived into the PySCF documents, but my assumption is that programs like NWChem and PySCF all use the minimal integral representations and reconstruct from there.

$\endgroup$
2
  • $\begingroup$ Indeed, I agree that programs like this should give the minimal representations. I am more familiar with FCIDUMP format where only a handful of integrals are returned instead of 8x8x8x8 matrices as qiskit did. That is why I assumed the spin indices are included. I will take a look at the Microsoft's documents. Thanks! $\endgroup$
    – fagd
    Sep 18 '20 at 4:24
  • $\begingroup$ Yes, it's suuper strange that these 4D matrices are being used. I much prefer the dictionary style in Microsoft's docs $\endgroup$
    – C. Kang
    Sep 18 '20 at 4:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.