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

Fix tests #17

Merged
merged 11 commits into from
Sep 12, 2023
Merged

Fix tests #17

merged 11 commits into from
Sep 12, 2023

Conversation

awhite862
Copy link
Collaborator

  • Add tests for new Taylor evolution algorithm
  • Update the reference wavefunction data in tests, so that the expansion is converged for dense operator evolution
  • Additional tests (restore 100% line coverage)
  • Properly treat the case of an empty FermionOperator/SparseHamiltonian (+test)

@awhite862 awhite862 requested a review from klgunst July 19, 2023 16:05
Copy link

@klgunst klgunst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests pass.

Some warnings:

../../../../Codes/anaconda3/envs/fqe/lib/python3.9/site-packages/openfermion/hamiltonians/hartree_fock.py:11
  /home/kgunst/Codes/anaconda3/envs/fqe/lib/python3.9/site-packages/openfermion/hamiltonians/hartree_fock.py:11: DeprecationWarning: Please use `OptimizeResult` from the `scipy.optimize` namespace, the `scipy.optimize.optimize` namespace is deprecated.
    from scipy.optimize.optimize import OptimizeResult

tests/davidson_test.py: 119 warnings
  /home/kgunst/qsimulate/software/devel/OpenFermion-FQE/src/fqe/algorithm/davidson.py:69: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    if isinstance(val, (float, complex, np.complex128, np.complex)):

tests/low_rank_test.py::test_fqe_givens
tests/low_rank_test.py::test_charge_charge_evolution
tests/low_rank_test.py::test_double_factorization_trotter
  /home/kgunst/Codes/anaconda3/envs/fqe/lib/python3.9/site-packages/scipy/sparse/_index.py:103: SparseEfficiencyWarning: Changing the sparsity structure of a csc_matrix is expensive. lil_matrix is more efficient.
    self._set_intXint(row, col, x.flat[0])

Code coverage shows a few branches never been taken: pytest --cov=fqe --cov-report=html:coverage --cov-branch.

coverage.zip

@awhite862 awhite862 merged commit 5c08ce7 into master Sep 12, 2023
5 checks passed
@awhite862 awhite862 deleted the fix-tests branch September 12, 2023 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants