The goal of this project is to design an alternative way for anyone interested in quantum computing to experience quantum state evolution through music.
quantum-music as a pip-installable package: https://test.pypi.org/project/quantum-music/.
- Intuitive user interface via Jupyter Notebooks
- Optional tutorial with an overview of Quantum Computing
- Example circuits/audio
- Playground to generate your own audio
The project is driven through Jupyter Notebooks. If you haven't use Jupyter Notebooks before, here is an overview of what it is and how to run them from the documentation.
Once you are able to run Jupyter Notebooks on your system, you can start running the notebooks in the repository.
Notebooks/: code of our learning on Qiskit and audio in a Jupyter NotebookQuantum-Music/: the Python package for users to use. Note that everything in this directory will be available to the public!
First create a Python virtual environment. On Unix/Mac OS, run:
cd ~/
python3 -m venv quantum-music-venv
source quantum-music-venv/bin/activate
When developing/using quantum-music, activate the virtual environment:
source ~/quantum-music-venv/bin/activate
When the virtual environment is activated, your terminal should display the environment name:
(quantum-music-venv) user@machine ~ %
To install the quantum-music package locally, go to Quantum-Music/ in this repository, then run:
pip install -e .
This will also install other Python packages that are required for quantum-music to run. This will install the state of the code as is in the repository. Code can be edited directly in this repository and the changes will be reflected when the Python interpreter (or Jupyter notebook kernel) is restarted.
Once installed, the functions in quantum-music can be imported and directly called:
from quantum_music.circuit_functions import get_phases, get_amplitudes
Note that in Python code quantum_music (note the underscore _ in the name) should be used, but when installing the package use the name quantum-music (with a hyphen -).
Install in Quantum Lab
Install the latest published version in the Jupyter notebook:
! pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple quantum-music
When our Python package is uploaded to Test PyPI, the package can be used locally or in Quantum Lab. First you need an account on Test PyPI then create an API token. You should also setup your PyPI credentials (.pypirc file) locally to automatically use your token. See How can I use API tokens to authenticate with PyPI?.
The official documentation for packaging Python projects can be viewed at https://packaging.python.org/tutorials/packaging-projects/.
- Update the version number in
setup.cfg(use semantic versioning):
[metadata]
name = quantum-music
version = # Update the version on this line, for example: 0.2.0
author = SuperComposers
- Commit and push the version number change to Git
- In Github (through the web browser), go to
releasesand then go toDraft a new release. - In
Tag versionfield and theRelease Titlefield, use the same version from Step 1 but prefix the version withv. For example, if the version is0.2.0, then in theTag versionandRelease Titlefield, type inv0.2.0. - Then click
Publish Release. - In the terminal, go to the local copy of this repository, then run
git fetch --all. The new Git tag for the version (for example,v0.2.0) would be pulled in. - Checkout the the version tag (for example, for
v0.2.0):
git checkout v0.2.0
- Create a source distribution of the package:
cd Quantum-Music
python setup.py sdist
- Upload to Test PyPI:
twine upload --repository testpypi dist/*