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))
Besides, the kernel crashes when running ma = tc.quantum.PauliStringSum2COO_numpy(lsa, wa)
Cross-referenced from https://github.com/tencent-quantum-lab/tensorcircuit/issues/120 which uses
openfermion.chem
libraryI am trying to migrate vqe_h2o.ipynb to use
CO2
carbon dioxide molecule.Note: Another relevant issues would be https://github.com/quantumlib/OpenFermion/issues/744 and https://github.com/pyscf/pyscf/issues/1202#issuecomment-1416736671 which use another method to retrieve one-body and two-body terms.
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 forCO2
? The video comes with a notebook code which no longer runs since it is using deprecatedqiskit-chemistry
package.ma = tc.quantum.PauliStringSum2COO_numpy(lsa, wa)