Skip to main content

quantumaudio: A Python class implementation for Quantum Representations of Audio in Qiskit. Developed by the quantum computer music team at the Interdisciplinary Centre for Computer Music Research, University of Plymouth, UK

Project description

quantumaudio

Quantumaudio Module: A Python package for Quantum Representations of Audio in qubit systems & examples

PyPI Read the Docs (version) GitHub

quantumaudio is a Python module with class implementations for building quantum circuits that encode and decode audio signals as quantum states. This is primarily aimed for quantum computing simulators, but it might also run on real quantum hardware. The main objective is to have a readily available tools for using quantum representations of audio in artistic contexts and for studying future Quantum Signal Processing algorithms for audio.

This package contains class implementations for generating quantum circuits from audio signals, as well as necessary pre and post processing functions.

It contatins implementations for three representation algorithms cited on the publication above, namely:

  • QPAM - Quantum Probability Amplitude Modulation (Simple quantum superposition or "Amplitude Encoding")
  • SQPAM - Single-Qubit Probability Amplitude Modulation (similar to FRQI quantum image representations)
  • QSM - Quantum State Modulation (also known as FRQA in the literature)

For an introduction to quantum audio please refer to the book chapter Quantum Representations of Sound: From Mechanical Waves to Quantum Circuits by Paulo V. Itaboraí and Eduardo R. Miranda. The chapter also discusses QPAM, SQPAM and QSM, and glances over methods to implement quantum audio signal processing.

There is a Jupyter Notebook tutorial showing how the main methods work and general implementation workflow with the package. Additionally, to listen the results, there is a set of examples for interfacing the quantum circuits with SuperCollider, a powerful synthesis engine for live musical applications.

Dependencies

The quantumaudio package alone has the following dependencies:

  • qiskit (the quantum programming framework)
  • numpy
  • matplotlib
  • bitstring (for decoding purposes)
  • ipython (for listening purposes inside jupyter notebooks)

For running the supercollider examples, additional packages are needed:

Installation

This python module is distributed as a package in PyPi. It can be installed in any operating system by using pip in a console or terminal:

  • Windows
pip install quantumaudio
  • Mac & Linux
pip3 install quantumaudio

Optionally, you can download the latest release, which also contains the examples and tutorial notebooks.

It is possible to install the additional python dependencies for running the supercollider examples automatically, by running the installation command with the [examples] optional dependencies:

  • Windows
pip install quantumaudio[examples]
  • Mac & Linux
pip3 install quantumaudio[examples]

Ideally, you would pip install the package in your own python environment and then download the latest example/tutorial files from the releases page.

NOTE

There is a known bug when installing pyliblo packages through pip install quantumaudio[examples] in some systems. A temporary workaround is shown here.

Usage

To learn how to use this module, refer to the tutorial notebook.

Both the tutorial and supercollider examples were written as Jupyter Notebooks that can be read inside this repo, or run in your local Jupyter Notebook server.

Feedback and Getting help

Please open a new issue, to help improve the code. They are most welcome.

You may gain insight by learning more about Qiskit and SuperCollider. We also strongly reccomend the reading of the Quantum Representations of Sound book chapter for a better understanding of quantum representations of audio.

API Reference

Most methods and functions in the module contain docstrings for better understanding the implementation. This API documentation is available and readable here.

Contributing

Clone/Fork this repo and help contributing to the code! Pull Requests are very welcome. You can also contact the main author to exchange ideas (highly reccomended). Make sure to install the [dev] and [doc] optional dependencies for running necessary pytests.

Acknowledgements

This repo was created by the quantum computer music team at the Interdisciplinary Centre for Computer Music Research (ICCMR), University of Plymouth, UK. Paulo Itaboraí is the lead developer.

See also the QuTune Project repository for other resources developed by the ICCMR group.

quantumaudio has an MIT license. If you use this code in your research or art, please cite it according to the citation file.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantumaudio-0.0.2rc1.tar.gz (5.0 MB view hashes)

Uploaded Source

Built Distribution

quantumaudio-0.0.2rc1-py3-none-any.whl (14.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page