Conversation
Codecov Report
@@ Coverage Diff @@
## master #2781 +/- ##
=======================================
Coverage 99.62% 99.62%
=======================================
Files 258 259 +1
Lines 21140 21237 +97
=======================================
+ Hits 21060 21158 +98
+ Misses 80 79 -1
Continue to review full report at Codecov.
|
glassnotes
left a comment
There was a problem hiding this comment.
@mudit2812 looking good! ⭐ Just a few small comments, mostly about clearly denoting any major changes or missing parts and/or large sections that are similar / the same as for QubitDevice. Once addressed this should be ready for review 🎉
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
… into qutrit_unitary
Qottmann
left a comment
There was a problem hiding this comment.
Hi @mudit2812 great work! I dont have much to say, it seems to be a clean 1-to-1 copy of the qubit device with modifications where necessary :)
antalszava
left a comment
There was a problem hiding this comment.
Hi @mudit2812, this is looking very nice! 🎉 👏 The main ask from my side is changing the formula that appears in the docs for marginal_prob, the other comments are minor.
One thing to note is that we're exploring new return datastructures for quantum functions. Likely that change will affect QubitDevice and potentially QutritDevice. To give an example, a quantum function that returns multiple expectation values has a tensor output with shape (2,). We would like to change that to be a tuple of two scalar tensors, each with the shape ().
Still in the early stages with it, but thought of mentioning it as this could become relevant.
More info: we'd basically like quantum functions to always return the same type as indicated by the ‘return’ statement:
return meas1, meas2returns a tuple of tensors;return qml.expval()returns a scalar tensor;return qml.probs()returns a N-dimensional tensor;return [qml.expval(), qml.var()]returns a list of scalar tensors;return (qml.probs([0]), qml.probs([1,2]))returns a tuple of N-dimensional
tensors.
Co-authored-by: antalszava <antalszava@gmail.com>
… into qutrit_unitary
antalszava
left a comment
There was a problem hiding this comment.
Looks good! 🎉 🙂
There seems to be a merge conflict in the changelog file, it can be resolved by merging in master and resolving the conflicts in the file locally.
glassnotes
left a comment
There was a problem hiding this comment.
Thanks for addressing everyone's comments @mudit2812 ! Looks like this is good to go. Drop by my office this afternoon if you would like to do the honours and click the merge button 😀
Context:
There are very few simulators available today that offer qudit simulation. One notable example is Google's Cirq, which includes support for qudit operations. However, the simulator is far from complete, and a key drawback is the lack of operations available, which creates a need for users to define operations themselves. Popular libraries such as Qiskit and QuTiP also include some qudit manipulation capabilities, but with few use cases. Beyond these libraries, qudit simulation solutions are quite limited. Moreover, qudit simulation is a feature that is already in demand, as seen in this issue on the PennyLane repository.
This PR adds a
QutritDeviceabstract base class to PennyLane to be used as a parent class for qutrit devices, which will be added in later pull requests.Description of the Change:
QutritDeviceas a parent device. Users will need to define all abstract methods thatQutritDeviceinherits fromDeviceto use it. Currently,QutritDevice.execute()does NOT work when the quantum tape contains measurements, but qutrit operations, such asQutritUnitarycan be executed.Benefits:
Possible Drawbacks:
Related GitHub Issues:
#2190