Skip to content

update notebook convention execution session#1640

Open
classiqdor wants to merge 6 commits into
mainfrom
update_notebook_convention__execution_session
Open

update notebook convention execution session#1640
classiqdor wants to merge 6 commits into
mainfrom
update_notebook_convention__execution_session

Conversation

@classiqdor

Copy link
Copy Markdown
Contributor
  • Name execution-result variables result / result_ (main)
  • Name execution-result variables result / result_ (community & other)
  • Restore prose wording clobbered by the result-variable rename
  • Drop the intermediate job variable when only used to fetch the result
  • Parse results via result_value(), not result()[0].value
  • Unify ExecutionSession naming (es) and its sample-result variables

Rename execution-result value variables to result (or result_<suffix> when a
notebook has several); genuine ExecutionJob variables to job / job_<suffix>.
DataFrame results from sample() are named df / df_<suffix> (dfs for a list),
matching the existing pandas idiom rather than result.
… other)

Same convention applied to community and functions notebooks.
The whole-word rename also touched comments/docstrings; revert those back to
natural English (measurement results, plot results, show the result, for each
result) where the word was prose, not the variable.
Where a job = execute(...) is used solely for a single job.result_value() /
job.get_sample_result(), inline it to result = execute(...).result_value() to
match the one-liner used across the library. Genuine ExecutionJob variables
(open_in_ide / id / status / list .result()) are kept as job.
Point-3 cases the earlier pass missed because the variable was res/res_* (now
result*): X = execute(...).result() + X[0].value  ->  X = execute(...).result_value() + X.
Includes cooling's block_encoding_from_results helper (res[0].value -> res).
Left as-is: qaoa_demonstration's execution_result[1].value (genuinely needs the
list) and randomized_benchmarking's async result_async() batch.
- ExecutionSession variable -> es (was execution_session / ES); es_X/es_Y/es_Z
  kept as valid es_<suffix> for the three Pauli-basis sessions.
- Variables holding es.sample() results -> result / result_<suffix> (the object
  exposes .parsed_counts/.dataframe, i.e. a result, not a raw df).
- combi (CombinatorialProblem) and its optimization_result left as-is: already
  uniform across the 18 optimization notebooks.
- grover: only the es.sample result renamed (its oracle QBit register stays res).
- Skipped algo_design_QCE_tutorial_part_I (res is both an output register and the
  sample result, intertwined per cell) — needs manual handling.
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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.

1 participant