Skip to content

Commit

Permalink
Merge branch 'main' into catch-error-create-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 committed Dec 3, 2024
2 parents 401343d + 7d5f3ac commit fd66fa1
Show file tree
Hide file tree
Showing 64 changed files with 889 additions and 535 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -r requirements-dev.txt -r requirements-visual.txt -e .
pip install -e '.[dev, visualization]'
- name: Run black
run: make style
- name: Run lint
Expand All @@ -58,8 +58,7 @@ jobs:
pip install -U tox
pip install nbqa docutils
sudo apt install -y graphviz pandoc
pip install -e .
pip install -e '.[dev, visualization]'
wget https://github.com/errata-ai/vale/releases/download/v2.23.0/vale_2.23.0_Linux_64-bit.tar.gz
mkdir $HOME/bin && tar -xf vale_2.23.0_Linux_64-bit.tar.gz -C $HOME/bin
echo "$HOME/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -103,7 +102,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -r requirements-dev.txt -r requirements-visual.txt -e .
pip install -e '.[dev, visualization]'
- name: Run unit tests
run: make unit-test-coverage
- name: Report coverage to coveralls.io
Expand Down Expand Up @@ -146,7 +145,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -r requirements-dev.txt -r requirements-visual.txt -e .
pip install -e '.[dev, visualization]'
- name: Run integration tests
run: make integration-test
tests-finished:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -r requirements-dev.txt -e .
pip install -e .[dev]
- name: Run e2e tests
run: make e2e-test
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests-qiskit-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -r requirements-dev.txt -r requirements-visual.txt -e . git+https://github.com/Qiskit/qiskit.git
pip install -e '.[dev, visualization]' git+https://github.com/Qiskit/qiskit.git
- name: Run integration tests
run: make integration-test
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -r requirements-dev.txt -r requirements-visual.txt -e .
pip install -e '.[dev, visualization]'
- name: Run integration tests
run: make integration-test
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests-terra-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
python -m pip install --upgrade pip
# Installing the complete environment should happen in one `pip install` step,
# or pip will generally allow broken combinations of packages to be installed.
pip install -c constraints.txt -r requirements-dev.txt -r requirements-visual.txt -e . git+https://github.com/Qiskit/qiskit.git
pip install -e '.[dev, visualization]' git+https://github.com/Qiskit/qiskit.git
- name: Run tests
# running unit tests against latest (non-released) code of qiskit-terra gives a basic level
# of confidence that the integration between qiskit-ibm-runtime and qiskit-terra works
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,6 @@ Qconfig.py

# Generated release notes file
docs/release_notes.rst

# Version.txt
qiskit_ibm_runtime/VERSION.txt
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,31 @@ https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md
In addition to the general guidelines there are specific details for
contributing to qiskit-ibm-runtime, these are documented below.

### Installing from source

To install from source download this repository and follow the next steps.

- Create a virtual environment
``` {.bash}
$ python3 -m venv .venv
```
- Activate your virtual environment
``` {.bash}
$ source .venv/bin/activate
```
- Install the dependencies
``` {.bash}
$ pip install -e .
```
- Install the visualization dependencies
``` {.bash}
$ pip install -e ".[visualization]"
```
- Install the development dependencies
``` {.bash}
$ pip install -e ".[dev]"
```

### Open an issue

* For documentation issues relating to pages in the Start, Build, Transpile, Verify, Run, and Migration guides sections of https://docs.quantum.ibm.com, please open an issue in the [Qiskit/documentation repo](https://github.com/Qiskit/documentation/issues/new/choose) rather than the Qiskit/qiskit-ibm-runtime repo. In other words, any page that DOES NOT have `/api/` in the url should be addressed in the Qiskit/documentation repo. (Exception: the Migration guide urls contain `/api/` but are managed in the Qiskit/documentation repo.)
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
lint:
pylint -rn qiskit_ibm_runtime test
tools/verify_headers.py qiskit_ibm_runtime test
tools/verify_images.py

mypy:
mypy --module qiskit_ibm_runtime --package test

style:
black --check qiskit_ibm_runtime setup.py test
black --check qiskit_ibm_runtime test

unit-test:
python -m unittest discover --verbose --top-level-directory . --start-directory test/unit
Expand All @@ -40,4 +41,4 @@ unit-test-coverage:
coverage lcov

black:
black qiskit_ibm_runtime setup.py test
black qiskit_ibm_runtime test
10 changes: 0 additions & 10 deletions docs/_templates/autosummary/base.rst

This file was deleted.

15 changes: 8 additions & 7 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{% if referencefile %}
.. include:: {{ referencefile }}
{% endif %}
{#
We show all the class's methods and attributes on the same page. By default, we document
all methods, including those defined by parent classes.
-#}

{{ objname }}
{{ underline }}
{{ objname | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:no-members:
:no-inherited-members:
:no-special-members:
:show-inheritance:

{% block attributes_summary %}
{% if attributes %}
.. rubric:: Attributes
{% for item in all_attributes %}
{%- if not item.startswith('_') %}
.. autoattribute:: {{ name }}.{{ item }}
.. autoattribute:: {{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
Expand All @@ -28,7 +29,7 @@
.. rubric:: Methods
{% for item in all_methods %}
{%- if not item.startswith('_') or item in ['__call__', '__mul__', '__getitem__', '__len__'] %}
.. automethod:: {{ name }}.{{ item }}
.. automethod:: {{ item }}
{%- endif -%}
{%- endfor %}

Expand Down
6 changes: 3 additions & 3 deletions docs/apidocs/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. vale off
********************************
qiskit-ibm-runtime API reference
********************************
************************************
``qiskit-ibm-runtime`` API reference
************************************

.. toctree::
:maxdepth: 1
Expand Down
16 changes: 11 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
'sphinx.ext.intersphinx',
# This is used by qiskit/documentation to generate links to github.com.
"sphinx.ext.linkcode",
'jupyter_sphinx',
'sphinx_autodoc_typehints',
'nbsphinx',
'sphinxcontrib.katex',
'matplotlib.sphinxext.plot_directive',
Expand Down Expand Up @@ -83,10 +81,19 @@
# -----------------------------------------------------------------------------

autosummary_generate = True

autosummary_generate_overwrite = False
autoclass_content = "both"
autodoc_typehints = "description"
autodoc_default_options = {
'inherited-members': None,
"inherited-members": None,
"show-inheritance": True,
}
autodoc_type_aliases = {
"EstimatorPubLike": "EstimatorPubLike",
"SamplerPubLike": "SamplerPubLike",
}
napoleon_google_docstring = True
napoleon_numpy_docstring = False


# If true, figures, tables and code-blocks are automatically numbered if they
Expand Down Expand Up @@ -130,7 +137,6 @@

html_last_updated_fmt = '%Y/%m/%d'
html_sourcelink_suffix = ''
autoclass_content = 'both'


# ----------------------------------------------------------------------------------
Expand Down
Binary file added docs/source_images/twirling_strategy_options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 106 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools"]
requires = ["setuptools >= 40.6.0", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.black]
Expand Down Expand Up @@ -37,3 +37,108 @@ issue_format = "`{issue} <https://github.com/Qiskit/qiskit-ibm-runtime/pull/{iss
directory = "other"
name = "Other Notes"
showcontent = true

[tool.setuptools.packages.find]
exclude = ["test*"]

[tool.setuptools]
include-package-data = true
zip-safe = false

[tool.setuptools_scm]
root = "."
write_to = "qiskit_ibm_runtime/VERSION.txt"
version_scheme = "release-branch-semver"

[project]
name = "qiskit-ibm-runtime"
dynamic = [ "version" ]
description = "IBM Quantum client for Qiskit Runtime."
readme = {file = "README.txt", content-type = "text/markdown"}
authors = [
{name = "Qiskit Development Team", email="[email protected]"},
]
license = {text = "Apache 2.0"}
classifiers=[
"Environment :: Console",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]

keywords = ["qiskit", "sdk", "quantum", "api", "runtime", "ibm"]

requires-python=">=3.8"

dependencies = [
"requests>=2.19",
"requests-ntlm>=1.1.0",
"numpy>=1.13",
"urllib3>=1.21.1",
"python-dateutil>=2.8.0",
"websocket-client>=1.5.1",
"ibm-platform-services>=0.22.6",
"pydantic>=2.5.0,<2.10",
"qiskit>=1.1.0",
]

[project.entry-points."qiskit.transpiler.translation"]
ibm_backend = "qiskit_ibm_runtime.transpiler.plugin:IBMTranslationPlugin"
ibm_dynamic_circuits = "qiskit_ibm_runtime.transpiler.plugin:IBMDynamicTranslationPlugin"

[project.urls]
documentation = "https://docs.quantum.ibm.com/"
repository = "https://github.com/Qiskit/qiskit-ibm-runtime"
issues = "https://github.com/Qiskit/qiskit-ibm-runtime/issues"


[project.optional-dependencies]

common = [
"mypy==0.931",
"pylint==3.0.0",
"pproxy==2.7.8",
"nbqa==1.5.3",
"matplotlib>=2.1",
"jupyter",
"scipy>=1.0",
"nbformat>=4.4.0",
"nbconvert>=5.3.1",
"qiskit-aer>=0.14.2",
"websockets>=8",
"black~=24.1",
"coverage>=6.3",
"pylatexenc",
"scikit-learn",
"setuptools",
"ddt>=1.2.0,!=1.4.0,!=1.4.3",
]

documentation = [
"nbsphinx",
"Sphinx>=6",
"sphinx-automodapi",
"sphinx-autodoc-typehints<=1.19.2",
"jupyter-sphinx",
"sphinxcontrib-katex==0.9.9",
"packaging",
]

visualization = ["plotly>=5.23.0"]

dev = [
"qiskit-ibm-runtime[common]",
"qiskit-ibm-runtime[documentation]",
]


1 change: 0 additions & 1 deletion qiskit_ibm_runtime/VERSION.txt

This file was deleted.

1 change: 1 addition & 0 deletions qiskit_ibm_runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
=======
.. autosummary::
:toctree: ../stubs/
:nosignatures:
QiskitRuntimeService
Estimator
Expand Down
Loading

0 comments on commit fd66fa1

Please sign in to comment.