Code Monkey home page Code Monkey logo

quantum-music's Introduction

Quantum Music Project

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/.

Features

  • Intuitive user interface via Jupyter Notebooks
  • Optional tutorial with an overview of Quantum Computing
  • Example circuits/audio
  • Playground to generate your own audio

How To

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.

Directory Structure

  • Notebooks/: code of our learning on Qiskit and audio in a Jupyter Notebook
  • Quantum-Music/: the Python package for users to use. Note that everything in this directory will be available to the public!

Quantum-Music Installation

Install locally from this repository

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

Publish to Test PyPI

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/.

  1. 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
  1. Commit and push the version number change to Git
  2. In Github (through the web browser), go to releases and then go to Draft a new release.
  3. In Tag version field and the Release Title field, use the same version from Step 1 but prefix the version with v. For example, if the version is 0.2.0, then in the Tag version and Release Title field, type in v0.2.0.
  4. Then click Publish Release.
  5. 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.
  6. Checkout the the version tag (for example, for v0.2.0):
git checkout v0.2.0
  1. Create a source distribution of the package:
cd Quantum-Music
python setup.py sdist
  1. Upload to Test PyPI:
twine upload --repository testpypi dist/*

quantum-music's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.