edit notebooks - #1646
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| @@ -124,7 +124,8 @@ | |||
| ")\n", | |||
There was a problem hiding this comment.
Line #6. res_state_check = calculate_state_vector(qprog_state_check)
qprog_state_check is redundant, we could use the current model
Reply via ReviewNB
| @@ -53,12 +53,15 @@ | |||
| "from matplotlib.colors import LinearSegmentedColormap\n", | |||
There was a problem hiding this comment.
Line #11. model = set_execution_preferences(model, execution_preferences)
set_execution_preferences is not needed
Reply via ReviewNB
| @@ -53,12 +53,15 @@ | |||
| "from matplotlib.colors import LinearSegmentedColormap\n", | |||
There was a problem hiding this comment.
Line #2. print(dict(zip(res["bitstring"], res["counts"])))
the dataframe should be printed instead
Reply via ReviewNB
| @@ -53,12 +53,15 @@ | |||
| "from matplotlib.colors import LinearSegmentedColormap\n", | |||
There was a problem hiding this comment.
def results_error_rate(res):
total = res["counts"].sum()
zeros = res[res["bitstring"] == "0"]["counts"].sum()
return 1 - zeros / total
Reply via ReviewNB
| @@ -53,12 +53,15 @@ | |||
| "from matplotlib.colors import LinearSegmentedColormap\n", | |||
There was a problem hiding this comment.
Line #17. model = set_execution_preferences(model, execution_preferences)
not needed
Reply via ReviewNB
| @@ -53,12 +53,15 @@ | |||
| "from matplotlib.colors import LinearSegmentedColormap\n", | |||
There was a problem hiding this comment.
Line #21. model = set_execution_preferences(model, execution_preferences)
samem not needed
Reply via ReviewNB
| "source": [ | ||
| "preferences = IBMBackendPreferences(\n", | ||
| " backend_name=\"ibm_marrakesh\",\n", | ||
| "backend = \"ibm/ibm_marrakesh\"\n", |
There was a problem hiding this comment.
I think this needs to be ibm/marrakesh--verify this
| "source": [ | ||
| "preferences = IBMBackendPreferences(\n", | ||
| " backend_name=\"ibm_sherbrooke\",\n", | ||
| "backend = \"ibm/ibm_sherbrooke\"\n", |
There was a problem hiding this comment.
Similar: ibm/sherbrooke
| "backend_preferences = ClassiqBackendPreferences(\n", | ||
| " backend_name=ClassiqSimulatorBackendNames.SIMULATOR_STATEVECTOR\n", | ||
| ")\n", | ||
| "\n", | ||
| "\n", | ||
| "# Construct a representation of HHL model\n", | ||
| "def state_check_model(main, backend_preferences):\n", | ||
| " qmod_state_check = create_model(\n", | ||
| " main,\n", | ||
| " execution_preferences=ExecutionPreferences(\n", | ||
| " num_shots=1, backend_preferences=backend_preferences\n", | ||
| " ),\n", | ||
| " )\n", | ||
| " return qmod_state_check" | ||
| "# No additional model wrapping is required for this state-vector verification." |
There was a problem hiding this comment.
Maybe you can delete this cell?
| @@ -390,7 +372,7 @@ | |||
| "metadata": {}, | |||
| "source": [ | |||
| "# Read results\n", | |||
There was a problem hiding this comment.
This can just be
res
Or display(res) I think
080d89c to
3bde933
Compare
PR Description
Some notes
Please make sure that the notebook runs successfully with the latest Classiq version.
Please make sure that you placed the files in an appropriate folder
.ipynband.qmodto be unique across this repository..qmod,.synthesis_options.json,.metadata.jsonIf applicable, please include link to the paper on which the notebook is based, in the notebook itself.
Please use
rebaseon your branch (no merge commits)Please link this PR to the relevant issue
Please make sure to run
pre-commitwhen commiting changesgitin the terminal, make sure to installpre-commitvia runningpip install pre-commitfollowed bypre-commit installpre-commitdocumentationpre-commit.pre-commitmay minorly alter some files. Make sure togit addthe changes done bypre-commit