- Notifications
You must be signed in to change notification settings - Fork0
⚛ Quantum Computing, for Humans.
License
qbitkit/qbitkit
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
⚛qbitkit
Docs
qbitkit
is a set of high-level abstractions to make writing software for quantum computers easier.Gates are defined using a Pandas DataFrame that can be automatically translated to your platform of choice.Once you've translated a DataFrame to your platform of choice, for example AWS Braket or IBMQ, all you have to do is run it and check the results.All of this, in just 3 lines of code (not counting import statements, comments, whitespace lines, or printing results.)
Here we make a Bell State and submit it to the Rigetti Aspen-9 Superconducting Quantum Computer on AWS Braket.You can changeget_qpu_arn
toget_sim_arn
and clear the existing parameters if you want a simulator available 24/7, or switch outrigetti
andAspen-9
withionq
andionQdevice
to use high Quantum Volume, extremely low gate error ion trapping quantum. Welcome to the future.
# Import relevant qbitkit Librariesfromqbitkit.provider.braket.circuitimportcircuitryascfromqbitkit.provider.braketimportprovideraspfromqbitkit.io.frameimportFrameasf# Define your DataFrame as a circuit, then translate it to your platform of choice.circuit=c.Translate.df_circuit(df=f.get_frame(data={'gate': ['h','cnot'],'targetA': [0,0],'targetB': [None,1],}))# Run the circuit on the Rigetti Aspen-9 hosted on AWS Braketjob=p.Job.get_job(device=p.QuantumDevice.get_device(p.QuantumDevice.get_qpu_arn(# Pick the Aspen-9 Quantum Computer by Rigetti as our QPU (IonQ works too!)vendor='rigetti',device='Aspen-9')),circuit=circuit,s3loc=p.Connection.get_bucket(# Use the name of the bucket created at Braket onboarding.# You can always check your S3 Console to find this info.bucket='amazon-braket-YourID'),# Warning: Running this will cost a little under $4.shots=10000)# Show all of the resultsprint(job.result())
For the time being, documentation is hosted at:
The following versions of Python are supported:
- 🐍 Python 3.7
- 🐍 Python 3.8
- 🐍 Python 3.9
Support is continually tested upon every commit to branch 'origin' for each Python version listed above.
- Download Anaconda3:
- Clickthis link to download Anaconda3 from the official page for Anaconda Individual Edition
- After downloading and installing, open
Anaconda Prompt
and type:
conda create -n qbitkit
(hit enter)conda activate qbitkit
(hit enter)conda install -y pip
(hit enter)
- If you are using Mac or Linux, skip this step. If you are using Windows, install Git for Windows:
- Download Git for Windows from git-scm.org usingthis link
- Open the installer, complete the installation.
- Reminder: paths listed below, for example
venv/bin/activate
work for Mac and Linux, but on Windows you must change any/
to\
before running a commandunless that/
is in a URL, in which case leave it alone. Consider installing Debian alongside or in place of Windows if this bothers you.
- Make sure
pip
is up-to-date, then install usingpip
:
pip install -U pip
pip install -U qbitkit
- Locally clone
qbitkit
,cd
into the directory we just cloned it into:
git clone https://github.com/brianlechthaler/qbitkit.git
cd qbitkit
- Update
pip
, installvirtualenv
, create a virtual environment, then activate it:
pip install -U pip
pip install -U virtualenv
- Mac and Linux:
. venv/bin/activate
- Using Windows:
. venv\bin\activate
- Install Dependencies:
pip install -Ur requirements.txt
- Build and Install with
setup.py
:
python setup.py build
python setup.py install
- Make sure you have
pip
andvirtualenv
installed, for example on Debian-based systems you can useapt-get
andpip
as root:
sudo apt-get install -qq -y python3-pip && sudo -H pip3 install -U pip && sudo -H pip3 install -U virtualenv
- To make sure you're using the right
pip
from the rightpython
, you shouldrun this command before running subsequent commands:
alias 'pip=python3 -m pip'
- You may need
git
if it isn't yet installed, for example on Debian-based systems:
sudo apt-get install -qq -y git
- Change directory into qbitkit/bin
cd bin
- Run script
/bin/sh install.sh
- Make sure
pip
is up-to-date, then installqbitkit
:
- with root, system install:
sudo -H pip install -U qbitkit
- without root, user install:
pip install --user -U qbitkit
- Clone
qbitkit
locally, thencd
to the directory you just cloned:
git clone https://github.com/qbitkit/qbitkit.git
cd qbitkit
- Create a virtual environment, then activate it:
virtualenv --python=python3 venv && . venv/bin/activate
- Install requirements, then use
setup.py
to buildqbitkit
then installqbitkit
into the virtualenv:
pip install -r requirements.txt && python setup.py build && python setup.py install
- With such a diverse range of quantum hardware and cloud services providing that hardware to end users, having to rewrite the same circuits 2-3 times is not uncommon. With
qbitkit
, hardware and cloud providers are abstracted and made as simple to use as possible. Stop re-inventing the wheel, and start actually innovating with the ease of use and flexibility ofqbitkit
. - Define your circuit using a Pandas DataFrame, translate it to your quantum provider of choice, and run it -- in just a few lines of code.
- Running quantum circuits often requires costly hardware access and long wait times. It is therefore beneficial to keep track of your results so you don't have to re-run experiments to reproduce the results. For this reason, we included support forlogging to Elasticsearch, with support for other ways to log your data coming soon.
- Check theIssues tab at the top of this repository's page to see features we're working on now and the status of implementing those features into
qbitkit
- Visibility:
- 👀 Public
- 📆 Released: January 1st, 2021
- Status:
- 📆 In active development since December 15th, 2020
- ⏰ >=1 commit(s) made every week since the repository was created
- Health:
- ✅ Green (healthy)
- 🚀 Preparing for v0.1.0 (stable)
- 📝 Code examples and more documentation than just API doc needed (see issue #42)
- 📋 More unit tests are needed
Copyright © 2021 qbitkit Team ⚛ All Rights Reserved
About
⚛ Quantum Computing, for Humans.