quantumlib / OpenFermion-PySCF

OpenFermion plugin to interface with the electronic structure package PySCF.
Apache License 2.0
105 stars 44 forks source link

CC double excitation pre-factor convention #43

Closed vincentelfving closed 5 years ago

vincentelfving commented 5 years ago

There is a subtlety with the definition of ccsd_double_amps generated by run_pyscf (and the _pyscf_molecular_data behind it). For a user to correctly instantiate the packed ccsd amplitudes in openfermion, he would actually need to do uccsd_singlet_get_packed_amplitudes(ccsd_single_amps, (1/2)*ccsd_double_amps, num_qubits, num_electrons) on data generated from run_pyscf. Notice the factor 1/2; In the literature, I don't think there is a clear winner on the prefactor in front of T_2, the CC doubles operator. I have seen 1, or 1/2, or 1/4.

However, as a simple test, I have compared several different methods, and for H2 and LiH, and found good agreement between 'classical' CCSD and quantum circuit UCCSD with the packed amplitudes generated by uccsd_singlet_get_packed_amplitudes(ccsd_single_amps, ccsd_double_amps, num_qubits, num_electrons), for input data from OpenfermionPsi4 and other test hdf5 files around, where there is no need for a pre-factor, and the assumptions/conventions therefore seem aligned.

Now, only for data generated by openfermionpyscf there is a need for this factor 0.5 (sanity check: omitting the factor gives results which are worse even than HF). Hope I explained that clearly, and perhaps someone can independently check this. A possible solution is to adjust the property ccsd_double_amps of PyscfMolecularData and insert the factor there, in order to be consistent with what uccsd_singlet_get_packed_amplitudes assumes.

babbush commented 5 years ago

Closed by #44