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

Daily rc sync to master #6789

Merged
merged 8 commits into from
Jan 10, 2025
Merged

Daily rc sync to master #6789

merged 8 commits into from
Jan 10, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 9, 2025

No description provided.

PietropaoloFrisoni and others added 5 commits January 6, 2025 09:23
**Context:**

We weren't actually validating that the `device_vjp=True` was supported.
This allowed strange circumstances where you would have
`device_vjp=True`, but not support device derivatives at all, and this
could lead to incorrect answers.

**Description of the Change:**

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**
**Context:**

When running tests locally, I was getting failures like:
```
FAILED tests/devices/default_qubit/test_default_qubit.py::TestPostselection::test_postselection_invalid_finite_shots[shots1-mp2-expected_shape2-False-jax] - ValueError: Probabilities contain NaN
```

We had logic to catch the error `'probabilities contain NaN'`, but
something about my versioning gives a slightly different capitalization.
To prevent this happening of other people, I updated the error catching
to be capitalization independent.

**Description of the Change:**

Catch both `"Probabilities contain NaN"` and `"probabilities contain
NaN"`.

**Benefits:**

Tests pass locally for my environment.

**Possible Drawbacks:**

Still a bit error prone. I'm also not sure what about my environment
gives different capitalization.

**Related GitHub Issues:**

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pietropaolo Frisoni <[email protected]>
Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: ringo-but-quantum <[email protected]>
Co-authored-by: Andrija Paurevic <[email protected]>
**Context:**

PR #6019 only fixes `BasisRotation` when using backprop on
`default.qubit`. It is not jit compatible on any other device. This is
because `unitary_matrix` was being considered a hyperparameter, not a
piece of data. So we could not detect that the matrix was a tracer and
we were in jitting mode, and we could not convert the matrix back into
numpy data.

**Description of the Change:**

Make `unitary_matrix` a piece of data instead of a hyperparameter. This
allows us to detect when it is being jitted.

As a by-product, I also made it valid pytree.

By making `unitary_matrix` a piece of data, we were able to get rid of
the custom comparison method in `qml.equal`.

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**

[sc-51603] Fixes #6004
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.60%. Comparing base (cc6849a) to head (9926eaf).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6789   +/-   ##
=======================================
  Coverage   99.60%   99.60%           
=======================================
  Files         476      476           
  Lines       45222    45222           
=======================================
  Hits        45045    45045           
  Misses        177      177           

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

@PietropaoloFrisoni PietropaoloFrisoni enabled auto-merge (squash) January 10, 2025 20:01
@PietropaoloFrisoni PietropaoloFrisoni merged commit 0915f2d into master Jan 10, 2025
46 checks passed
@PietropaoloFrisoni PietropaoloFrisoni deleted the rc_2025-01-09-03-13-18 branch January 10, 2025 20:24
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.

3 participants