-
Notifications
You must be signed in to change notification settings - Fork 6
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
Adding CPMG protocol #1057
base: 0.2
Are you sure you want to change the base?
Adding CPMG protocol #1057
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 0.2 #1057 +/- ##
==========================================
- Coverage 97.03% 97.02% -0.02%
==========================================
Files 98 99 +1
Lines 7895 7921 +26
==========================================
+ Hits 7661 7685 +24
- Misses 234 236 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
doc/source/protocols/cpmg/cpmg.rst
Outdated
In this section we show how to run the dynamical decoupling sequence CPMG. | ||
|
||
The CPMG sequence consists in applying N equally spaced :math:`\pi` pulses | ||
within two :math:`\pi` pulses. By increasing the number of :math:`\pi` pulses :math:`T_2` |
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.
within two :math:`\pi` pulses.
It should be pi/2, right ?
return figures, fitting_report | ||
|
||
|
||
cpmg = Routine(_acquisition, _fit, _plot, _update) |
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.
The _update
is the spin_echo one, it means the t2_spin_echo value is updated. This is the case when N = 1, but generally speaking the the
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.
Yes, I was thinking about this. Perhaps at this point it is easier to just remove the update for this protocol. What do you think?
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.
Can we delete this routine to reduce code duplication ?
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.
sequence.append((qd_channel, rx90_pulse)) | ||
|
||
for i in range(n): | ||
sequence.append((qd_channel, drive_delays[2 * i])) | ||
sequence.append((ro_channel, ro_delays[2 * i])) | ||
sequence.append((qd_channel, pulse)) | ||
sequence.append((qd_channel, drive_delays[2 * i + 1])) | ||
sequence.append((ro_channel, ro_delays[2 * i + 1])) | ||
|
||
sequence.append((qd_channel, rx90_pulse)) | ||
|
||
sequence.append( | ||
( | ||
ro_channel, | ||
Delay(duration=2 * rx90_pulse.duration + n * pulse.duration), | ||
) |
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 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.
The sequence can be re-written as
RX90 - (wait(t/2N) RY wait(t/2N))^N RX90
which is exactly what I am doing in the for loop.
I've specified that the delay should have also a factor 1/2N in the acquisition
values=wait_range / 2 / params.n, |
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.
Smart !
doc/source/protocols/cpmg/cpmg.rst
Outdated
|
||
The CPMG sequence consists in applying N equally spaced :math:`\pi` pulses | ||
within two :math:`\pi` pulses. By increasing the number of :math:`\pi` pulses :math:`T_2` | ||
should increase until reaching the :math:`2 T_1` limit. |
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.
This behaviour depends on the kind of noise.
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 am not sure about this. Generally by increasing the number of pi pulses according to here I believe that we should be able to mitigate noises of the type 1/f. Then I don't know whether we could have other noises which are not 1/f but I don't know if we can detect them through a CPMG sequence.
Did you have something else in mind?
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 you have something else in mind?
You could have a white noise but I think the conclusions are the same. I just suggest to add what you have written in this comment in the docs.
Then I don't know whether we could have other noises which are not 1/f but I don't know if we can detect them through a CPMG sequence.
By changing the number of pulses increase the sensitivity to higher frequencies, so I would say yes
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 for the comments @Edoardo-Pedicillo.
I will try to reduce code duplication :)
return figures, fitting_report | ||
|
||
|
||
cpmg = Routine(_acquisition, _fit, _plot, _update) |
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.
Yes, I was thinking about this. Perhaps at this point it is easier to just remove the update for this protocol. What do you think?
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.
sequence.append((qd_channel, rx90_pulse)) | ||
|
||
for i in range(n): | ||
sequence.append((qd_channel, drive_delays[2 * i])) | ||
sequence.append((ro_channel, ro_delays[2 * i])) | ||
sequence.append((qd_channel, pulse)) | ||
sequence.append((qd_channel, drive_delays[2 * i + 1])) | ||
sequence.append((ro_channel, ro_delays[2 * i + 1])) | ||
|
||
sequence.append((qd_channel, rx90_pulse)) | ||
|
||
sequence.append( | ||
( | ||
ro_channel, | ||
Delay(duration=2 * rx90_pulse.duration + n * pulse.duration), | ||
) |
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.
The sequence can be re-written as
RX90 - (wait(t/2N) RY wait(t/2N))^N RX90
which is exactly what I am doing in the for loop.
I've specified that the delay should have also a factor 1/2N in the acquisition
values=wait_range / 2 / params.n, |
doc/source/protocols/cpmg/cpmg.rst
Outdated
|
||
The CPMG sequence consists in applying N equally spaced :math:`\pi` pulses | ||
within two :math:`\pi` pulses. By increasing the number of :math:`\pi` pulses :math:`T_2` | ||
should increase until reaching the :math:`2 T_1` limit. |
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 am not sure about this. Generally by increasing the number of pi pulses according to here I believe that we should be able to mitigate noises of the type 1/f. Then I don't know whether we could have other noises which are not 1/f but I don't know if we can detect them through a CPMG sequence.
Did you have something else in mind?
Closes #896.
Here is an example: http://login.qrccluster.com:9000/M0By3hjUTAakgT8Jg1VlXA==
I've also fixed a factor 2 in the spin_echo protocol.