qiskit-community / qiskit-alt

High-performance Qiskit features backed by Julia. A Python front end to algorithms using Pauli and Fermionic operators implemented in Julia.
Apache License 2.0
13 stars 2 forks source link

VQE demo using qiskit-alt #28

Closed saharbenrached closed 2 years ago

saharbenrached commented 2 years ago

I created this demo with a random Pauli operator. It would be however interesting to work on an example of a molecule

garrison commented 2 years ago

This is cool! Here's the preview.

A few files got added that don't belong in the repo and should be removed. (I made a PR in #29 that adjusts .gitignore so that these files would not have been added.)

saharbenrached commented 2 years ago

Given a Pauli operator, I want to convert it to a sum of Pauli gates using QuantumOps from qiskit-alt. Which method to use?

jlapeyre commented 2 years ago

@saharbenrached Thanks! This PR adds three files. But two of them should not be included. Only the demo file itself is needed. To fix this, you can delete the two files with git rm and commit and push the result to your branch. This PR should be updated automatically.

jlapeyre commented 2 years ago

@saharbenrached I think this may be what you want:

import qiskit_alt
import qiskit_alt.electronic_structure

geometry = [['H', [0., 0., 0.]], ['H', [0., 0., 0.7414]]]
basis = 'sto3g'

fermi_op = qiskit_alt.electronic_structure.fermionic_hamiltonian(geometry, basis)
pauli_op = qiskit_alt.electronic_structure.jordan_wigner(fermi_op);

from qiskit.opflow import PauliSumOp

pauli_sum_op = PauliSumOp(pauli_op)
saharbenrached commented 2 years ago

This is the demo for VQE for the H2 molecule, however, the result is incorrect. I am working on it

jlapeyre commented 2 years ago

I missed that you have actually deleted those files! Thanks.