-
Notifications
You must be signed in to change notification settings - Fork 603
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
default.qubit
returns the new DefaultQubit
device
#4436
Conversation
This reverts commit de4e5fa.
…ing" This reverts commit 840f30a.
# Conflicts: # tests/ops/qubit/test_special_unitary.py # tests/optimize/test_optimize_shot_adaptive.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work 🎉 So excited to have this finally here. 🚀
For the code-cov issues, I am willing to override, but let's mark them down to investigate after this PR goes through.
For the qcut thing, I am still rather curious what is happening, but indulging my curiosity is not worth holding up any of the work we need to do. It can also be marked as "Further investigation for when we have time". If we ever actually have time for something like that.
Note: kindly ignore the codecov failure, it seems totally unrelated to this PR. **Context:** It's time for `qml.device("default.qubit")` to return the new device (look, no wires!). **Description of the Change:** - 99% of this PR is changing `dev.batch_execute` to `dev.execute` - I am sorry about all the pylint changes - it’s from before I silenced them - I couldn’t keep track but there were some little things that we asserted didn’t work, but now they do! Like custom wires with some measurement processes - `test_state.py` used to try to test different dtypes, but the returned state should now _always_ be complex, so that's what I test for. - One stupid qcut torch test fails on CI only… idk why. it just says `UNSUPPORTED DTYPE` (that's it because it's jit-compiled) - I changed `math.size` for tensorflow because autoray [changed it](jcmgray/autoray@58f02d5) in 0.6.4 (I was still on 0.6.3 locally), but we actually want to use the base `tf.size(x)` Test formatting changes: - Duplicated tests in `test_hadamard_gradient.py` for legacy devices - Any test that used `default.qubit.some_interface` has been parametrized to also test with `default.qubit` to make sure interface-specific stuff also works with DQ2 - test_qnode.py uses legacy because it’s deeply steeped in legacy - test_vqe.py uses the new device but the results are nonsense. I commented the actual expected results out - Pulse and qchem tests are being fixed in other PRs - test_return_types.py uses legacy - test_return_types_dq2.py is a copy-paste with DQ2 - The things in `test_tensor_measurements.py` just felt unnecessary and too hard to move over **Benefits:** We use the new device! **Possible Drawbacks:** 3 things that have changed afaik: - Non-hermitian observables fail hard now, still needs investigation - `expval(SparseHamiltonian)` used to fail nicely, now it raises a `DiagGatesUndefined` error - `qml.Snapshot()` instances are manually spotted and skipped while doing `adjoint_jacobian` (when `diff_method="adjoint"`) --------- Co-authored-by: Christina Lee <christina@xanadu.ai>
Note: kindly ignore the codecov failure, it seems totally unrelated to this PR.
Context:
It's time for
qml.device("default.qubit")
to return the new device (look, no wires!).Description of the Change:
dev.batch_execute
todev.execute
test_state.py
used to try to test different dtypes, but the returned state should now always be complex, so that's what I test for.UNSUPPORTED DTYPE
(that's it because it's jit-compiled)math.size
for tensorflow because autoray changed it in 0.6.4 (I was still on 0.6.3 locally), but we actually want to use the basetf.size(x)
Test formatting changes:
test_hadamard_gradient.py
for legacy devicesdefault.qubit.some_interface
has been parametrized to also test withdefault.qubit
to make sure interface-specific stuff also works with DQ2test_tensor_measurements.py
just felt unnecessary and too hard to move overBenefits:
We use the new device!
Possible Drawbacks:
3 things that have changed afaik:
expval(SparseHamiltonian)
used to fail nicely, now it raises aDiagGatesUndefined
errorqml.Snapshot()
instances are manually spotted and skipped while doingadjoint_jacobian
(whendiff_method="adjoint"
)