Package: pennylane-quantuminspire
The PennyLane-QuantumInspire plugin integrates the Quantum Inspire quantum computing backends
with PennyLane’s quantum machine learning capabilities.PennyLaneis a cross-platform Python library for quantum machine
learning, automatic differentiation, and optimization of hybrid quantum-classical computations.Quantum Inspireis a platform for quantum computing developed by QuTech.This plugin relies heavily on the software development kit(SDK) for the Quantum Inspire platformand thePennyLane-Qiskit Plugin for Qiskit.Qiskitis an open-source framework for quantum computing.The Quantum Inspire device is build on top of the Qiskit device. The Quantum Inspire SDK registers a Quantum Inspire
backend to Qiskit to run the algorithms on. This way we combine the strengths and ease of use of the Qiskit plugin
with the computing power of Quantum Inspire backends.FeaturesGrants access to Quantum Inspire’s cloud quantumemulatorsandhardware backends.Emulator backends:"QXsingle-nodesimulator"- Quantum Inspire emulator run on a commodity cloud-based server, with 4GB RAM. It has a fast turn-around time for simulations up to 26 qubits. For basic users, the commodity cloud-based server will be sufficient."QX-34-L"- Quantum Inspire emulator runs on the Lisa cluster computer uses four nodes of the fat_soil_shared partition of Lisa. With 1.5TB of memory each, this allows simulation jobs of up to 34 qubits [requires advanced account].Hardware backends:"Spin-2"- Quantum Inspire quantum 2-qubit semiconductor electron spin processor."Starmon-5"- Quantum Inspire quantum 5-qubit superconductor Transmon processor.InstallationThis plugin requires Python version 3.8 and above, as well as PennyLane-Qiskit. Installation of the dependencies can
be done usingpip:pipinstallpennylane-quantuminspireTo 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:gitclonehttps://github.com/QuTech-Delft/pennylane-quantuminspire.gitcdpennylane-quantuminspirepipinstall-epluginpathwherepluginpathis 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:fromquantuminspire.credentialsimportsave_accountsave_account('YOUR_API_TOKEN')After callingsave_account(), your credentials will be stored on disk.
Those who do not want to save their credentials to disk should use instead:fromquantuminspire.credentialsimportenable_accountenable_account('YOUR_API_TOKEN')and the token will only be active for the session.After callingsave_account()once orenable_account()within your session, token authentication is done
automatically.More information on different accounts can be foundhere.Installing for generating documentationTo install the necessary packages to perform documentation activities for this plugin do:pipinstall-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
toPandocand follow the instructions found there to install pandoc.
To build thereadthedocsdocumentation do:cddocmakehtmlThe documentation can then be found in the ‘doc/_build/html’ directory.Installing for running testsMake sure to install test dependencies first:pipinstall-e.[dev]Unit testsRun the unit tests using:pytesttests/unit_testor including coverage:pytesttests/unit_test--cov=pennylane_quantuminspire--cov-report=term-missing--cov-report=xml-pno:warnings--tb=nativeDevice testsRun the device tests using:pytestGetting startedOnce the PennyLane-QuantumInspire plugin is installed, the provided Quantum Inspire device can be accessed straight
away in PennyLane.The Quantum Inspire device can be instantiated with aQXsingle-nodesimulatorbackend as follows:importpennylaneasqmldev=qml.device('quantuminspire.qi',wires=2,backend='QX single-node simulator')This device can then be used just like other devices for the definition and evaluation of QNodes within the
PennyLane framework.Inspecting results of computations in Quantum InspireWhen a computation has run on a Quantum Inspire backend the algorithm that was executed and the results can be
inspected in Quantum Inspire.
When algorithms are run on a backend of the Quantum Inspire device, all the executed algorithms are contained in a
single Quantum Inspire project.
After logging in to theQuantum Inspire platforman overview is given of the
available projects. By opening your project the backend that computed the results is displayed. Navigating toResultsshow the computation results for each algorithm. Also the algorithms code can be inspected here.
The project name that is used by the plugin can be passed as a separate argumentprojectto the Quantum
Inspire device constructor. For example:dev=qml.device('quantuminspire.qi',wires=4,project='My project name')When no project name is given the project name defaults to:'PennyLane project2023-02-2716:32:38', where the last
parts of the project name are replaced by the current date and local time.
More information about working with Quantum Inspire can be found atQuantum Inspire Quick Guide. Specific information about
managing projects can be found atManaging your projects.SupportSource Code:https://github.com/QuTech-Delft/pennylane-quantuminspireIssue Tracker:https://github.com/QuTech-Delft/pennylane-quantuminspire/issuesQuantum Inspire:https://www.quantum-inspire.com/contactIf you are having issues, please let us know by posting the issue on our Github issue tracker. For questions about
Quantum Inspire see the contact info on the Quantum Inspire website.LicenseThe PennyLane QuantumInspire plugin isfreeandopen source, released under
theApache License, Version 2.0.