-
Notifications
You must be signed in to change notification settings - Fork 191
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
Fix for using TDMProgram
with timebins % concurrent_modes != 0
#611
Conversation
… into td3-tdmprogram
…on (hbar=1.7) the tests still work
Codecov Report
@@ Coverage Diff @@
## master #611 +/- ##
=======================================
Coverage 98.56% 98.56%
=======================================
Files 77 77
Lines 8893 8904 +11
=======================================
+ Hits 8765 8776 +11
Misses 128 128
Continue to review full report at Codecov.
|
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 a lot @thisac, that's a beautiful fix! Passed all of my own tests as well.
Ah, I see. Very clever, thanks!
…On Thu., Jul. 22, 2021, 18:07 Theodor, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In strawberryfields/tdm/tdmprogram.py
<#611 (comment)>
:
> + @Property
+ def concurr_modes(self):
+ """The number of concurrent modes in the program."""
+ return self._concurr_modes
+
This is just Pythons way of saying that self._concurr_modes is private
(and shouldn't be changed manually outside of the class). By having a
property, the value can be retrieved but not set (you'd need to add a
"setter" method as well to do that, which could involve extra validation
etc.).
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#611 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO3BH2CSHCLKGEM6CBKHB2DTZA64JANCNFSM5AY23BIA>
.
--
xanadu.ai <http://xanadu.ai>
"To build quantum computers that are useful
and available to people everywhere"
This e-mail message is privileged,
confidential and subject to
copyright. Any unauthorized use or disclosure
is prohibited.
Le contenu du présent courriel est privilégié, confidentiel
et
soumis à des droits d'auteur. Il est interdit de l'utiliser ou
de le
divulguer sans autorisation.
|
Ready for review, but since it relies on changes in the
td3-tdmprogram
branch, it's best to wait till that one is merged before merging this PR. Thus thedo not merge
label.Context:
The TDMProgram will produce wrong results if the number of timebins is not an integer multiple of the number of concurrent modes. This is because the tdmprogram.unroll() function simpy multiplies the unique circuit with the number of shots, not taking into account which qumode has been measured most recently.
Description of the Change:
The way multiple shots are calculated is changed. It now calculates each shot separately instead of stitching together several identical circuits at the end.
The way the measured mode order is calculated is improved (and now works with the new shots calculation).
TDMProgram
is tidied up slightly by changing a few attributes to private and adding corresponding properties to access them.Benefits:
The following now works properly:
outputting
Possible Drawbacks:
Related GitHub Issues:
fixes #607