Skip to content

Commit ec232e6

Browse files
Quantum reinforcement learning tutorial (#541)
* QRL tutorial * QRL tutorial v2 * QRL tutorial v2.1 * QRL tutorial v2.1 * QRL tutorial v3 * QRL tutorial v3.1 * QRL tutorial v4.0 * QRL tutorial v4.1 * QRL tutorial v4.2 * QRL tutorial v4.3 * QRL tutorial v4.4 Co-authored-by: MichaelBroughton <MichaelBroughton@users.noreply.github.com>
1 parent 1bc595a commit ec232e6

File tree

6 files changed

+1568
-0
lines changed

6 files changed

+1568
-0
lines changed

docs/_book.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ upper_tabs:
5050
path: /quantum/tutorials/qcnn
5151
- title: "Research tools"
5252
path: /quantum/tutorials/research_tools
53+
- title: "Quantum reinforcement learning"
54+
path: /quantum/tutorials/quantum_reinforcement_learning
5355

5456
- name: API
5557
skip_translation: true
1.24 MB
Loading
54.5 KB
Loading

docs/tutorials/quantum_reinforcement_learning.ipynb

Lines changed: 1562 additions & 0 deletions
Large diffs are not rendered by default.

scripts/ci_validate_tutorials.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
pip install jupyter nbformat==4.4.0 nbconvert==5.5.0 jupyter-client==6.1.12 ipython==7.22.0
1919
# Workaround for ipykernel - see https://github.com/ipython/ipykernel/issues/422
2020
pip install ipykernel==5.1.1
21+
# OpenAI Gym pip package needed for the quantum reinforcement learning tutorial
22+
pip install gym==0.18.0
2123
# Leave the quantum directory, otherwise errors may occur
2224
cd ..
2325
examples_output=$(python3 quantum/scripts/test_tutorials.py)

scripts/test_tutorials.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def test_notebook(self, path):
4040
src = re.sub(r'\!(?!=)', r'#!', src)
4141
# For mnist.ipynb to reduce runtime in test.
4242
src = re.sub('NUM_EXAMPLES ?= ?.*', 'NUM_EXAMPLES = 10', src)
43+
# For quantum_reinforcement_learning.ipynb to reduce runtime in test.
44+
src = re.sub('n_episodes ?= ?.*', 'n_episodes = 50', src)
4345
cell['source'] = src
4446

4547
_ = nbconvert.preprocessors.execute.executenb(nb,

0 commit comments

Comments
 (0)