-
Couldn't load subscription status.
- Fork 7
Cell fixes #38
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
Cell fixes #38
Conversation
…oadening is applied when provided by the constructor.
This improves typing a fair bit, and technically improves performance slightly.
…to actually work. Also adds some better type hinting.
Note that both tests fail for mainline.
…nifolds, 'all' with single states, and 'all' with manifolds.
|
Note that above fixes alter a bunch of docstring outputs, presumably to be more accurate. They will need updating, along with the changelog. |
|
I am starting to go through this, should i try to get the failing tests cleaned up? I will need to get the public repo set up on my computer to get this all fixed properly, so i might have to open a pr to this pr |
|
If you can get that done, that would be superb. A solid review of the changes are also in order. And One of us will need to make another PR to update the example notebook. |
|
@benjamin-n-miller Had a few minutes to tweak up the doctests. A solid review of the PR is in order to make sure I'm not introducing new bugs, doctest updates are actually right, and the unit tests I added are robust/correct. |
|
I will do this before i wrap up today |
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.
I have some comments, but most of them are just commenting on stuff. Overall everything lgtm, im happy with the implementation and new tests
| >>> c.add_coupling(states=(g,e), rabi_frequency=np.linspace(1e-6, 1, 5), detuning=1, label="probe") | ||
| >>> snr, mesh = rq.get_snr(c, 'probe_rabi_frequency') | ||
| >>> print(snr) | ||
| [ 0. 13947396.7 27887614.4 41813486.6 |
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.
Is this just because the previous results were calculated incorrectly?
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.
Prior results did not include any transit broadening. I suppose an alternative fix would have been to set gamma_transit=0 in these tests.
| self._add_state_lifetimes() | ||
| self._add_decoherence_rates() | ||
| self._add_gamma_mismatches(gamma_mismatch) | ||
| self.add_transit_broadening(gamma_transit) |
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.
Did I actually just ignore the transit broadening previously? Or am I not remembering that it worked differently before?
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.
I had to go back and check. V1 rydiqule called this function. Apparently we dropped it when re-working self._add_decoherence_rates and self._add_gamma_mismatches. Oops.
|
|
||
| @property | ||
| def kappa(self): | ||
| def kappa(self) -> float: |
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.
There were a lot more missing type hints than I realized
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.
It may have been intentional. I vaguely remember the type checker complaining about type overloads from Sensor. That has stopped, so I put them in.
| degeneracy = len(self.states_with_spec(ground_manifold)) | ||
|
|
||
| self.add_decoherence((state, ground_manifold), gamma=(lifetime-transition_total), label="mismatch") | ||
| self.add_decoherence((state, ground_manifold), gamma=(lifetime-transition_total)/degeneracy, label="mismatch") |
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.
I was so sure that I considered this when I first implemented this for the first time, and I am wondering if maybe the rework of coupling-coefficents in cell changed something here in a way we didn't notice? Idk all my comments are sort of just editorializing at this point.
Fixing a number of outstanding issues with
Cell, revealed by trying to fix issues revealed by #37.Improves unit testing around the revealed issues, ensure
Cellactually adds transit broadening, and improves minor aspects for typing and caching ofeta,kappa, andprobe_freqproperties.Fixes #37