Skip to content
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

Help with one-body and two-body coefficients for orbital removal #810

Open
buttercutter opened this issue Feb 4, 2023 · 0 comments
Open

Comments

@buttercutter
Copy link

buttercutter commented Feb 4, 2023

Cross-referenced from tencent-quantum-lab/tensorcircuit#120 which uses openfermion.chem library

I am trying to migrate vqe_h2o.ipynb to use CO2 carbon dioxide molecule.

Note: Another relevant issues would be #744 and pyscf/pyscf#1202 (comment) which use another method to retrieve one-body and two-body terms.

  1. For print(fh.terms[((0, 1), (0, 0))]) which is the two-body coefficients, it gives -36.01932840424451. When I try to access the one-body coefficients using the following code snippet, nothing is printed out. Could you advise how to decide which orbitals to be removed for CO2 ? The video comes with a notebook code which no longer runs since it is using deprecated qiskit-chemistry package.
one_body_terms = fh.terms
for term, coefficient in one_body_terms.items():
    if len(term) == 2:
        # Only consider terms with one creation and one annihilation operator
        i, j = term
        if i[0] == "c" and j[0] == "c":
            print("Term: c^\dagger_{} c_{} Coefficient: {}".format(i[1], j[1], coefficient))
  1. Besides, the kernel crashes when running ma = tc.quantum.PauliStringSum2COO_numpy(lsa, wa)

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant