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

Generalize VibrationalOp.from_polynomial_tensor #1143

Open
mrossinek opened this issue Apr 26, 2023 · 0 comments
Open

Generalize VibrationalOp.from_polynomial_tensor #1143

mrossinek opened this issue Apr 26, 2023 · 0 comments
Labels

Comments

@mrossinek
Copy link
Member

What should we add?

The VibrationalOp.from_polynomial_tensor implementation currently is a bit more restrictive than it needs to be. This is mostly due to initial design restrictions when the new VibrationalIntegrals class was constructed. Below is an example:

from qiskit_nature.second_q.operators import VibrationalOp, VibrationalIntegrals

d = {
    (0, 1, 2): 2.0,
}

ints = VibrationalIntegrals.from_raw_integrals(d)

op = VibrationalOp.from_polynomial_tensor(ints)

print(op)
# Vibrational Operator
# number modes=1, number modals=[3], number terms=1
#   2.0 * ( +_0_1 -_0_2 )

However, currently there is no way of generating the following VibrationalOp from a PolynomialTensor,
because there is an implicit assumption that the mode index is identical within each pair of creation and annihilation terms:

op = VibrationalOp({"+_0_1 -_1_2": 1.0})

With the introduction of the Tensor class (#1033) and the refactored way of handling the label_template (#1060), it should be possible to also improve the implementation of VibrationalOp.from_polynomial_tensor to be less restrictive.

This would be especially useful for the implementation of #46 and other extensions that might be based on the VibrationalOp.

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

No branches or pull requests

1 participant