You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the module qiskit_nature.second_q.operators.tensor_ordering, the function find_index_order returns the wrong IndexType once the ERI is converted to PHYSICIST notation.
The problem arises from the following statement in the find_index_order function:
if isinstance(two_body_tensor, SymmetricTwoBodyIntegrals):
return IndexType.CHEMIST
which checks if the two_body_tensor object is an instance of the SymmetricTwoBodyIntegrals class. If the ERI is converted from CHEMIST to PHYSICIST notation (using to_physicist_ordering function) the returned object belong to the SymmetricTwoBodyIntegrals class and the statement returns the wrong IndexType .
How can we reproduce the issue?
Generate an ERI that respect the permutation symmetry in CHEMIST notation
from qiskit_nature.second_q.drivers import PySCFDriver
from qiskit_nature.second_q.operators import tensor_ordering, symmetric_two_body
driver = PySCFDriver()
problem = driver.run()
mo_hamiltonian = problem.hamiltonian
eri = symmetric_two_body.unfold(mo_hamiltonian.electronic_integrals.alpha["++--"])
print(tensor_ordering.find_index_order(eri))
It returns the CORRECT chemist index: IndexType.CHEMIST
Environment
What is happening?
From the module qiskit_nature.second_q.operators.tensor_ordering, the function find_index_order returns the wrong IndexType once the ERI is converted to PHYSICIST notation.
The problem arises from the following statement in the find_index_order function:
which checks if the two_body_tensor object is an instance of the SymmetricTwoBodyIntegrals class. If the ERI is converted from CHEMIST to PHYSICIST notation (using to_physicist_ordering function) the returned object belong to the SymmetricTwoBodyIntegrals class and the statement returns the wrong IndexType .
How can we reproduce the issue?
Generate an ERI that respect the permutation symmetry in CHEMIST notation
It returns the CORRECT chemist index: IndexType.CHEMIST
Convert to PHYSICIST notation
It returns the WRONG index: IndexType.CHEMIST
What should happen?
The correct result should be return:
IndexType.PHYSICIST
Any suggestions?
Remove the following lines from find_index_order function:
Alternatevely convert the output of _phys_to_chem and _chem_to_phys function as np.array(permuted_tensor)
The text was updated successfully, but these errors were encountered: