Skip to content

Commit

Permalink
Added "getting started" to Readme and as notebook and adjusted the docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenblank committed Feb 28, 2019
1 parent cdcbbf3 commit 1bcc3bc
Show file tree
Hide file tree
Showing 18 changed files with 305 additions and 243 deletions.
48 changes: 48 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,57 @@ Install from PyPI
$ pip install acquantum-qiskit
.. getting-started-start-inclusion-marker-do-not-remove
Getting started
===============

As this provider is only needed to actually run a quantum circuit, pretty much the whole stack
is identical as already known. The only difference is that the provider must be instantiated
explicitly and the credentials must be given: either directly through user/password or by
setting system environment variables `ACQ_USER` and `ACQ_PWD`.

.. code-block:: python
import qiskit
import qiskit.extensions.standard as standard
from qiskit.circuit.measure import measure
from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister
from acquantum_qiskit import AcQuantumProvider
q = QuantumRegister(2, "q")
r = QuantumRegister(1, "r")
c = ClassicalRegister(2, "c")
ca = ClassicalRegister(1, "c^a")
qc = QuantumCircuit(q, r, c, ca, name="TestCircuit")
standard.h(qc, q[0])
standard.cx(qc, q[0], q[1])
standard.x(qc, r)
measure(qc, q, c)
measure(qc, r, ca)
# Create the provider
provider = AcQuantumProvider()
# load_account without arguments tries to load from system environment varables
# the user (ACQ_USER) and password (ACQ_PWD)
provider.enable_account()
# if this is not what you want instantiate instead
# ===> uncomment this if you want this:
# provider.enable_account(user='your_user', password='xxxxxxxx')
backend = provider.get_backend("SIMULATE") # type: AcQuantumBackend
# Execute and print out the results
job = qiskit.execute(qc, backend, shots=1024, seed=None)
result = job.result()
print(result.get_counts())
.. getting-started-end-inclusion-marker-do-not-remove
Contributing
============
Expand Down
13 changes: 13 additions & 0 deletions docs/acquantum_qiskit.credentials.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
acquantum_qiskit.credentials package
=====================================

Submodules
----------

Module contents
---------------

.. automodule:: acquantum_qiskit.credentials
:members:
:undoc-members:
:show-inheritance:
22 changes: 22 additions & 0 deletions docs/acquantum_qiskit.models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
acquantum_qiskit.models package
================================

Submodules
----------

acquantum_qiskit.models.Model module
-------------------------------------

.. automodule:: acquantum_qiskit.models.Model
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: acquantum_qiskit.models
:members:
:undoc-members:
:show-inheritance:
70 changes: 70 additions & 0 deletions docs/acquantum_qiskit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
acquantum_qiskit package
===========================

Subpackages
-----------

.. toctree::

acquantum_qiskit.credentials
acquantum_qiskit.models

Submodules
----------

acquantum_qiskit.acquantumbackend module
-------------------------------------------

.. automodule:: acquantum_qiskit.acquantumbackend
:members:
:undoc-members:
:show-inheritance:

acquantum_qiskit.acquantumerrors module
------------------------------------------

.. automodule:: acquantum_qiskit.acquantumerrors
:members:
:undoc-members:
:show-inheritance:

acquantum_qiskit.acquantumjob module
---------------------------------------

.. automodule:: acquantum_qiskit.acquantumjob
:members:
:undoc-members:
:show-inheritance:

acquantum_qiskit.acquantumprovider module
--------------------------------------------

.. automodule:: acquantum_qiskit.acquantumprovider
:members:
:undoc-members:
:show-inheritance:

acquantum_qiskit.acquantumsingleprovider module
--------------------------------------------------

.. automodule:: acquantum_qiskit.acquantumsingleprovider
:members:
:undoc-members:
:show-inheritance:

acquantum_qiskit.backendconfiguration module
-----------------------------------------------

.. automodule:: acquantum_qiskit.backendconfiguration
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: acquantum_qiskit
:members:
:undoc-members:
:show-inheritance:
3 changes: 3 additions & 0 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. include:: ../README.rst
:start-after: getting-started-start-inclusion-marker-do-not-remove
:end-before: getting-started-end-inclusion-marker-do-not-remove
12 changes: 7 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
.. qiskit_alibaba_provider documentation master file, created by
sphinx-quickstart on Wed Jan 23 13:20:27 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
sphinx-quickstart on Wed Jan 23 13:20:27 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to qiskit_alibaba_provider's documentation!
===================================================

Welcome to the documentation of the qiskit-plugin of the Alibaba Quantum Computer!

.. toctree::
:maxdepth: 2
:caption: Contents:

providers
setup
getting_started
acquantum_qiskit
test


Expand Down
2 changes: 1 addition & 1 deletion docs/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ qiskit_alibaba_provider
.. toctree::
:maxdepth: 4

providers
acquantum_qiskit
setup
test
22 changes: 0 additions & 22 deletions docs/providers.acquantum.credentials.rst

This file was deleted.

30 changes: 0 additions & 30 deletions docs/providers.acquantum.models.rst

This file was deleted.

78 changes: 0 additions & 78 deletions docs/providers.acquantum.rst

This file was deleted.

17 changes: 0 additions & 17 deletions docs/providers.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/setup.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
test.providers.acquantum.credentials package
test.acquantum_qiskit.credentials package
============================================

Submodules
----------

test.providers.acquantum.credentials.test\_credentials module
test.acquantum_qiskit.credentials.test\_credentials module
-------------------------------------------------------------

.. automodule:: test.providers.acquantum.credentials.test_credentials
.. automodule:: test.acquantum_qiskit.credentials.test_credentials
:members:
:undoc-members:
:show-inheritance:
Expand All @@ -16,7 +16,7 @@ test.providers.acquantum.credentials.test\_credentials module
Module contents
---------------

.. automodule:: test.providers.acquantum.credentials
.. automodule:: test.acquantum_qiskit.credentials
:members:
:undoc-members:
:show-inheritance:

0 comments on commit 1bcc3bc

Please sign in to comment.