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

Make ApproxTimeEvolution compatible with op math #5362

Merged
merged 275 commits into from
Mar 15, 2024

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Mar 12, 2024

[sc-58598] [sc-58407]

Context:

ApproxTimeEvolution tests are failing when used with new operator arithmetic

Description of the Change:

Update ApproxTimeEvolution to rely on the pauli rep.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@Qottmann Qottmann mentioned this pull request Mar 14, 2024
2 tasks
albi3ro added a commit that referenced this pull request Mar 14, 2024
In PR #5362 , I wanted to make `ApproxTimeEvolution` depend on the
`pauli_rep` of the provided operator. Unfortunately, we never added to
`Hamiltonian` because we didn't see the point in improving
`Hamiltonian`. But not we are in the place where it needs to have
similar behaviour to its replacement. So let's just add the `pauli_rep`
property in.

[sc-58834]

---------

Co-authored-by: Korbinian Kottmann <43949391+Qottmann@users.noreply.github.com>
@albi3ro albi3ro changed the base branch from ham-tests to master March 14, 2024 17:16
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.64%. Comparing base (8f5bf9b) to head (227fbb6).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5362      +/-   ##
==========================================
- Coverage   99.64%   99.64%   -0.01%     
==========================================
  Files         398      398              
  Lines       37021    36721     -300     
==========================================
- Hits        36891    36590     -301     
- Misses        130      131       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tests/circuit_graph/test_qasm.py Outdated Show resolved Hide resolved
albi3ro and others added 2 commits March 14, 2024 16:56
Co-authored-by: lillian542 <38584660+lillian542@users.noreply.github.com>
@Qottmann Qottmann merged commit d42f5ee into master Mar 15, 2024
40 checks passed
@Qottmann Qottmann deleted the approx-time-evolution-opmath branch March 15, 2024 09:11
Qottmann added a commit that referenced this pull request Mar 15, 2024
`Sum.sparse_matrix()` uses the pauli rep to compute the sparse matrix,
which has a different default wire order which causes a failure. The
update is in a subfunction of `RiemannianGradientOptimizer` to use
explicit wire_order argument of the tape.

- [x] `tests/optimize` pass except for one mentioned below
- [x]
`tests/optimize/test_qng.py::TestOptimize::test_step_and_cost_autograd_with_gen_hamiltonian`
deferred to [this
story](https://app.shortcut.com/xanaduai/story/58893/update-tests-tests-optimize-test-qng-py-testoptimize-test-step-and-cost-autograd-with-gen-hamiltonian)

builds on top of #5362

[sc-58399]

---------

Co-authored-by: albi3ro <chrissie.c.l@gmail.com>
Co-authored-by: Christina Lee <christina@xanadu.ai>
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.

6 participants