-
Notifications
You must be signed in to change notification settings - Fork 192
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
Changes from 250 commits
0efccb6
43f04ae
be5c927
b24cf33
24952e0
64da659
821bf96
ef45130
1a38071
2818bc5
8d21922
a161fca
cf2db43
0ab1a1a
7d62a23
1140d43
c53a6aa
abcbccb
5a35393
a95f14d
67f6321
7271f75
d203d89
e44a1b7
a04131e
e0afae1
3ca6a5b
abdc0af
2995cd9
0770172
e7eb96a
e074ca5
7bc48ca
fc5619a
9109a46
653f566
6f50208
38a0e5c
3111492
ffa9c44
984c5a5
b90ca00
0e82fa1
2622e5a
18a5d33
42071b0
ec800c3
c2e79d4
b912be1
2cef067
39538d3
b5e8229
47e483a
66ad7da
f8e2c29
03e2e04
4fa68ad
62b218d
0cf0369
1f04d5c
b82c60f
544b60c
228a0c4
c33c9da
957536e
58eacf2
2a61349
4711ed4
4787515
4614d83
09a3b3d
ef68ab5
3ca025e
3772015
d21f3fe
7c73d5c
47eac17
7bb97c8
e0938a9
17be8bb
3d2aa7d
6635879
0063663
7a9ef04
f235288
97b2a7f
0c0b109
b0d12b8
2566163
684de21
ad2b353
795b3d1
594bc73
8d5f5fa
a033bee
d042410
51a0448
f2a9504
1a988ac
c46446a
974d0dd
94381b3
98ff9cb
9a73417
04535b4
a77c0e8
3079662
e889047
d3c26fe
91d194d
89417a3
6792bf1
e025d52
b720f33
02f3d86
d0edc7f
eff0f59
aa1ab17
f8468c8
86de974
d3e8d3e
2aa76af
3068c4c
7735378
009a6a3
5f96fb5
714b99f
ee097a0
de45482
5c47a7c
370e893
b878bb0
35f7663
fdfc8db
3b13979
245b363
d0eda0c
8a22aa0
cbb31b4
4fbb410
2186bb5
853004f
3ab60d0
00f7e36
3e45484
37d9426
6329e0c
27ba93f
f23dcfe
c8f1cde
0a4ab59
e5807c3
b244749
1732433
5c7840c
f7d1e56
43bba9e
77e1c7b
f21a21c
80f4a72
211af5a
fb4d7da
a8843fa
6940dd1
23cbcfa
3096218
3817436
2c1a44e
bdd6c43
24a1a18
65956cd
2ca57aa
175b035
a5cf31d
8ddd9c2
7b9f687
644814f
0e04cf4
34d1f0b
a3b8410
3e0ca15
4c7cce1
6aea2fa
f344807
cdfde55
7a754d5
95e2447
5a21881
0d9a694
5f6aa73
081264e
aa46046
08c83b8
6ee1876
aff02bc
0ec33f0
6f813e0
5275040
4ac548e
fa8b43d
4152851
b840acd
9de85c3
fb2dd85
1d5c75e
9cf4467
613a9fe
a3e13b3
4b695d0
ad9aea4
a6b48b9
ff1e16d
913840b
e783f82
ae0aa33
652cdf8
7cf60f2
cf9800f
b709423
b490baf
02e3acc
484108b
29f7c41
a166e51
df5812e
728cb8b
039208d
cce71d1
ca97281
5481a01
7cdc53e
7fe39f3
a097349
5a3c7cb
27628d9
557d1de
6ff028e
eb78267
58dea23
4bbe0e3
cb55b7c
f19fa5d
e21945a
5669673
f6a62b1
728dfae
d745036
a881a68
447983a
08f69b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
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: |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, this looks pretty! :) There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good points - let's change to |
||
[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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know why, but I get a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also noticed a few other errors upon making the docs, e.g., There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A lot of duplicate content shared between this file and There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
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: |
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.