# The wrong answer for Quantum data H5 molecules

**URL:** <https://discuss.pennylane.ai/t/the-wrong-answer-for-quantum-data-h5-molecules/4208>\
**Category:** PennyLane Help\
**Created:** [March 2, 2024, 8:00am UTC](https://discuss.pennylane.ai/t/the-wrong-answer-for-quantum-data-h5-molecules/4208 "2024-03-02T08:00:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wang\_Sheffield](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/wang_sheffield/32/2375_2.png) [@Wang\_Sheffield](https://discuss.pennylane.ai/u/Wang_Sheffield)\
**Post date:** [March 2, 2024, 8:00am UTC](https://discuss.pennylane.ai/t/the-wrong-answer-for-quantum-data-h5-molecules/4208/1 "2024-03-02T08:00:59Z")

</div>

Regarding the H5 molecules ( [H5 Molecule (pennylane.ai)](https://pennylane.ai/datasets/qchem/h5-molecule)) in Quantum data, the vqe\_energy and vqe\_gates in the data do not match.

For instance, we can obtain the `vqe_energy` as -1.7852284384849288 under the STO-3G basis when the bond length is 0.5. The code is as follows,

```python
import pennylane as qml
import pennylane.numpy as np 

H5 = qml.data.load("qchem", molname="H5", basis="STO-3G", bondlength=0.5)[0]

chem = H5
print(chem.fci_energy)

```

However, when using `vqe_gates` to construct the circuit for calculation, the resulting energy is only -1.7561004846246622. The code is as follows:

```python
import pennylane as qml
import pennylane.numpy as np 

H5 = qml.data.load("qchem", molname="H5", basis="STO-3G", bondlength=0.5)[0]

chem = H5

n_wires = len(chem.hamiltonian.wires)
dev = qml.device("default.qubit", wires=n_wires)
cost_h = chem.hamiltonian
hf_state = chem.hf_state
gates = chem.vqe_gates

@qml.qnode(dev)
def qcircuit():
    qml.BasisEmbedding(hf_state,wires=range(n_wires))
    gates
    return qml.expval(cost_h)

print(qcircuit())

```

I’m not sure if the issue lies with `vqe_gates` or `vqe_energy`, or perhaps the way I’m constructing the circuit is incorrect?

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [March 7, 2024, 5:47pm UTC](https://discuss.pennylane.ai/t/the-wrong-answer-for-quantum-data-h5-molecules/4208/2 "2024-03-07T17:47:15Z")

</div>

Hey @Wang_Sheffield, welcome to the forum!

I think your question was answered here: [[BUG] Results in the database do not match · Issue #5299 · PennyLaneAI/pennylane · GitHub](https://github.com/PennyLaneAI/pennylane/issues/5299#issuecomment-1975724204)
