Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pauli_sum_collector.estimate_energy() should return float when energy…
….imag == 0 (#4313) For chemistry hamiltonians generated via `openfermion.qubit_operator_to_pauli_sum(qubit_hamiltonian)`, even though the pauli sum has only real terms (complex with imag == 0), using `p.estimated_energy()` returns a complex (with imag == 0) and hence cannot be directly used with scipy optimizers which expect a flaot (eg: `Nelder-Mead`, `SLSQP` etc.) See quantumlib/OpenFermion#732 for an example.
- Loading branch information
1 parent
0d8bf31
commit a3109a7
Showing
2 changed files
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters