From 94b06d676ceb3df6f49e617b0eea11bfa833ff25 Mon Sep 17 00:00:00 2001 From: IceKhan13 Date: Tue, 22 Aug 2023 18:48:06 -0400 Subject: [PATCH] Paper: address review comments --- client/purplecaffeine/widget.py | 4 ++-- docs/conf.py | 4 ++++ docs/index.rst | 14 ++++++++++++++ docs/paper/paper.md | 13 +++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/client/purplecaffeine/widget.py b/client/purplecaffeine/widget.py index 1bdd73a..52401a0 100644 --- a/client/purplecaffeine/widget.py +++ b/client/purplecaffeine/widget.py @@ -110,9 +110,9 @@ def render_trails_list(self): We render one button per each trial """ buttons = [] - for trial in self.trials: + for idx, trial in enumerate(self.trials): button = widgets.Button( - description=f"{trial.name} | {trial.uuid}"[:30], + description=f"{self.offset + idx + 1}. {trial.name}"[:30], disabled=False, button_style="", tooltip=trial.uuid, diff --git a/docs/conf.py b/docs/conf.py index 708f5e1..4e156da 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,4 +59,8 @@ nbsphinx_timeout = 180 nbsphinx_execute = "never" nbsphinx_widgets_path = "" +nbsphinx_thumbnails = { + "**": "_static/images/logo.png", +} + exclude_patterns = ["_build", "**.ipynb_checkpoints"] diff --git a/docs/index.rst b/docs/index.rst index 637e405..11ee86a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -68,6 +68,20 @@ Step 2: visualize tracked data ------------ +**Serialization** + +Trials are serialized using Python `json` module. We've implemented +custom `json.JSONEncoder` and `json.JSONDecoder` to handle quantum computing objects +like `QuantumCircuit`, `Backend`, `Operator`, etc. + +Encoders and decoders are using `pickle` module to serialize some classes (`Backend`). +The pickle module is not secure. Only unpickle data you trust. +It is possible to construct malicious pickle data which will +execute arbitrary code during unpickling. Never unpickle data that +could have come from an untrusted source, or that could have been tampered with. + +------------ + **Content** .. toctree:: diff --git a/docs/paper/paper.md b/docs/paper/paper.md index 2150dcc..8ed3573 100644 --- a/docs/paper/paper.md +++ b/docs/paper/paper.md @@ -139,6 +139,19 @@ providing a convenient and interactive environment for researchers. ![Widget.\label{fig:widget}](./images/widget_updated.png) +## Serialization + +`Trial`s are serialized using Python's `json` module. We've implemented +custom `json.JSONEncoder` and `json.JSONDecoder` to handle quantum computing objects +like `QuantumCircuit`, `Backend`, `Operator`, etc. + +Encoders and decoders are using `pickle` module to serialize some classes (`Backend`). +The pickle module is not secure. Only unpickle data you trust. +It is possible to construct malicious pickle data which will +execute arbitrary code during unpickling. Never unpickle data that +could have come from an untrusted source, or that could have been tampered with. + + # Acknowledgements We would like to express our sincere gratitude to the Qiskit Advocates Mentorship