Installation¶
This plugin requires Python version 3.9 and above, as well as PennyLane-Qiskit. Installation of the dependencies can
be done using pip
:
pip install pennylane-quantuminspire
To ensure your device is working as expected, you can also install the development version from source by cloning this repository and running a pip install command in the root directory of the repository:
git clone https://github.com/QuTech-Delft/pennylane-quantuminspire.git
cd pennylane-quantuminspire
pip install -e pluginpath
where pluginpath
is the location of the plugin. It will then be accessible via PennyLane.
Furthermore, the plugin assumes Quantum Inspire credentials are stored on your disk in the default location. A token can be set using the following steps:
Create a Quantum Inspire account if you do not already have one.
Get an API token from the Quantum Inspire website.
With your API token run:
from quantuminspire.credentials import save_account
save_account('YOUR_API_TOKEN')
After calling save_account()
, your credentials will be stored on disk.
Those who do not want to save their credentials to disk should use instead:
from quantuminspire.credentials import enable_account
enable_account('YOUR_API_TOKEN')
and the token will only be active for the session.
After calling save_account()
once or enable_account()
within your session, token authentication is done
automatically.
More information on different accounts can be found here.
Installing for generating documentation¶
To install the necessary packages to perform documentation activities for this plugin do:
pip install -e .[rtd]
The documentation generation process is dependent on pandoc. When you want to generate the documentation and pandoc is not yet installed on your system navigate to Pandoc and follow the instructions found there to install pandoc. To build the readthedocs documentation do:
cd doc
make html
The documentation can then be found in the ‘doc/_build/html
’ directory.
Installing for running tests¶
Make sure to install test dependencies first:
pip install -e .[dev]
Unit tests¶
Run the unit tests using:
pytest tests/unit_test
or including coverage:
pytest tests/unit_test --cov=pennylane_quantuminspire --cov-report=term-missing --cov-report=xml -p no:warnings --tb=native
Device tests¶
Run the device tests using:
pytest