-
Notifications
You must be signed in to change notification settings - Fork 42
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
MPSPrep
adding extra empty qubit
#1064
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1064 +/- ##
==========================================
+ Coverage 96.09% 97.36% +1.27%
==========================================
Files 232 111 -121
Lines 39079 16976 -22103
==========================================
- Hits 37552 16529 -21023
+ Misses 1527 447 -1080 ☔ View full report in Codecov by Sentry. |
Hello. You may have forgotten to update the changelog!
|
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.
Thanks @LuisAlfredoNu! Nice work ⚡
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.
Thank you @LuisAlfredoNu for your excellent work. This enhancement will improve the performance of the LT
process with block2
data and provides a way to verify the canonical form of MPS site data.
My only question for discussion is whether LT
is the most appropriate location for this feature. I'm concerned about the potential risk due to the current lack of safety checks. If we keep this functionality within LT
, there's a possibility of issues arising. For example, a user might intend to analyze an n_wires
system and correctly provide n_wires
MPS site data to MPSPrep
. However, if they accidentally provide n_wires-1
MPS site data, the LT process might not detect the discrepancy and throw an error beforehand. I'd like to open this up for discussion with the team.
Thank you @multiphaseCFD for your review. The situation that you mention throws a proper error to the user, if they try to do that then LT will show the error:
because the input MPS and the target MPS don't match in dimension. I will add an extra test to clarify this situation. |
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.
Nice work @LuisAlfredoNu! 🎸 Happy to approve after updating docstrings ✍️
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.
Nice job! Thank you!
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.
Thanks @LuisAlfredoNu! Happy to approve the impl 🙌
Context:
Lightning Tensor can use an MPS as input but should be passed through the circuit operation
qml.MPSPrep
but must have the same shape as the allocated MPS.Description of the Change:
This PR adds the following features to Lightning Tensor:
qml.MPSPrep
to accept an MPS withlen(MPS) = n_wires-1
The following algorithm was implemented
(1,2,2)
at the beginning ofBenefits:
More flexibility to work with LT and provide custom MPS.
Possible Drawbacks:
Related GitHub Issues:
[sc-84509]