soc-qasm
A simple Websockets Python interface for executing Qasm code.
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.5%) to scientific vocabulary
Repository
A simple Websockets Python interface for executing Qasm code.
Basic Info
- Host: GitHub
- Owner: iccmr-quantum
- License: mit
- Language: Max
- Default Branch: main
- Size: 76.2 KB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 2
- Releases: 0
Metadata Files
README.md
SOC-Qasm
A spinoff of OSC-Qasm. A simple Socket.io Python interface for executing Qasm code.
Control your soc_qasm.py module directly from the web browser.
Installation
Before starting, make sure you have Python 3.7+ in your system.
- when using the installer on windows make sure to select the option Add Python X to PATH
In order to try our Max patches, make sure you also have Max installed, and The QAC Toolkit Max package available.
Clone or download and unzip this repo.
Open the Terminal (Mac) or Command Prompt (Windows) and navigate to the folder where you saved the repo. - see here a refresher on how to navigate using the terminal [1][2]
Create a python virtual environment
- on the terminal, type: python3 -m venv SOCQasm
- depending on your system, you may simply use: python -m venv SOCQasm
Enter your new python virtual environment
- on mac: source SOCQasm/bin/activate
- on windows: SOCQasm\Scripts\activate
At the start of your terminal prompt, it should show (SOCQasm), indicating that you're in your new virtual environment.
Update pip and setuptools
- pip install --upgrade pip setuptools
- Note: if for some reason you don't have pip, please install it
Install qiskit and python-osc
- pip install qiskit python-socketio eventlet
Running
First, open a Terminal (Mac) or Command Prompt (Windows) and start you python environment.
Then run the python module: python soc_qasm.py
Wait until the program outputs the following lines:
```console
SOC_QASM by OCH @ QuTune (v1.x)
https://iccmr-quantum.github.io
(xxxxx) wsgi starting up on http://0.0.0.0:PPPP
``
Now you can open the [soc_qasm.maxpat](soc_qasm-Max/soc_qasm.maxpat) in Max 8 and start sending messages with QuantumCircuits in Qasm, to the SOC-Qasm python module. Note: the first time you open [soc_qasm.maxpat](soc_qasm-Max/soc_qasm.maxpat) you might need to install the nodejs dependencies by clicking thescript npm installmessage box on the right side. Use thestart/stop client` toggle on the left side to enable the node.script object before sending any qasm code.
You can also experiment interacting with your socqasm.py instance using a web browser. Open this page for an example. You will notice that, independently of where this page is being hosted, it can still connect with your local socqasm.py. The source code for this page can be found in docs/index.html.
When you're done working with soc_qasm.py you can leave the virtual environment with
- on mac & windows: deactivate
Additional arguments
You can also set some additional arguments and flags in front of python soc_qasm.py:
```console usage: soc_qasm.py [-h] [--token TOKEN] [--hub HUB] [--group GROUP] [--project PROJECT] [port]
positional arguments: port The port where the soc_qasm.py Server will listen for incoming messages. Default port is 5000
optional arguments: -h, --help show this help message and exit --token TOKEN If you want to run circuits on real quantum hardware, you need to provide your IBMQ token (see https://quantum- computing.ibm.com/account) --hub HUB If you want to run circuits on real quantum hardware, you need to provide your IBMQ Hub --group GROUP If you want to run circuits on real quantum hardware, you need to provide your IBMQ Group --project PROJECT If you want to run circuits on real quantum hardware, you need to provide your IBMQ Project ```
The soc_qasm.maxpat patch also allows some customization using positional arguments. Make sure to check out the p More-options subpatch to learn more!
Note
In order to access your soc_qasm.py instance from outside your local area network, you might need to either open the corresponding ports on your router (port forwarding), or use a vpn service like hamachi.
<!--
-->
Feedback and Getting help
Please open a new issue.
Also, please consider learning more about Max here, and Qiskit here, as well as explore the Intro to Quantum Computer Music Tutorial (video recording here) and the other projects in QuTune's Github.
Acknowledgements
SOC-Qasm is a spinoff of OSC-Qasm which is inspired by Jack Woehr's Qisjob project, and the och.qisjob object.
This repo was created by Omar Costa Hamido as part of the QuTune Project.
Owner
- Name: QuTune Project
- Login: iccmr-quantum
- Kind: user
- Location: Plymouth, UK
- Company: ICCMR
- Website: https://iccmr-quantum.github.io/
- Repositories: 15
- Profile: https://github.com/iccmr-quantum
The QuTune project is aimed at creating open-source resources for making music with quantum computing and making quantum computing with music.
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Hamido" given-names: "Omar Costa" orcid: "https://orcid.org/0000-0001-5077-853X" title: "SOC-Qasm" version: 1.0.4 doi: 10.5281/zenodo.6640160 date-released: 2022-06-13 url: "https://github.com/Quantumland-art/SOC-Qasm"
GitHub Events
Total
Last Year
Dependencies
- @socket.io/base64-arraybuffer 1.0.2
- @socket.io/component-emitter 3.0.0
- backo2 1.0.2
- debug 4.3.3
- engine.io-client 6.1.1
- engine.io-parser 5.0.3
- has-cors 1.1.0
- ms 2.1.2
- parseqs 0.0.6
- parseuri 0.0.6
- socket.io-client 4.4.1
- socket.io-parser 4.1.2
- ws 8.2.3
- xmlhttprequest-ssl 2.0.0
- yeast 0.1.2
- socket.io-client ^4.4.1