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

Change rep_time unit to s #3612

Merged
merged 27 commits into from
Jan 29, 2020
Merged

Conversation

eembees
Copy link
Contributor

@eembees eembees commented Dec 13, 2019

Summary

-Changed the rep_time unit to be in seconds, not microseconds.
-Updated tests to reflect scaling of the rep_time variable
Fixes #3598

Details and comments

  • rep_times can still be given in microseconds, but is then scaled down to s. However, the rep_times need to be given as floats, not as ints as before.

@claassistantio
Copy link

claassistantio commented Dec 13, 2019

CLA assistant check
All committers have signed the CLA.

@claassistantio
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@eembees eembees force-pushed the change_rep_time_unit_to_s branch from 39bccc0 to 952e2fa Compare December 23, 2019 06:35
@eembees
Copy link
Contributor Author

eembees commented Dec 23, 2019

@taalexander pinging you here as well 😄

@lcapelluto lcapelluto self-assigned this Jan 6, 2020
Copy link
Contributor

@lcapelluto lcapelluto left a comment

Choose a reason for hiding this comment

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

thank you for taking this on! sorry that we have been MIA for a bit

qiskit/providers/models/backendconfiguration.py Outdated Show resolved Hide resolved
qiskit/compiler/assemble.py Show resolved Hide resolved
qiskit/qobj/models/pulse.py Outdated Show resolved Hide resolved
qiskit/test/mock/fake_openpulse_3q.py Outdated Show resolved Hide resolved
@eembees
Copy link
Contributor Author

eembees commented Jan 7, 2020

Ah, thank you so much for your feedback @lcapelluto, I will get to work on it asap and hopefully have a new PR by the weekend!
Just to clarify then:

  • assemble() should take a rep_times as a float (seconds) but pass it on as an int (microseconds) when we build the Qobj ( just like in Fix bug where lo units were not being properly converted #3597 )
  • all JSONs should be reverted (?)
  • only tests that call assemble() should be changed to have units of seconds
    I will assume the above is correct and start working on this. Correct me if I am wrong, please 😄

added 'rep_time' name to 'BackendDefault' named tuple
Copy link
Contributor

@lcapelluto lcapelluto left a comment

Choose a reason for hiding this comment

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

Nice updates! This looks right to me, just needs a few new tests.

test/python/compiler/test_assembler.py Outdated Show resolved Hide resolved
qiskit/compiler/assemble.py Show resolved Hide resolved
@eembees eembees requested a review from lcapelluto January 8, 2020 12:20
lcapelluto
lcapelluto previously approved these changes Jan 15, 2020
Copy link
Contributor

@lcapelluto lcapelluto left a comment

Choose a reason for hiding this comment

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

I had one suggestion, but still approving :D

@lcapelluto
Copy link
Contributor

@eembees Would you mind resolving conflicts? Then I will get my colleagues to get approvals for you

taalexander
taalexander previously approved these changes Jan 23, 2020
Copy link
Contributor

@taalexander taalexander left a comment

Choose a reason for hiding this comment

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

LGTM

lcapelluto
lcapelluto previously approved these changes Jan 24, 2020
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

I think this is fine considering all the other unit changes we've been making on pulse. But before we can move forward with this can you please add a release note to document this change? Since it could catch end users by surprise. The process for doing that is documented here: https://github.com/Qiskit/qiskit-terra/blob/master/CONTRIBUTING.md#release-notes

@eembees eembees dismissed stale reviews from lcapelluto and taalexander via 1e05742 January 27, 2020 08:12
@lcapelluto lcapelluto dismissed mtreinish’s stale review January 27, 2020 16:37

release note added!

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for updating, just two small nits inline. Not worth blocking over though I can update things when I go through the release notes pre-release

`PulseBackendConfiguration._parse_pulse_args()` still takes `rep_times` in units of microseconds,
but they are now transformed to units of seconds before being passed to `assemble()`
At first pass, `PulseBackendConfiguration` will raise a warning to the user.
deprecations:
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be an upgrade note since it's not something that users have to update now:

Suggested change
deprecations:
upgrade:

At first pass, `PulseBackendConfiguration` will raise a warning to the user.
deprecations:
- |
`assemble()` now takes `rep_time` in units of seconds, not microseconds.
Copy link
Member

Choose a reason for hiding this comment

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

We probably should put the full callable path here so that it's clear which function we're talking about:

Suggested change
`assemble()` now takes `rep_time` in units of seconds, not microseconds.
``qiskit.compiler.assemble()`` now takes `rep_time` in units of seconds, not microseconds.

@mergify mergify bot merged commit e07a2e2 into Qiskit:master Jan 29, 2020
@lcapelluto lcapelluto added the Changelog: API Change Include in the "Changed" section of the changelog label Feb 4, 2020
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
* changed rep_time from microseconds to seconds.
added one time warning for rep_time
Fixes Qiskit#3598

* fixed docstring

* changed so that rep_time only can be a float.
now passes all unit tests

* reverted all jsons, made rep_time conversion at `_parse_pulse_args()` in `assemble()`

* Update assemble.py

added 'rep_time' name to 'BackendDefault' named tuple

* Update qiskit/compiler/assemble.py

Co-Authored-By: Lauren Capelluto <laurencapelluto@gmail.com>

* added a test in test_backendconfiguration

* linting and removed redundant arg in `assemble.py`

* linting

* more linting

* removed rep_time from BackendDefault tuple

* fixed parametric pulse error & lint

* release note

Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>
Co-authored-by: Thomas Alexander <thomasalexander2718@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: API Change Include in the "Changed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert rep_times to seconds
5 participants