Package: xanadu-cloud-client
TheXanadu Cloud Client(XCC) is
a Python API and CLI for the Xanadu Cloud.FeaturesSimple. Easy to setup, explore, and use.Efficient. Lazy fetching and caching by default.Structured. Parse Xanadu Cloud responses into JSON or Python objects.InstallationThe XCC requires Python version 3.7 or above. Installation of the XCC, as well
as all dependencies, can be done using pip:pip install xanadu-cloud-clientSetupTo use the XCC, a Xanadu Cloud API key (or equivalent JWT refresh token) is
required. There are several ways to register your API key with the XCC:Save your API key to the XCC configuration file using the CLI:xcc config set REFRESH_TOKEN "Xanadu Cloud API key goes here"Set theXANADU_CLOUD_REFRESH_TOKENenvironment variable:export XANADU_CLOUD_REFRESH_TOKEN="Xanadu Cloud API key goes here"Save your API key to the XCC configuration file using the Python API:importxccsettings=xcc.Settings(REFRESH_TOKEN="Xanadu Cloud API key goes here")settings.save()Afterwards, you can verify that your API key was set correctly using either:The CLI:$xccpingSuccessfully connected to the Xanadu Cloud.The Python API:import xcc

connection = xcc.Connection.load()
assert connection.ping().okTutorialThe following tutorial illustrates a workflow for submitting a job to the Xanadu
Cloud using the CLI. For more detailed usage instructions, use--helpor
refer to the Python API documentation.Before submitting a job, it is a good idea to check which devices are
currently accepting jobs on the Xanadu Cloud:$xccdevicelist--statusonline[{"target":"simulon_gaussian","status":"online"},{"target":"X8_01","status":"online"}]Suppose that thesimulon_gaussiandevice is of interest. The capabilities,
operating conditions, and other properties of a device can be queried by
supplying the appropriate flag to thexcc device getcommand:$xccdevicegetsimulon_gaussian--availability{"monday":["00:00:00+00:00","23:59:59+00:00"],"tuesday":["00:00:00+00:00","23:59:59+00:00"],"wednesday":["00:00:00+00:00","23:59:59+00:00"],"thursday":["00:00:00+00:00","23:59:59+00:00"],"friday":["00:00:00+00:00","23:59:59+00:00"],"saturday":["00:00:00+00:00","23:59:59+00:00"],"sunday":["00:00:00+00:00","23:59:59+00:00"]}Note:Given thatsimulon_gaussianis a simulator, it does not have
any scheduled downtime for maintenance.Now, consider a Blackbird script stored in a local file namedcircuit.xbb:$catcircuit.xbbname example
version 1.0
target simulon_gaussian (shots=4)

MeasureFock() | [0, 1, 2]This circuit can be submitted to thesimulon_gaussiandevice using thexcc job submitcommand:$xccjobsubmit--nameexample\--targetsimulon_gaussian\--language"blackbird:1.0"\--circuit"$(catcircuit.xbb)"{"id":"4c043f6d-54c7-4915-bbb8-eb1b99c4d88e","name":"example","status":"open","target":"simulon_gaussian","created_at":"2021-09-24 17:52:00.532938+00:00","finished_at":null,"running_time":null}Note:Replacecat foo.xbbwithGet-Contentfoo.xbb-Rawon Windows PowerShell.The ID of a job can be used to retrieve additional information about that
job, including its status and running time. Specifically, the ID can be
supplied to thexcc job getcommand along with an optional flag:$xccjobget4c043f6d-54c7-4915-bbb8-eb1b99c4d88e--statuscompleteThe result of a job can be accessed in a similar way:$xccjobget4c043f6d-54c7-4915-bbb8-eb1b99c4d88e--result{"output":["[[0 0 0]\n[0 0 0]\n[0 0 0]\n[0 0 0]]"]}ContributionsWe welcome contributions - simply fork the XCC repository and make apull
requestcontaining
your contribution. All contributors to the XCC will be listed as authors on the
releases. See ourchangelogfor more details.We also encourage bug reports, suggestions for new features and enhancements,
and even links to cool projects or applications built on top of the XCC. Visit
thecontributions pageto learn more about sharing your ideas with the XCC team.SupportSource Code:https://github.com/XanaduAI/xanadu-cloud-clientIssue Tracker:https://github.com/XanaduAI/xanadu-cloud-client/issuesIf you are having issues, please let us know by posting the issue on our GitHub
issue tracker.AuthorsThe XCC is the work ofmany contributors.LicenseThe XCC isfreeandopen source, released under theApache License,
Version 2.0.