babbush / HistoricalFermiLib

This is repo where we developed FermiLib, which then became OpenFermion
Apache License 2.0
1 stars 0 forks source link

Rdm #39

Closed Spaceenter closed 7 years ago

Spaceenter commented 7 years ago

I tried to add tests for get_qubit_term_expectation() and get_qubit_expectations() but had some difficulties, ideally we should calculate the expectations by hand and compare the result from the functions, but I'm not familiar with the computations (jordan-wigner involved in these two functions). Could you or someone who is familiar with the computations by hand help provide a few simple test examples? Then I could code into the test. Or should I just trust the computed value from the function, and use put that value into the test? @babbush

babbush commented 7 years ago

Hi Wei, in response to your question about the expectation values, I think doing it by hand is not really going to work. Its very complicated to come up with this stuff by hand. But one thing you can do, for instance, is check to make sure that the expectation value of the Hamiltonian is correct. If you have the RDM from a CISD calculation then the expectation value of the Hamiltonian with the CISD RDM should be exactly equal to the cisd energy (which is an attribute of MolecularData that is populated whenever a CISD calculation is run).

Spaceenter commented 7 years ago

Added more commits. Please take a look again. @babbush