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

give an hamiltonian manually to an ElectronicStructureProblem #833

Closed
orielkiss opened this issue Sep 22, 2022 · 3 comments
Closed

give an hamiltonian manually to an ElectronicStructureProblem #833

orielkiss opened this issue Sep 22, 2022 · 3 comments
Labels
type: feature request New feature or request

Comments

@orielkiss
Copy link

What should we add?

Hello,

when using algorithms implemented in qiskit, such as the VQE, it is common practice to use an ElectronicStructureProblem and to use a driver to build the Hamiltonian in second quantization. However, when working on problems outside quantum chemistry, it is difficult to integrate the hamiltonian into the problem instance, because of all the inter dependencies qiskit has.

To be quick: i have an Hamiltonian written in second quantization, and i would like to wrap it in a Problem instance such that i can then use the VQE implemented in qiskit and all the assocated techniques for quantum chemistry, like UCC and so on. However, if i try to give manually the Hamiltonian to an ElectronicStructureProblem , it produces errors since i do not use a driver. Is there an easy way to bypass this issue or could we create one?

Thanks you so much
Oriel

@orielkiss orielkiss added the type: feature request New feature or request label Sep 22, 2022
@mrossinek
Copy link
Member

This is exactly what the ongoing refactoring (see #814) is achieving. In fact, you can already do this since #796 got merged to the main branch. This will be part of the next release (early November).

I am currently working on the implementation of #666 which will further refactor the ElectronicEnergy and ElectronicStructureProblem (see TODO comments in the current implementation inside the qiskit_nature.second_q stack). I expect to open a PR for this later this week.

I am closing this issue, since the specific functionality requested here was already implemented in the main branch as part of #796.

@orielkiss
Copy link
Author

Thank you Max.

I am still a bit confused about how to use #796 to be honest. In the case described above, how can i wrap my fermionic operator (so in second quantisation) into the ElectronicStructureProblem? Or should i use another class?
Thank you!

@mrossinek
Copy link
Member

For the ElectronicStructureProblem you need to use the ElectronicEnergy. My upcoming work makes this easier.

However, you should be able to just use a BaseProblem. This is undocumented and untested at the moment. More changes are pending in the coming weeks so you may need to hang tight for a little while

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants