Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Qiskit session #551
Qiskit session #551
Changes from 13 commits
4ff30a5
ccebffc
c5432f1
ebf2fb0
a1a2d49
cc90420
2eeba76
c1ecbb2
08a241d
fc3adc0
7119c49
58e4178
5fcb441
307f23b
88a18c4
bc3b9a7
c03f162
f4e1c45
5c2bd4c
4d8242e
dff7fc8
393d13f
af08b68
62914e1
9aef725
f7cbf95
e8c45d6
57a9115
d8c73b0
71a99dc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 still consider the behaviour quite unintuitive. If we want to go for this, can we include information in the docstring about what will happen if the device that is passed already has a session on it?
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.
No I think it is kind of unintuitive to do it this way as well.
The best way is probably to just make the docstring more clear that if you initialize
qiskit_session
you will not be using your existing session set in the device.The logic is that I think the existing session set in device should only have value in a very specific case: batched circuits. In all other cases, the session is just necessary to access the primitives but doesn't necessarily do anything.
Therefore if a user has gone out of their way to use
qiskit_session
, they probably want to do some kind of like VQE or QAOA or whatever iterative thing, so they probably want those settings. I'll make it clearer that a User doesn't accidentally think they should set the Session in the device.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.
Do we need to worry about setting a default for the
getattr
here?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 don't think so.
existing_session
, if it exists, should always be someSession()
which has all those attributes. I suppose if the User themselves wrote their own version ofSession
(e.g. our mock) this could be a problem, but I don't see why a User would want to do that...? Then again, if Qiskit significantly changes the attributes of Session or adds an attribute without an "_" in front of it this would be a problem. I guess it wouldn't hurt to set a default 🤷 but not sure how much value it provides.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.
docstring could use clarification following updates in the PR