PennyLane-Qulacs Plugin
#######################
.. image:: https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-qulacs/tests.yml?branch=master&logo=github&style=flat-square
:alt: GitHub Workflow Status (branch)
:target: https://github.com/PennyLaneAI/pennylane-qulacs/actions?query=workflow%3ATests
.. image:: https://img.shields.io/codecov/c/github/PennyLaneAI/pennylane-qulacs/master.svg?logo=codecov&style=flat-square
:alt: Codecov coverage
:target: https://codecov.io/gh/PennyLaneAI/pennylane-qulacs
.. image:: https://img.shields.io/codefactor/grade/github/PennyLaneAI/pennylane-qulacs/master?logo=codefactor&style=flat-square
:alt: CodeFactor Grade
:target: https://www.codefactor.io/repository/github/pennylaneai/pennylane-qulacs
.. image:: https://readthedocs.com/projects/xanaduai-pennylane-qulacs/badge/?version=latest&style=flat-square
:alt: Read the Docs
:target: https://docs.pennylane.ai/projects/qulacs
.. image:: https://img.shields.io/pypi/v/PennyLane-qulacs.svg?style=flat-square
:alt: PyPI
:target: https://pypi.org/project/PennyLane-qulacs
.. image:: https://img.shields.io/pypi/pyversions/PennyLane-qulacs.svg?style=flat-square
:alt: PyPI - Python Version
:target: https://pypi.org/project/PennyLane-qulacs
.. header-start-inclusion-marker-do-not-remove
The PennyLane-Qulacs plugin integrates the Qulacs quantum computing framework with PennyLane's
quantum machine learning capabilities.
`PennyLane <https://docs.pennylane.ai>`__ is a cross-platform Python library for quantum machine
learning, automatic differentiation, and optimization of hybrid quantum-classical computations.
`Qulacs <https://github.com/qulacs>`__ is a software library for quantum computing, written in C++ and with GPU support.
.. header-end-inclusion-marker-do-not-remove
The plugin documentation can be found here: `<https://docs.pennylane.ai/projects/qulacs>`__.
Features
========
* Provides access to Qulacs' simulator backend via the ``qulacs.simulator`` device
* Support for all PennyLane core functionality
.. benchmarks-start-inclusion-marker-do-not-remove
Benchmarks
==========
We ran a 100 executions of 4 layer quantum neural
network `strongly entangling layer <https://docs.pennylane.ai/en/latest/code/api/pennylane.StronglyEntanglingLayers.html>`_
and compared the runtimes between CPU and GPU.
.. image:: https://raw.githubusercontent.com/soudy/pennylane-qulacs/master/images/qnn_cpu_vs_gpu.png
:align: center
:width: 60%
:target: javascript:void(0);
|
.. image:: https://raw.githubusercontent.com/soudy/pennylane-qulacs/master/images/qulacs_table.png
:align: center
:width: 60%
:target: javascript:void(0);
|
.. benchmarks-end-inclusion-marker-do-not-remove
.. installation-start-inclusion-marker-do-not-remove
Installation
============
This plugin requires Python version 3.10 or above, as well as PennyLane and
Qulacs. Installation of this plugin, as well as all dependencies, can be done
using ``pip``:
.. code-block:: bash
$ pip install pennylane-qulacs["cpu"]
Note that you need to include whether to install the CPU version
(``pennylane-qulacs["cpu"]``) or the GPU version (``pennylane-qulacs["gpu"]``)
of Qulacs for it to be installed correctly. Otherwise Qulacs will need to be
installed independently:
.. code-block:: bash
pip install qulacs pennylane-qulacs
Alternatively, you can install PennyLane-Qulacs from the `source code
<https://github.com/PennyLaneAI/pennylane-qulacs>`__ by navigating to the top
directory and running:
.. code-block:: bash
$ python setup.py install
.. note::
Qulacs supports parallelized executions via OpenMP. To set the number of
threads to use during simulations you need to update the environment
variable ``OMP_NUM_THREADS``. It can be set using the UNIX command:
``export OMP_NUM_THREADS = 8``
where 8 can be replaced by the number of threads that you wish to use. By
default Qulacs uses all available threads. To restore the default behaviour,
simply remove the environment variable. It can be done using the UNIX command:
``unset OMP_NUM_THREADS``
See the `OpenMP documentation page for OMP_NUM_THREADS
<https://www.openmp.org/spec-html/5.0/openmpse50.html>`__ or `here
<https://en.wikipedia.org/wiki/Environment_variable>`__ for more details on
how to use environment variables.
Dependencies
~~~~~~~~~~~~
PennyLane-Qulacs requires the following libraries be installed:
* `Python <http://python.org/>`__ >= 3.10
as well as the following Python packages:
* `PennyLane <http://docs.pennylane.ai/>`__ >= 0.9
* `Qulacs <https://docs.qulacs.org/en/latest/>`__ >= 0.1.9
If you currently do not have Python 3 installed, we recommend
`Anaconda for Python 3 <https://www.anaconda.com/download/>`__, a distributed version of Python packaged
for scientific computation.
Tests
~~~~~
To test that the PennyLane-Qulacs plugin is working correctly you can run
.. code-block:: bash
$ make test
in the source folder.
Documentation
~~~~~~~~~~~~~
To build the HTML documentation, go to the top-level directory and run:
.. code-block:: bash
$ make docs
The documentation can then be found in the ``doc/_build/html/`` directory.
.. installation-end-inclusion-marker-do-not-remove
Contributing
============
We welcome contributions - simply fork the repository of this plugin, and then make a
`pull request <https://help.github.com/articles/about-pull-requests/>`__ containing your contribution.
All contributers to this plugin will be listed as authors on the releases.
We also encourage bug reports, suggestions for new features and enhancements, and even links to cool projects
or applications built on PennyLane.
Authors
=======
PennyLane-Qulacs is the work of `many contributors <https://github.com/PennyLaneAI/pennylane-qulacs/graphs/contributors>`__.
If you are doing research using PennyLane and PennyLane-Qulacs, please cite `our paper <https://arxiv.org/abs/1811.04968>`__:
Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, M. Sohaib Alam, Shahnawaz Ahmed,
Juan Miguel Arrazola, Carsten Blank, Alain Delgado, Soran Jahangiri, Keri McKiernan, Johannes Jakob Meyer,
Zeyue Niu, Antal Száva, and Nathan Killoran.
*PennyLane: Automatic differentiation of hybrid quantum-classical computations.* 2018. arXiv:1811.04968
.. support-start-inclusion-marker-do-not-remove
Support
=======
- **Source Code:** https://github.com/PennyLaneAI/pennylane-qulacs
- **Issue Tracker:** https://github.com/PennyLaneAI/pennylane-qulacs/issues
- **PennyLane Forum:** https://discuss.pennylane.ai
If you are having issues, please let us know by posting the issue on our Github issue tracker, or
by asking a question in the forum.
.. support-end-inclusion-marker-do-not-remove
.. license-start-inclusion-marker-do-not-remove
License
=======
The PennyLane-Qulacs plugin is **free** and **open source**, released under
the `Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>`__.
.. license-end-inclusion-marker-do-not-remove
Raw data
{
"_id": null,
"home_page": "http://xanadu.ai",
"name": "pennylane-qulacs",
"maintainer": "Xanadu Inc.",
"docs_url": null,
"requires_python": null,
"maintainer_email": "software@xanadu.ai",
"keywords": null,
"author": null,
"author_email": null,
"download_url": null,
"platform": null,
"description": "PennyLane-Qulacs Plugin\n#######################\n\n\n.. image:: https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-qulacs/tests.yml?branch=master&logo=github&style=flat-square\n :alt: GitHub Workflow Status (branch)\n :target: https://github.com/PennyLaneAI/pennylane-qulacs/actions?query=workflow%3ATests\n\n.. image:: https://img.shields.io/codecov/c/github/PennyLaneAI/pennylane-qulacs/master.svg?logo=codecov&style=flat-square\n :alt: Codecov coverage\n :target: https://codecov.io/gh/PennyLaneAI/pennylane-qulacs\n\n.. image:: https://img.shields.io/codefactor/grade/github/PennyLaneAI/pennylane-qulacs/master?logo=codefactor&style=flat-square\n :alt: CodeFactor Grade\n :target: https://www.codefactor.io/repository/github/pennylaneai/pennylane-qulacs\n\n.. image:: https://readthedocs.com/projects/xanaduai-pennylane-qulacs/badge/?version=latest&style=flat-square\n :alt: Read the Docs\n :target: https://docs.pennylane.ai/projects/qulacs\n\n.. image:: https://img.shields.io/pypi/v/PennyLane-qulacs.svg?style=flat-square\n :alt: PyPI\n :target: https://pypi.org/project/PennyLane-qulacs\n\n.. image:: https://img.shields.io/pypi/pyversions/PennyLane-qulacs.svg?style=flat-square\n :alt: PyPI - Python Version\n :target: https://pypi.org/project/PennyLane-qulacs\n\n.. header-start-inclusion-marker-do-not-remove\n\nThe PennyLane-Qulacs plugin integrates the Qulacs quantum computing framework with PennyLane's\nquantum machine learning capabilities.\n\n`PennyLane <https://docs.pennylane.ai>`__ is a cross-platform Python library for quantum machine\nlearning, automatic differentiation, and optimization of hybrid quantum-classical computations.\n\n`Qulacs <https://github.com/qulacs>`__ is a software library for quantum computing, written in C++ and with GPU support.\n\n.. header-end-inclusion-marker-do-not-remove\n\nThe plugin documentation can be found here: `<https://docs.pennylane.ai/projects/qulacs>`__.\n\nFeatures\n========\n\n* Provides access to Qulacs' simulator backend via the ``qulacs.simulator`` device\n\n* Support for all PennyLane core functionality\n\n.. benchmarks-start-inclusion-marker-do-not-remove\n\nBenchmarks\n==========\n\nWe ran a 100 executions of 4 layer quantum neural\nnetwork `strongly entangling layer <https://docs.pennylane.ai/en/latest/code/api/pennylane.StronglyEntanglingLayers.html>`_\nand compared the runtimes between CPU and GPU.\n\n.. image:: https://raw.githubusercontent.com/soudy/pennylane-qulacs/master/images/qnn_cpu_vs_gpu.png\n :align: center\n :width: 60%\n :target: javascript:void(0);\n\n|\n\n.. image:: https://raw.githubusercontent.com/soudy/pennylane-qulacs/master/images/qulacs_table.png\n :align: center\n :width: 60%\n :target: javascript:void(0);\n\n|\n\n\n.. benchmarks-end-inclusion-marker-do-not-remove\n\n\n.. installation-start-inclusion-marker-do-not-remove\n\nInstallation\n============\n\nThis plugin requires Python version 3.10 or above, as well as PennyLane and\nQulacs. Installation of this plugin, as well as all dependencies, can be done\nusing ``pip``:\n\n.. code-block:: bash\n\n $ pip install pennylane-qulacs[\"cpu\"]\n\nNote that you need to include whether to install the CPU version\n(``pennylane-qulacs[\"cpu\"]``) or the GPU version (``pennylane-qulacs[\"gpu\"]``)\nof Qulacs for it to be installed correctly. Otherwise Qulacs will need to be\ninstalled independently:\n\n.. code-block:: bash\n\n pip install qulacs pennylane-qulacs\n\nAlternatively, you can install PennyLane-Qulacs from the `source code\n<https://github.com/PennyLaneAI/pennylane-qulacs>`__ by navigating to the top\ndirectory and running:\n\n.. code-block:: bash\n\n $ python setup.py install\n\n.. note::\n\n Qulacs supports parallelized executions via OpenMP. To set the number of\n threads to use during simulations you need to update the environment\n variable ``OMP_NUM_THREADS``. It can be set using the UNIX command:\n\n ``export OMP_NUM_THREADS = 8``\n\n where 8 can be replaced by the number of threads that you wish to use. By\n default Qulacs uses all available threads. To restore the default behaviour,\n simply remove the environment variable. It can be done using the UNIX command:\n\n ``unset OMP_NUM_THREADS``\n\n See the `OpenMP documentation page for OMP_NUM_THREADS\n <https://www.openmp.org/spec-html/5.0/openmpse50.html>`__ or `here\n <https://en.wikipedia.org/wiki/Environment_variable>`__ for more details on\n how to use environment variables.\n\nDependencies\n~~~~~~~~~~~~\n\nPennyLane-Qulacs requires the following libraries be installed:\n\n* `Python <http://python.org/>`__ >= 3.10\n\nas well as the following Python packages:\n\n* `PennyLane <http://docs.pennylane.ai/>`__ >= 0.9\n* `Qulacs <https://docs.qulacs.org/en/latest/>`__ >= 0.1.9\n\n\nIf you currently do not have Python 3 installed, we recommend\n`Anaconda for Python 3 <https://www.anaconda.com/download/>`__, a distributed version of Python packaged\nfor scientific computation.\n\n\nTests\n~~~~~\n\nTo test that the PennyLane-Qulacs plugin is working correctly you can run\n\n.. code-block:: bash\n\n $ make test\n\nin the source folder.\n\nDocumentation\n~~~~~~~~~~~~~\n\nTo build the HTML documentation, go to the top-level directory and run:\n\n.. code-block:: bash\n\n $ make docs\n\n\nThe documentation can then be found in the ``doc/_build/html/`` directory.\n\n.. installation-end-inclusion-marker-do-not-remove\n\nContributing\n============\n\nWe welcome contributions - simply fork the repository of this plugin, and then make a\n`pull request <https://help.github.com/articles/about-pull-requests/>`__ containing your contribution.\nAll contributers to this plugin will be listed as authors on the releases.\n\nWe also encourage bug reports, suggestions for new features and enhancements, and even links to cool projects\nor applications built on PennyLane.\n\nAuthors\n=======\n\nPennyLane-Qulacs is the work of `many contributors <https://github.com/PennyLaneAI/pennylane-qulacs/graphs/contributors>`__.\n\nIf you are doing research using PennyLane and PennyLane-Qulacs, please cite `our paper <https://arxiv.org/abs/1811.04968>`__:\n\n Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, M. Sohaib Alam, Shahnawaz Ahmed,\n Juan Miguel Arrazola, Carsten Blank, Alain Delgado, Soran Jahangiri, Keri McKiernan, Johannes Jakob Meyer,\n Zeyue Niu, Antal Sz\u00e1va, and Nathan Killoran.\n *PennyLane: Automatic differentiation of hybrid quantum-classical computations.* 2018. arXiv:1811.04968\n\n.. support-start-inclusion-marker-do-not-remove\n\nSupport\n=======\n\n- **Source Code:** https://github.com/PennyLaneAI/pennylane-qulacs\n- **Issue Tracker:** https://github.com/PennyLaneAI/pennylane-qulacs/issues\n- **PennyLane Forum:** https://discuss.pennylane.ai\n\nIf you are having issues, please let us know by posting the issue on our Github issue tracker, or\nby asking a question in the forum.\n\n.. support-end-inclusion-marker-do-not-remove\n.. license-start-inclusion-marker-do-not-remove\n\nLicense\n=======\n\nThe PennyLane-Qulacs plugin is **free** and **open source**, released under\nthe `Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>`__.\n\n.. license-end-inclusion-marker-do-not-remove\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "PennyLane plugin for Qulacs.",
"version": "0.40.0",
"project_urls": {
"Homepage": "http://xanadu.ai"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eaaddb770867dfa01a94ed70a5fd1bc89e261fc844c185a0841cfaaa00654625",
"md5": "4458525d6b2667bd5b1be5c8d7e721c1",
"sha256": "056341c8877034a32939657ca0b3d746fb8fce5813c61b5377a86d661d0e3959"
},
"downloads": -1,
"filename": "pennylane_qulacs-0.40.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4458525d6b2667bd5b1be5c8d7e721c1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 13987,
"upload_time": "2025-01-14T22:06:27",
"upload_time_iso_8601": "2025-01-14T22:06:27.655488Z",
"url": "https://files.pythonhosted.org/packages/ea/ad/db770867dfa01a94ed70a5fd1bc89e261fc844c185a0841cfaaa00654625/pennylane_qulacs-0.40.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-14 22:06:27",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pennylane-qulacs"
}