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

_write_parameter_expression takes version parameter #1674

Closed
wants to merge 2 commits into from

Conversation

kt474
Copy link
Member

@kt474 kt474 commented May 13, 2024

Summary

@jakelishman version was added as a new argument here which I believe caused our unit tests against Qiskit/main to start failing. Is this the correct way to handle version from the provider?

Details and comments

@coveralls
Copy link

coveralls commented May 13, 2024

Pull Request Test Coverage Report for Build 9119300455

Details

  • 2 of 3 (66.67%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.009%) to 82.756%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_ibm_runtime/utils/json.py 2 3 66.67%
Totals Coverage Status
Change from base Build 9117820651: -0.009%
Covered Lines: 6239
Relevant Lines: 7539

💛 - Coveralls

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

That's probably the calling convention for it now, yeah, but that's very much not a public API function, and we cannot make guarantees that it'll even continue to exist in the future, given that we may well need to refactor the QPY export to be faster.

serializer=_write_parameter_expression,
compress=False,
use_symengine=bool(optionals.HAS_SYMENGINE),
version=QPY_VERSION,
Copy link
Member

Choose a reason for hiding this comment

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

This version wants to be compatible (less than) whatever version of QPY you'll be using on the backend to deserialise - QPY_VERSION will always be the max the local version of Qiskit can handle.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is the use of QPY_VERSION incorrect here then? I don't believe the server side has updated to qiskit 1.1 yet

Copy link
Member

Choose a reason for hiding this comment

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

You should repeat the logic in other places around the version kwarg and keep the version there the same as in other places. It might makes sense to extract that to a constant like RUNTIME_QPY_VERSION = 11 or something.

if (_TERRA_VERSION[0] == 1 and _TERRA_VERSION[1] >= 1) or _TERRA_VERSION[0] > 1:
    kwargs["version"] = 11

@jyu00
Copy link
Collaborator

jyu00 commented May 20, 2024

From the Slack discussion I think we can just drop the support for ParameterExpression type, since it's not an input type to primitives anymore.

@kt474
Copy link
Member Author

kt474 commented May 20, 2024

From the Slack discussion I think we can just drop the support for ParameterExpression type, since it's not an input type to primitives anymore.

Closing this PR, i'll open a separate one

@kt474 kt474 closed this May 20, 2024
@kt474 kt474 deleted the write-param-expression-version branch May 20, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants