Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store grouping in Hamiltonian (#1515)
* delete arithmetic and rewrite rest with qml.math * fix most errors not pertaining to grouping or ExpvalCost * add grouping to Hamiltonian * change order of arithmetic ops * change order of arithmetic ops 2 * fix bug in hamiltonian_expand * make all tests pass * fix diffability * backup * undo comments * write some crucial tests * Hamiltonians are differentiable * some tweaks to make more tests pass * black * all tests pass * add param shift test * black * port some changes from a child branch * all changes and tests * black * make codefactor happy * make codefactor even more happy * better docstrings * update changelog * black * increase coverage * Update pennylane/transforms/hamiltonian_expand.py Co-authored-by: Josh Izaac <josh146@gmail.com> * implement comments * add num_params attribute * make pylint happy * implement second round of comments * black * port changes from prototype * move test file * black * add missed line to change * fixes * add test for differentiable simplify * backup * backup * delete lines, start writing test * add test * fix test * rename one test * update changelog * main tests pass * backup * remove test * backup * missed one conflict * test diffable grouping * add another changelog entry * remove check * change how the return type is checked * black * black again * add comment on arithmetics * improve docstring * polish * fix some tests * polish more * Update tests/ops/test_hamiltonian.py * add kron to tf * Update .github/CHANGELOG.md Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update .github/CHANGELOG.md Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * add Hamiltonian test * black * add tests for list/tuple return of grouping * remove tuple conversion again * fix data issue and add test * Update pennylane/vqe/vqe.py Co-authored-by: Josh Izaac <josh146@gmail.com> * polish * update torch version * bump torchvision too, to be compatible * fix codevec * correct torchvision version again * add some more tests * figure out diff bug * backup * fix tests and dimensions * add changelog * clean changelog * improve docstring * polish * fix test * fix codefactor issue * Update tests/transforms/test_hamiltonian_expand.py * Update pennylane/transforms/hamiltonian_expand.py * Update pennylane/transforms/hamiltonian_expand.py * backup * Update pennylane/vqe/vqe.py * improve docstrings * add test * add a queue test * black * Update .github/CHANGELOG.md Co-authored-by: Josh Izaac <josh146@gmail.com> * Update .github/CHANGELOG.md Co-authored-by: Josh Izaac <josh146@gmail.com> * Update pennylane/vqe/vqe.py Co-authored-by: Josh Izaac <josh146@gmail.com> * Update pennylane/vqe/vqe.py Co-authored-by: Josh Izaac <josh146@gmail.com> * port changes from wrong branch * improve grouping control * Update .github/CHANGELOG.md Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update pennylane/transforms/hamiltonian_expand.py Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update pennylane/vqe/vqe.py Co-authored-by: Josh Izaac <josh146@gmail.com> * Update pennylane/vqe/vqe.py Co-authored-by: Josh Izaac <josh146@gmail.com> * Update pennylane/vqe/vqe.py Co-authored-by: Josh Izaac <josh146@gmail.com> * implement suggestions * remove get_grouping * black * finish * Update tests/transforms/test_hamiltonian_expand.py Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update pennylane/vqe/vqe.py Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update pennylane/vqe/vqe.py Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update pennylane/vqe/vqe.py Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update pennylane/transforms/hamiltonian_expand.py Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update pennylane/transforms/hamiltonian_expand.py Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update pennylane/transforms/hamiltonian_expand.py Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update pennylane/vqe/vqe.py Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * Update pennylane/transforms/hamiltonian_expand.py Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com> * implement suggestions * black * check docs are fine * add tests for measurement grouping trafo which is not used in hamiltonian_expand any more * change kwarg logic * fix test * adapt changelog * black Co-authored-by: Josh Izaac <josh146@gmail.com> Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
- Loading branch information