Skip to content
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

Merge the demo branch into master #319

Merged
merged 421 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
421 commits
Select commit Hold shift + click to select a range
0efccb6
First draft
antalszava Feb 19, 2020
43f04ae
Add test for async job
Feb 19, 2020
be5c927
Simplify starship CLI
Feb 19, 2020
b24cf33
Fix bug with output logic
Feb 20, 2020
24952e0
Logic of load_config before testing
antalszava Feb 20, 2020
64da659
Linting and cleanup
Feb 20, 2020
821bf96
Linting, docs, cleanup
Feb 20, 2020
ef45130
Linting, formatting
Feb 20, 2020
1a38071
Consolidate exceptions
Feb 20, 2020
2818bc5
StarshipEngine.run() raises exception if remote job enters failed status
Feb 20, 2020
8d21922
Polish docstrings
Feb 20, 2020
a161fca
Add type hints
Feb 20, 2020
cf2db43
More tests
Feb 20, 2020
0ab1a1a
Cleanup
Feb 20, 2020
7d62a23
Testing config object creation, look_for_config_file function
antalszava Feb 21, 2020
1140d43
Request numpy job result directly from remote
Feb 21, 2020
c53a6aa
Bugfixes
Feb 21, 2020
abcbccb
Fix issues regarding job result dimensions
Feb 21, 2020
5a35393
Clean up docs
Feb 21, 2020
a95f14d
APIClient has been absorbed into the new classes
Feb 21, 2020
67f6321
Tests
Feb 21, 2020
7271f75
Add magic methods, polish docs, cleanup
Feb 21, 2020
d203d89
Connection.create_job() accepts Program directly instead of serialize…
Feb 21, 2020
e44a1b7
Unit tests for the parts making up load_config
antalszava Feb 21, 2020
a04131e
Fix Result.samples to have correct dims of (shots, modes)
Feb 21, 2020
e0afae1
Unit test for load_config; removing MagicMock from parse_environment_…
antalszava Feb 21, 2020
3ca6a5b
Marking xfail API Client tests (being refactored in another PR)
antalszava Feb 21, 2020
abdc0af
Marking xfail API Client tests (being refactored in another PR)
antalszava Feb 21, 2020
2995cd9
Adding xfail mark on another API Client test
antalszava Feb 21, 2020
0770172
Docstrings, reorganizing parse_environment_variables function, adding…
antalszava Feb 24, 2020
e7eb96a
Add create config object test with every keyword argument
antalszava Feb 24, 2020
e074ca5
Fix Result.samples to have correct dims of (shots, modes)
Feb 21, 2020
7bc48ca
Adding load_config tests using each units separately; change logic fo…
antalszava Feb 24, 2020
fc5619a
Test docstrings
antalszava Feb 24, 2020
9109a46
Default config refactor
antalszava Feb 24, 2020
653f566
Add absolute path test
antalszava Feb 24, 2020
6f50208
Tests
Feb 24, 2020
38a0e5c
Merge branch 'refactor-job-engines' of github.com:XanaduAI/strawberry…
Feb 24, 2020
3111492
Tests
Feb 24, 2020
ffa9c44
Tests
Feb 24, 2020
984c5a5
Saving path, linting, isort
antalszava Feb 24, 2020
b90ca00
Modify dict formatting in docstring
antalszava Feb 24, 2020
0e82fa1
Dimensions
Feb 24, 2020
2622e5a
Linting, comments, cleanup
Feb 24, 2020
18a5d33
Update tests/frontend/test_configuration.py
antalszava Feb 24, 2020
42071b0
Modifying docstrings based on comments
antalszava Feb 24, 2020
ec800c3
Merge branch 'config_refactor' of https://github.com/XanaduAI/strawbe…
antalszava Feb 24, 2020
c2e79d4
Modifying tests such that look_for_config_in_file returns a tuple;
antalszava Feb 24, 2020
b912be1
Update tests/frontend/test_configuration.py
antalszava Feb 24, 2020
2cef067
Updating test data
antalszava Feb 24, 2020
39538d3
Update tests/frontend/test_configuration.py
antalszava Feb 24, 2020
b5e8229
Update strawberryfields/configuration.py
antalszava Feb 24, 2020
47e483a
Update strawberryfields/configuration.py
antalszava Feb 24, 2020
66ad7da
Merge branch 'config_refactor' of https://github.com/XanaduAI/strawbe…
antalszava Feb 24, 2020
f8e2c29
Update strawberryfields/configuration.py
antalszava Feb 25, 2020
03e2e04
Docstring and comment
antalszava Feb 25, 2020
4fa68ad
Merge branch 'config_refactor' of https://github.com/XanaduAI/strawbe…
antalszava Feb 25, 2020
62b218d
merge master
josh146 Feb 25, 2020
0cf0369
Merge branch 'master' into demo
josh146 Feb 25, 2020
1f04d5c
Docstrings, renaming to load_config_file_if_found, adding defaults to…
antalszava Feb 25, 2020
b82c60f
Change function to get_config_filepath and adjust tests as well accor…
antalszava Feb 25, 2020
544b60c
Renaming create_config
antalszava Feb 25, 2020
228a0c4
Modifying tests to use setenv from monkeypatching in tests
antalszava Feb 25, 2020
c33c9da
Small change for readability
Feb 25, 2020
957536e
Rename 'terminal' to 'final'
Feb 25, 2020
58eacf2
Simplify request functions
Feb 25, 2020
2a61349
Rename 'complete' to 'completed' where relevant
Feb 25, 2020
4711ed4
Use MockResponse class
Feb 25, 2020
4787515
Update tests/frontend/test_engine.py
Feb 25, 2020
4614d83
Adding configuration options and environment variables to module docs…
antalszava Feb 26, 2020
09a3b3d
Removing redundant return None statement
antalszava Feb 26, 2020
ef68ab5
Remove update_config function, add keep_valid_options function and ad…
antalszava Feb 26, 2020
3ca025e
Addig DEFAULT_CONFIG_SPEC
antalszava Feb 26, 2020
3772015
Removed debug option for now
antalszava Feb 26, 2020
d21f3fe
Update strawberryfields/configuration.py
antalszava Feb 26, 2020
7c73d5c
Update strawberryfields/configuration.py
antalszava Feb 26, 2020
47eac17
Moving configuration details to page, updating the configuration page…
antalszava Feb 26, 2020
7bb97c8
Resolving conflicts
antalszava Feb 26, 2020
e0938a9
Update strawberryfields/configuration.py
antalszava Feb 26, 2020
17be8bb
Applying comments: Configuration page modification, removing redundan…
antalszava Feb 26, 2020
3d2aa7d
Merge branch 'config_refactor' of https://github.com/XanaduAI/strawbe…
antalszava Feb 26, 2020
6635879
CHANGELOG
antalszava Feb 26, 2020
0063663
Merge branch 'demo' into config_refactor
antalszava Feb 26, 2020
7a9ef04
Merge pull request #298 from XanaduAI/config_refactor
antalszava Feb 26, 2020
f235288
First draft of store_account
antalszava Feb 26, 2020
97b2a7f
Update strawberryfields/engine.py
Feb 26, 2020
0c0b109
Unit tests and docstrings
antalszava Feb 26, 2020
b0d12b8
Update strawberryfields/engine.py
Feb 26, 2020
2566163
Added extra unit test, modified the configuration.rst
antalszava Feb 26, 2020
684de21
Modified configuration page; renamed configuration location parameter…
antalszava Feb 26, 2020
ad2b353
Refactor Connection, Job, Result to modules under api namespace
Feb 26, 2020
795b3d1
Add non-recognized option and test
antalszava Feb 26, 2020
594bc73
Linting
antalszava Feb 26, 2020
8d5f5fa
Docstrings, adjusting webpage description
antalszava Feb 26, 2020
a033bee
Refactor tests into coherent modules
Feb 26, 2020
d042410
Merge demo branch
Feb 26, 2020
51a0448
Small test refactor
Feb 26, 2020
f2a9504
Check exception messages in tests
Feb 26, 2020
1a988ac
Don't raise error on refreshing final job
Feb 26, 2020
c46446a
Log warning instead of raising error if remote job fails
Feb 26, 2020
974d0dd
Parametrize numpy dtype in job result test
Feb 26, 2020
94381b3
Load default args for Connection from config module
Feb 26, 2020
98ff9cb
Add verbose mode for Connection
Feb 26, 2020
9a73417
Use prompt syntax for docstring examples in StarshipEngine and Connec…
Feb 26, 2020
04535b4
Update thewalrus dependency to pass CI
Feb 26, 2020
a77c0e8
Add test marker for API package
Feb 26, 2020
3079662
Add/update docstrings
Feb 26, 2020
e889047
Pylint, general cleanup
Feb 26, 2020
d3c26fe
Add argument check for cancel_job test
Feb 26, 2020
91d194d
Update tests/api/test_starship_engine.py
Feb 26, 2020
89417a3
Update tests/api/test_starship_engine.py
Feb 26, 2020
6792bf1
Update tests/api/test_result.py
Feb 26, 2020
e025d52
Update tests/api/test_job.py
Feb 26, 2020
b720f33
Update the link for thewalrus in requirements.txt
antalszava Feb 26, 2020
02f3d86
Merge remote-tracking branch 'origin/demo' into store_account
antalszava Feb 26, 2020
d0edc7f
Update error tests for job.cancel()
Feb 26, 2020
eff0f59
Move mock_return to conftest; pylint compliance
Feb 26, 2020
aa1ab17
Remove redundant return descriptions from property docstrings
Feb 26, 2020
f8468c8
Update strawberryfields/engine.py
Feb 26, 2020
86de974
Small changes to docstrings based on review
Feb 26, 2020
d3e8d3e
Merge branch 'refactor-job-engines' of github.com:XanaduAI/strawberry…
Feb 26, 2020
2aa76af
Update strawberryfields/engine.py
Feb 26, 2020
3068c4c
Clean up docstrings
Feb 26, 2020
7735378
Merge branch 'refactor-job-engines' of github.com:XanaduAI/strawberry…
Feb 26, 2020
009a6a3
Update strawberryfields/engine.py
Feb 26, 2020
5f96fb5
Update starship
Feb 26, 2020
714b99f
Update strawberryfields/api/result.py
Feb 26, 2020
ee097a0
Update strawberryfields/api/result.py
Feb 26, 2020
de45482
Update strawberryfields/api/result.py
Feb 26, 2020
5c47a7c
Update strawberryfields/api/result.py
Feb 26, 2020
370e893
Merge branch 'refactor-job-engines' of github.com:XanaduAI/strawberry…
Feb 26, 2020
b878bb0
Adding the testfilename fixture
antalszava Feb 26, 2020
35f7663
Update doc/introduction/configuration.rst
antalszava Feb 26, 2020
fdfc8db
Title adjustment
antalszava Feb 26, 2020
3b13979
Merge branch 'store_account' of https://github.com/XanaduAI/strawberr…
antalszava Feb 26, 2020
245b363
Update strawberryfields/configuration.py
antalszava Feb 26, 2020
d0eda0c
Update strawberryfields/configuration.py
antalszava Feb 26, 2020
8a22aa0
Update strawberryfields/configuration.py
antalszava Feb 26, 2020
cbb31b4
Applying suggested changes
antalszava Feb 26, 2020
4fbb410
Merge branch 'store_account' of https://github.com/XanaduAI/strawberr…
antalszava Feb 26, 2020
2186bb5
merge master
josh146 Feb 26, 2020
853004f
Reword configuration description
antalszava Feb 26, 2020
3ab60d0
Swap the default for location to user_config
antalszava Feb 26, 2020
00f7e36
Update doc/introduction/configuration.rst
antalszava Feb 27, 2020
3e45484
Use clearer 'blocking'/'non-blocking' terminology where relevant
Feb 27, 2020
37d9426
Merge demo
Feb 27, 2020
6329e0c
Remove obsolete exception
Feb 27, 2020
27ba93f
Fix Result.samples dimensions to (shots, modes)
Feb 27, 2020
f23dcfe
Read target from program
Feb 27, 2020
c8f1cde
Update imports
Feb 27, 2020
0a4ab59
Remove samples transpose in starship CLI
Feb 27, 2020
e5807c3
Clean up config loading logic
Feb 27, 2020
b244749
Simplify JobStatus string repr
Feb 27, 2020
1732433
Moving tmpdir.join calls to conftest -> changing to a function scoped…
antalszava Feb 27, 2020
5c7840c
Update configuration.rst
antalszava Feb 27, 2020
f7d1e56
Update strawberryfields/configuration.py
antalszava Feb 27, 2020
43bba9e
Update configuration.rst
antalszava Feb 27, 2020
77e1c7b
Update configuration.rst
antalszava Feb 27, 2020
f21a21c
Update configuration.rst
antalszava Feb 27, 2020
80f4a72
Update strawberryfields/configuration.py
antalszava Feb 27, 2020
211af5a
Update strawberryfields/configuration.py
antalszava Feb 27, 2020
fb4d7da
Updating __init__
antalszava Feb 27, 2020
a8843fa
Resolve merge conflict
antalszava Feb 27, 2020
6940dd1
Updating docstring to use raw strings
antalszava Feb 27, 2020
23cbcfa
Change job status property to string instead of enum
Feb 27, 2020
3096218
Update strawberryfields/api/result.py
Feb 27, 2020
3817436
Update strawberryfields/engine.py
Feb 27, 2020
2c1a44e
Clean up docstrings
Feb 27, 2020
bdd6c43
update store_account logic with no directory case
antalszava Feb 27, 2020
24a1a18
Add new api package to docs
Feb 27, 2020
65956cd
Fixed a couple of outdated docstring types
Feb 27, 2020
2ca57aa
Update strawberryfields/engine.py
Feb 27, 2020
175b035
Minor cleanup
Feb 27, 2020
a5cf31d
Add api package tests to makefile and travis config
Feb 27, 2020
8ddd9c2
Adding nested directory creation logic; adding tests
antalszava Feb 27, 2020
7b9f687
Reword warning message.
antalszava Feb 27, 2020
644814f
Mention committing the auth token
antalszava Feb 27, 2020
0e04cf4
Reword description of local config
antalszava Feb 27, 2020
34d1f0b
Adjust ordering in toctree to be alphabetical
Feb 27, 2020
a3b8410
Adding examples to the docstring
antalszava Feb 27, 2020
3e0ca15
Update docstring
antalszava Feb 27, 2020
4c7cce1
Reverting to having the test data in the tests instead of in fixtures
antalszava Feb 27, 2020
6aea2fa
cloud -> Cloud
antalszava Feb 27, 2020
f344807
Rewording
antalszava Feb 27, 2020
cdfde55
Revert test changes, minor modifications
antalszava Feb 27, 2020
7a754d5
Update doc/introduction/configuration.rst
antalszava Feb 28, 2020
95e2447
Update doc/introduction/configuration.rst
antalszava Feb 28, 2020
5a21881
Update strawberryfields/configuration.py
antalszava Feb 28, 2020
0d9a694
Update strawberryfields/configuration.py
antalszava Feb 28, 2020
5f6aa73
Update strawberryfields/configuration.py
antalszava Feb 28, 2020
081264e
Update strawberryfields/configuration.py
antalszava Feb 28, 2020
aa46046
Update strawberryfields/configuration.py
antalszava Feb 28, 2020
08c83b8
Update doc/introduction/configuration.rst
antalszava Feb 28, 2020
6ee1876
Update doc/introduction/configuration.rst
antalszava Feb 28, 2020
aff02bc
Modifications from comments
antalszava Feb 28, 2020
0ec33f0
Resolve conflicts
antalszava Feb 28, 2020
6f813e0
Fixes a bug in the MZgate convention by reversing the internal and ex…
josh146 Feb 28, 2020
5275040
Update docstring example
Feb 28, 2020
4ac548e
Remove token from CLI args - load using normal config logic
Feb 28, 2020
fa8b43d
Re-black with line length 100
Feb 28, 2020
4152851
Merge from demo
Feb 28, 2020
b840acd
Update changelog
Feb 28, 2020
9de85c3
CHANGELOG
antalszava Feb 28, 2020
fb2dd85
Linting
antalszava Feb 28, 2020
1d5c75e
Blacking; isort sf/__init__.py
antalszava Feb 28, 2020
9cf4467
Update strawberryfields/api/result.py
Feb 28, 2020
613a9fe
Remove unused import
Feb 28, 2020
a3e13b3
Merge branch 'refactor-job-engines' of github.com:XanaduAI/strawberry…
Feb 28, 2020
4b695d0
Merge pull request #306 from XanaduAI/store_account
antalszava Feb 28, 2020
ad9aea4
Merge pull request #294 from XanaduAI/refactor-job-engines
Feb 28, 2020
a6b48b9
Merge branch 'master' into demo
josh146 Mar 2, 2020
ff1e16d
merge master into demo
josh146 Mar 2, 2020
913840b
Change default hostname (#309)
antalszava Mar 4, 2020
e783f82
merge master
josh146 Mar 10, 2020
ae0aa33
fix tutorial teleportation
josh146 Mar 10, 2020
652cdf8
fix post-selection tutorial
josh146 Mar 10, 2020
7cf60f2
updated more tutorials
josh146 Mar 10, 2020
cf9800f
updated build
josh146 Mar 10, 2020
b709423
added new
josh146 Mar 10, 2020
b490baf
documentation fixes
josh146 Mar 10, 2020
02e3acc
more docs fixes
josh146 Mar 10, 2020
484108b
temporarily add tutorial cache
josh146 Mar 10, 2020
29f7c41
undo cache
josh146 Mar 10, 2020
a166e51
docs styling
josh146 Mar 10, 2020
df5812e
Updating io.load docstring
antalszava Mar 11, 2020
728cb8b
Updating the `io.load` function docstring. (#314)
antalszava Mar 11, 2020
039208d
Refactoring the starship CLI and adding unit tests (#312)
antalszava Mar 11, 2020
cce71d1
merge master
josh146 Mar 12, 2020
ca97281
Resolve conflict
antalszava Mar 12, 2020
5481a01
Update the usage occurrences in the docstrings, fix up missing assert…
antalszava Mar 13, 2020
7cdc53e
Update tests/frontend/test_starship.py
antalszava Mar 13, 2020
7fe39f3
Updating parser description
antalszava Mar 13, 2020
a097349
Rename StarshipEngine to RemoteEngine, starship CLI to sf (#316)
josh146 Mar 15, 2020
5a3c7cb
Merge branch 'demo' of https://github.com/XanaduAI/strawberryfields i…
antalszava Mar 16, 2020
27628d9
Resolve merge conflicts
antalszava Mar 16, 2020
557d1de
fixes
josh146 Mar 16, 2020
6ff028e
merge
josh146 Mar 16, 2020
eb78267
add sf_cli page
josh146 Mar 16, 2020
58dea23
Correct CLI docstring and test typos (#318)
antalszava Mar 16, 2020
4bbe0e3
merge cli fix
josh146 Mar 16, 2020
cb55b7c
reorder index
josh146 Mar 16, 2020
f19fa5d
updated changelog
josh146 Mar 16, 2020
e21945a
typo
josh146 Mar 16, 2020
5669673
update setup.py
josh146 Mar 16, 2020
f6a62b1
Apply suggestions from code review
josh146 Mar 16, 2020
728dfae
suggested changes
josh146 Mar 17, 2020
d745036
Apply suggestions from code review
josh146 Mar 17, 2020
a881a68
Apply suggestions from code review
josh146 Mar 18, 2020
447983a
Add apps example (#321)
trbromley Mar 18, 2020
08f69b6
Apply suggestions from code review
josh146 Mar 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
324 changes: 198 additions & 126 deletions .github/CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ notebooks/*
examples/.ipynb_checkpoints/*
.pytest_cache/*
pytest/.pytest_cache/
doc/tutorials_apps/*
examples_apps/*.html
doc/_static/thumbs/*
doc/tutorials_apps/*
!doc/_static/code.png
doc/code/api/*
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
- LOGGING=info
matrix:
include:
- env: OPTIONS="frontend or fock or gaussian or apps"
- env: OPTIONS="frontend or fock or gaussian or apps or api"
- env: OPTIONS="tf and pure"
- env: OPTIONS="tf and mixed"
- env: BATCHED=1 OPTIONS="tf and pure"
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ dist:
.PHONY : clean
clean:
rm -rf strawberryfields/__pycache__
rm -rf strawberryfields/api/__pycache__
rm -rf strawberryfields/backends/__pycache__
rm -rf strawberryfields/backends/fockbackend/__pycache__
rm -rf strawberryfields/backends/tfbackend/__pycache__
rm -rf strawberryfields/backends/gaussianbackend/__pycache__
rm -rf tests/__pycache__
rm -rf tests/api/__pycache__
rm -rf tests/backend/__pycache__
rm -rf tests/frontend/__pycache__
rm -rf tests/integration/__pycache__
Expand All @@ -51,7 +53,7 @@ docs:
clean-docs:
make -C doc clean

test: test-frontend test-gaussian test-fock test-tf batch-test-tf test-apps
test: test-frontend test-gaussian test-fock test-tf batch-test-tf test-apps test-api

test-%:
@echo "Testing $(subst test-,,$@) backend..."
Expand All @@ -61,7 +63,7 @@ batch-test-%:
@echo "Testing $(subst batch-test-,,$@) backend in batch mode..."
export BATCHED=1 && $(PYTHON) $(TESTRUNNER) -m $(subst batch-test-,,"$@")

coverage: coverage-frontend coverage-gaussian coverage-fock coverage-tf batch-coverage-tf coverage-apps
coverage: coverage-frontend coverage-gaussian coverage-fock coverage-tf batch-coverage-tf coverage-apps coverage-api

coverage-%:
@echo "Generating coverage report for $(subst coverage-,,$@)..."
Expand Down
24 changes: 1 addition & 23 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,13 @@ Features
Installation
============

Strawberry Fields requires Python version 3.5, 3.6, or 3.7 (3.8 is currently not support). Installation of Strawberry Fields, as well as all dependencies, can be done using pip:
Strawberry Fields requires Python version 3.5, 3.6, 3.7, or 3.8. Installation of Strawberry Fields, as well as all dependencies, can be done using pip:

.. code-block:: bash

pip install strawberryfields


TensorFlow support
Copy link
Contributor

@antalszava antalszava Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Edit1: Got my answer later 😄
Edit2: but then got confused again 😅 )

Will support for TF 1 be discontinued completely?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! The TF1.3 backend was too outdated (current release is 1.17 I think), and no longer works well with Python 3.7+. To keep TF 1.X support, we would need to upgrade the TF1.3 backend to TF1.17, which is not worth it.

------------------

To use Strawberry Fields with TensorFlow, version 1.3 of
TensorFlow is required. This can be installed alongside Strawberry Fields
as follows:

.. code-block:: console

pip install strawberryfields tensorflow==1.3

Or, to install Strawberry Fields and TensorFlow with GPU and CUDA support:

.. code-block:: console

pip install strawberryfields tensorflow-gpu==1.3


Note that TensorFlow version 1.3 is only supported on Python versions
less than 3.7.


Getting started
===============

Expand Down
4 changes: 2 additions & 2 deletions default_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[api]
# Options for the Strawberry Fields Cloud API
# Fill in your authentication
authentatication_token = None # example token form: 071cdcce-9241-4965-93af-4a4dbc739135
authentication_token = None # example token form: 071cdcce-9241-4965-93af-4a4dbc739135
# Fill in the hostname of the Cloud API
hostname = "localhost"
hostname = "platform.strawberryfields.ai"
# Whether Strawberry Fields should use SSL to connect to the API
use_ssl = true
3 changes: 2 additions & 1 deletion doc/_static/xanadu_gallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ p.sphx-glr-signature a.reference.external {


.sphx-glr-download-link-note.admonition.note,
.reference.download.internal,
.sphx-glr-download,
.sphx-glr-footer,
.sphx-glr-signature {
display: none;
}
Expand Down
14 changes: 14 additions & 0 deletions doc/code/sf_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sf.api
======

.. currentmodule:: strawberryfields.api

.. warning::

Unless you are a Strawberry Fields developer, you likely do not need
to use these classes directly.

.. automodapi:: strawberryfields.api
:no-heading:
:no-inheritance-diagram:
:include-all-objects:
133 changes: 133 additions & 0 deletions doc/code/sf_cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
sf.cli
======

.. currentmodule:: strawberryfields.cli

The Strawberry Fields command line program ``sf`` provides several utilities
including:

* ``sf configure [--token] [--local]``: configure the connection to the cloud platform

* ``sf run input [--output FILE]``: submit and execute quantum programs from the command line

* ``sf --ping``: verify your connection to the Xanadu cloud platform



Configure
---------

Using the ``sf configure`` command to create a configuration file on Linux:

.. code-block:: bash

$ sf configure --token MYAUTH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mentioned elsewhere, but users might not know what "MYAUTH" is

$ cat ~/.config/strawberryfields/config.toml
[api]
authentication_token = "MYAUTH"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my question elsewhere about how best to indicate output of terminal in a code block

hostname = "platform.strawberryfields.ai"
use_ssl = true
port = 443

Using the ``sf configure`` command to create a configuration file on Windows:

.. code-block:: ps1con

C:\> sf configure --token MYAUTH
C:\> cat C:\Users\USERNAME\AppData\Local\Xanadu\strawberryfields\config.toml
Comment on lines +34 to +37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks pretty! :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, I couldn't get this to work! The powershell prompt is actually

PS C:\> sf configure --token MYAUTH

but Sphinx gives a warning when I include the PS :( Also, the syntax highlighting doesn't seem to work either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give this a look from the simple command line of Windows and then maybe we could omit PS. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine with the standard command line as well! (Was using the Anaconda Prompt)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the ps1con (which I assume stands for the 1st powershell console) be changed to cmd (or something similiar) then, since the prompt will be looking like that in cmd?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason why powershell is chosen as the "default" windows shell? Although I like powershell, I'm not sure if it's actually the default/most commonly used shell in Windows, but I might be wrong about that (it seems like Windows 10 set powershell as default a few years ago, but I'm not sure that's still the case since cmd is still very prevalent and powershell works quite a bit different from e.g. bash).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, cat is only available in powershell (not in cmd), so that's another good reason for using that instead. 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points - let's change to cmd across the board

[api]
authentication_token = "MYAUTH"
hostname = "platform.strawberryfields.ai"
use_ssl = true
port = 443

**Flags:**

* ``--token``: the authentication token to use

* ``--local``: whether or not to create the configuration file locally in the current directory


If not provided, the configuration file will be saved in the user's configuration directory.

Configuration wizard
~~~~~~~~~~~~~~~~~~~~

For more advanced configuration options, the configuration wizard can be used.

Here we show how the interactive wizard can be used to configure each API
option. Once done, we have a look at the newly created configuration file.

Example run in a Linux-based operating system:

.. code-block:: bash

$ sf configure
Please enter the authentication token to use when connecting: [] MYAUTH
Please enter the hostname of the server to connect to: [platform.strawberryfields.ai] MYHOST
Should the client attempt to connect over SSL? [y] N
Please enter the port number to connect with: [443] 12345

$cat ~/.config/strawberryfields/config.toml
[api]
authentication_token = "MYAUTH"
hostname = "MYHOST"
use_ssl = false
port = "12345"

The same example run on a Windows operating system:

.. code-block:: ps1con


C:\> sf configure

Please enter the authentication token to use when connecting: [] MYAUTH
Please enter the hostname of the server to connect to: [platform.strawberryfields.ai] MYHOST
Should the client attempt to connect over SSL? [y] N
Please enter the port number to connect with: [443] 12345

C:\> cat C:\Users\USERNAME\AppData\Local\Xanadu\strawberryfields\config.toml

[api]
authentication_token = "MYAUTH"
hostname = "MYHOST"
use_ssl = false
port = "12345"

Testing your connection
-----------------------

To test that your account credentials correctly authenticate against the cloud platform, the ``ping`` flag can be used:

.. code-block:: bash

$ sf --ping
You have successfully authenticated to the platform!

Submitting jobs
---------------

To execute a Blackbird ``.xbb`` file from the command line, the ``sf run`` command
line program can be used:

.. code-block:: console

sf run test.xbb --output out.txt

After executing the above command, the result will be stored in ``out.txt``
in the current working directory.
You can also omit the ``--output`` parameter to print the result to the screen.

Functions
---------
Comment on lines +122 to +123
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why, but I get a WARNING: Title level inconsistent for this part 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also noticed a few other errors upon making the docs, e.g., WARNING: autodoc: failed to import class 'Chip0Specs' - are these ok?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird 🤔 Works fine for me


.. warning::

Unless you are a Strawberry Fields developer, you likely do not need
to access the functions in this module directly.

.. automodapi:: strawberryfields.cli
:no-heading:
:no-inheritance-diagram:
:skip: store_account, create_config, load, RemoteEngine, Connection, ConfigurationError
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of duplicate content shared between this file and configuration.rst. Seems like an unnecessary maintenance burden

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, I would like to address this with an overhaul of config.rst, cli.rst, and remote.rst

17 changes: 17 additions & 0 deletions doc/code/sf_configuration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sf.configuration
================

.. currentmodule:: strawberryfields.configuration

.. warning::

Unless you are a Strawberry Fields developer, you likely do not need
to access this module directly.

See the :doc:`/introduction/configuration` page for more information on
configuring Strawberry Fields.

.. automodapi:: strawberryfields.configuration
:no-heading:
:skip: user_config_dir
:no-inheritance-diagram:
5 changes: 4 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ def __getattr__(cls, name):
'sphinx_gallery.gen_gallery',
"sphinx.ext.intersphinx",
"sphinx_automodapi.automodapi",
'sphinx_copybutton'
'sphinx_copybutton',
"m2r"
]

source_suffix = ['.rst', '.md']

from glob import glob
import shutil
import warnings
Expand Down
6 changes: 6 additions & 0 deletions doc/development/release_notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Release notes
-------------

This page contains the release notes for Strawberry Fields.

.. mdinclude:: ../../.github/CHANGELOG.md
14 changes: 3 additions & 11 deletions doc/development/research.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _research:

Research and contribution
===============================
=========================

Research
---------------
Expand Down Expand Up @@ -33,16 +33,8 @@ Support
If you are having issues, please let us know by posting the issue on our Github issue tracker.

To chat directly with the team designing and building Strawberry Fields, as well as members of our
community - ranging from professors of quantum physics, to students, to those just interested in being a
part of a rapidly growing industry - you can join our `Slack channel <https://u.strawberryfields.ai/slack>`_.

Available channels:

* ``#strawberryfields``: For general discussion regarding Strawberry Fields
* ``#sf_projects``: For discussion of research ideas and projects built on Strawberry Fields
* ``#sf_bugs``: For discussion of any bugs and issues you run into using Strawberry Fields
* ``#sf_interactive``: For discussion relating to the `Strawberry Fields Interactive <https://strawberryfields.ai>`_ web application
* ``#sf_docs``: For discussion of the Strawberry Fields `documentation <https://strawberryfields.readthedocs.io>`_
community—ranging from professors of quantum physics, to students, to those just interested in being a
part of a rapidly growing industry—you can join our `discussion forum <https://discuss.pennylane.ai>`_ and `Slack channel <https://u.strawberryfields.ai/slack>`_.

Sometimes, it might take us a couple of hours to reply - please be patient!

Expand Down
13 changes: 10 additions & 3 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ Support
- **Source Code:** https://github.com/XanaduAI/strawberryfields
- **Issue Tracker:** https://github.com/XanaduAI/strawberryfields/issues

If you are having issues, please let us know by posting the issue on our Github issue tracker, or by joining our `Strawberry Fields Slack channel <https://u.strawberryfields.ai/slack>`_.
If you are having issues, please let us know by posting the issue on our Github issue tracker.

To chat directly with the team designing and building Strawberry Fields, as well as members of our community—ranging from quantum computing researchers, to students, to those just interested in being a part of a rapidly growing industry—you can join our `discussion forum <https://discuss.pennylane.ai>`_ and `Slack channel <https://u.strawberryfields.ai/slack>`_.

For more details on contributing or performing research with Strawberry Fields, please see
:ref:`research`.
Expand All @@ -154,6 +156,7 @@ Strawberry Fields is **free** and **open source**, released under the Apache Lic
introduction/ops
introduction/states
introduction/tutorials
introduction/configuration
zreferences

.. toctree::
Expand All @@ -163,6 +166,7 @@ Strawberry Fields is **free** and **open source**, released under the Apache Lic

development/development_guide
development/research
development/release_notes.md

.. toctree::
:maxdepth: 1
Expand All @@ -171,14 +175,17 @@ Strawberry Fields is **free** and **open source**, released under the Apache Lic

code/sf
code/sf_apps
code/sf_ops
code/sf_utils
code/sf_api
code/sf_backends
code/sf_circuitspecs
code/sf_circuitdrawer
code/sf_cli
code/sf_configuration
code/sf_decompositions
code/sf_engine
code/sf_io
code/sf_ops
code/sf_program
code/sf_program_utils
code/sf_parameters
code/sf_utils
Loading