Skip to content
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

Correcting documentation of Drag/LiftedDrag (Qiskit#7659) #7856

Merged
merged 7 commits into from
Apr 12, 2022

Conversation

tobias-kehrer
Copy link
Contributor

Summary

This PR partially fixes #7659.
As discussed in #7659, the documentation of the Drag/LiftedDrag pulse was not consistent with its implementation in qiskit.pulse.library.continuous.py.

A remaining problem is the explicit definition of the sampler strategy. This should be fixed after/with the update of parametric pulses (#7821).

Details and comments

This PR corrects the definition of f(x) (called Drag/LiftedDrag, https://qiskit.org/documentation/stubs/qiskit.pulse.library.Drag.html) up to explicitly defining the chosen sampler strategy.

Before the PR, the function f(x) was wrongly depending on (f'(x) - f'(-1))/(1 - f'(-1)). This dependency is corrected to (g(x) - g(-1))/(1 - g(-1)). Furthermore, the imaginary part of the f(x) is now correctly defined to be proportional to (g(x) - g(-1))/(1 - g(-1)).

The documentation of the Drag/LiftedDrag pulse now follows its implementation in qiskit.pulse.library.continuous.py.

As @nkanazawa1989 pointed out in #7659, an update of parametric pulses (#7821) will unify the sampler strategies on backend and frontend. After or with this update, the documentation can be adjusted (if needed) stating explicitly which sampler strategy is or can be used.

As discussed in qiskit-terra issue Qiskit#7659, the definition of the LiftedDrag pulse was not consistent with its implementation in qiskit.pulse.library.continuous.py.
One error is fixed by this PR.
A remaining problem is the explicit definition of the sampler strategy. This should be fixed after/with the update of parametric pulses, qiskit-terra issue  Qiskit#7821.
@CLAassistant
Copy link

CLAassistant commented Apr 1, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this is correct description of the function. However, since f'(x) is no longer used, we can remove another lines as well or introduce something like g'(x) to get more compact expression?

- Removal of f'(x)
- Added definition of g'(x)
- Typos corrected 'gaussian' -> 'Gaussian'
- Link to `qiskit.pulse.library.Gaussian` added
@tobias-kehrer
Copy link
Contributor Author

I implemented the following changes:

  • Removal of f'(x)
  • Added definition of g'(x)
  • Typos corrected 'gaussian' -> 'Gaussian'
  • Link to qiskit.pulse.library.Gaussian added

@javabster
Copy link
Contributor

Hi @tobias-kehrer thanks for your work! Looks like you just have some minor linting errors to fix up in the following files:

qiskit/pulse/library/parametric_pulses.py:353:0: C0301: Line too long (127/105) (line-too-long)
qiskit/pulse/library/parametric_pulses.py:356:0: C0301: Line too long (129/105) (line-too-long)
qiskit/pulse/library/parametric_pulses.py:358:0: C0301: Line too long (114/105) (line-too-long)

Fixed the linting errors (line too long) in lines 353, 356, and 358 of qiskit/pulse/library/parametric_pulses.py.
@tobias-kehrer
Copy link
Contributor Author

Thank you @javabster for pointing out these errors!
There is a remaining error

qiskit/pulse/library/parametric_pulses.py:357:31: C0303: Trailing whitespace (trailing-whitespace)

probably due to the 'long' link in line 358. But this link should not be split in half, right?

1 similar comment
@tobias-kehrer
Copy link
Contributor Author

Thank you @javabster for pointing out these errors!
There is a remaining error

qiskit/pulse/library/parametric_pulses.py:357:31: C0303: Trailing whitespace (trailing-whitespace)

probably due to the 'long' link in line 358. But this link should not be split in half, right?

tobias-kehrer and others added 2 commits April 11, 2022 09:57
Co-authored-by: Naoki Kanazawa <[email protected]>
Moved link to Gaussian via :class: from line 358 to 357.
Copy link
Contributor

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This looks good to me.

@coveralls
Copy link

coveralls commented Apr 11, 2022

Pull Request Test Coverage Report for Build 2152553017

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 83.945%

Totals Coverage Status
Change from base Build 2151886427: 0.005%
Covered Lines: 54198
Relevant Lines: 64564

💛 - Coveralls

@mergify mergify bot merged commit c90c176 into Qiskit:main Apr 12, 2022
@mtreinish mtreinish added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: None Do not include in changelog labels Apr 12, 2022
mergify bot pushed a commit that referenced this pull request Apr 12, 2022
* Correct documentation of Drag/LiftedDrag

As discussed in qiskit-terra issue #7659, the definition of the LiftedDrag pulse was not consistent with its implementation in qiskit.pulse.library.continuous.py.
One error is fixed by this PR.
A remaining problem is the explicit definition of the sampler strategy. This should be fixed after/with the update of parametric pulses, qiskit-terra issue  #7821.

* Implement review update of #7856

- Removal of f'(x)
- Added definition of g'(x)
- Typos corrected 'gaussian' -> 'Gaussian'
- Link to `qiskit.pulse.library.Gaussian` added

* Fixing linting errors #7856

Fixed the linting errors (line too long) in lines 353, 356, and 358 of qiskit/pulse/library/parametric_pulses.py.

* Replace URL link to Gaussian

Co-authored-by: Naoki Kanazawa <[email protected]>

* Removal of trailing whitespace in line 357

Moved link to Gaussian via :class: from line 358 to 357.

Co-authored-by: Naoki Kanazawa <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit c90c176)
mergify bot added a commit that referenced this pull request Apr 12, 2022
* Correct documentation of Drag/LiftedDrag

As discussed in qiskit-terra issue #7659, the definition of the LiftedDrag pulse was not consistent with its implementation in qiskit.pulse.library.continuous.py.
One error is fixed by this PR.
A remaining problem is the explicit definition of the sampler strategy. This should be fixed after/with the update of parametric pulses, qiskit-terra issue  #7821.

* Implement review update of #7856

- Removal of f'(x)
- Added definition of g'(x)
- Typos corrected 'gaussian' -> 'Gaussian'
- Link to `qiskit.pulse.library.Gaussian` added

* Fixing linting errors #7856

Fixed the linting errors (line too long) in lines 353, 356, and 358 of qiskit/pulse/library/parametric_pulses.py.

* Replace URL link to Gaussian

Co-authored-by: Naoki Kanazawa <[email protected]>

* Removal of trailing whitespace in line 357

Moved link to Gaussian via :class: from line 358 to 357.

Co-authored-by: Naoki Kanazawa <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit c90c176)

Co-authored-by: Tobias Kehrer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LiftedGaussian and LiftedDrag functions in documentation
6 participants