-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with active space feature in "generate_molecular_hamiltonian" #62
Comments
Does the ground state wavefunction have the correct number of electrons in the case that fails? |
No, when I use a number operator on the ground-state wavefunction of the frozen core Hamiltonian, I get 6 electrons instead of 4. |
There seem to be two problems in your code. The first is how you specify the geometry. The second problem is that the "refstr" (Hartree-Fock state basis) is incorrect. The correct code and output are shown below.
Output: PySCF HF Energy: It should be noted that the lowest eigenvalue obtained by Hamiltonian diagonalization does not necessarily correspond to the CASCI energy. This is because Hamiltonian diagonalization is performed by linear combinations of all electron configurations, so the obtained eigenstate do not necessarily preserve the number of electrons, Sz, etc. |
Sorry for the delay, but I just confirmed this works. Thanks for the help! |
I am trying to get frozen cores working with an OpenFermion-PySCF workflow, and am having issues. As an example, here I am freezing two electrons (i.e., one core orbital, i.e. 2 qubits.) When I set N_e = 6 and N_qubits = 12, i.e. the full active space, I get matching results between CASCI in PySCF and diagonalization of the Hamiltonian that OF-PSCF gives me. In this example, I use N_e = 4 and N_qubits = 10, and get the wrong reference and CASCI energies from the OF-PSCF Hamiltonian.
def test_adapt_vqe():
"""Test ADAPT on H6."""
if os.path.exists('test') == False:
os.makedirs('test')
Output:
PySCF HF Energy:
-3.1355322139663198
PYSCF CASCI:
-3.1981030445646623
OpenFermion-PySCF HF Energy:
-1.3744190019034384
OpenFermion-PySCF CASCI Energy:
-3.1614199163979224
The text was updated successfully, but these errors were encountered: