Qiskit Operators into Pennylane

Good morning,

I have a Qiskit Hamiltonian (created as a PauliSumOp) and I would like to use it also in Pennylane without recreating it from scratch, is it possible?
The idea is to use this Hamiltonian in a VQE.

Thank you very much

Hi @sbarison , thank you for your question!

You might extract the terms and construct the PL Hamiltonian with them. If you send us a code example of your Qiskit Hamiltonian, we can help you with constructing the PL one from it.

Also, this is worth looking at the following PL methods that helps you to extract the terms and build what you want:

Looking forward to hearing more from you.

Dear @maliasadi,
it’s not really important the specific Hamiltonian, given a generic PauliSumOp I was wondering if there was a method to translate it into a Pennylane observable, as the function from_qiskit for the circuits.

The first of the two links seems what I was looking for.

Thank you very much!

1 Like

Hi @sbarison, I am glad you find the link helpful. Also, in Pennylane, there is not any method to construct a PL H from a Qiskit H right now; and to the best of my knowledge, the best way around is by extracting the terms and using them to construct a PL H.