Installing#
Basic installation#
The most up-to-date version of PyQBench can be installed from PyPI:
pip install pyqbench
This installs qbench
library, as well as the CLI tool. To verify that the install suceeded,
you can check if the package is importable and the CLI tool is visible in your path.
python -c "import qbench" # Should silently pass
qbench -h # Should produce help message
Development installation#
If you want to contribute to PyQBench, clone the repository and install the package in development mode. The example below clones repository via SSH and installs the package.
git clone git@github.com:iitis/PyQBench.git
pip install -e PyQBench
Installing extra dependencies#
When developing PyQBench, you most likely want to install dependencies needed for running tests, assisting you in following style guidelines and building documentation. To this end, PyQBench defines the following extras:
test
: dependencies needed for running testsdev
: development tools (e.g. linters)docs
: tools needed for building the documentation
Extras can be installed, as usually, by passing them in square brackets to pip install
command.
The extras can be mixed and matched (although you probably want to install all of them).
As an illustration, example below installs the cloned repository with test
and dev
extras:
pip install -e PyQBench[test,dev]
Installing pre-commit hook#
PyQBench provides a pre-commit configuration matching the one used in our CI. The hooks run linters and static analysis tools, allowing you to catch any typing errors, common mistakes and verify inconsistencies in your code style before pushing the code to the repository (or its fork).
To use the hooks, first install pre-commit:
pip install pre-commit
And then install the hooks:
pre-commit install
List and explanation of the dependencies#
This section discusses dependencies used by PyQBench and their role in the project. Please note that transitive dependencies are not included in the list.
Mandatory dependencies#
qiskit
: used for constructing quantum circuits and interfacing with quantum devicesamazon-braket-sdk
andqiskit-braket-provider
: used for interacting with Amazon Braket devicesmthree
: used for readout error mitigationnumpy
andscipy
: basic libraries for numerical calculationstqdm
: used for rendering progress bars in CLIpyaml
andpydantic
: for reading/writing input/output files in the CLI, and validating their contentspandas
: used for outputting final CSV file with discrimination probabilities
Test dependencies#
pytest
: used for defining and running testspytest-cov
: used with pytest for obtaining test-coverage
Development dependencies#
flake8
: used for linting codeblack
: used for formatting code in a consistent wayisort
: used for consistently sorting imoprtsmypy
: used for static analysis of type hints
Docs dependencies#
sphinx
: framework used for building this documentationpydata-sphinx-theme
: theme of this documentationmyst-parser
: used to allow Markdown instead of ReST in the docs