Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

⚛ Quantum Computing, for Humans.

License

NotificationsYou must be signed in to change notification settings

qbitkit/qbitkit

qbitkit Official Logo (you may need to enable JavaScript to see this!)

qbitkitDocs

Sphinx DocumentationCodeQLPyTestFlake8

Quantum Computing, for Humans.

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

📊 Example

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())

📚 Documentation

For the time being, documentation is hosted at:

🐍 📦 Python Version Compatibility

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.

🐍 📦 ⬇️ Installingqbitkit

Anaconda3 (Windows/Mac/Linux)

  1. Download Anaconda3:
  • Clickthis link to download Anaconda3 from the official page for Anaconda Individual Edition
  1. After downloading and installing, openAnaconda Prompt and type:
  • conda create -n qbitkit (hit enter)
  • conda activate qbitkit (hit enter)
  • conda install -y pip (hit enter)
  1. 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 examplevenv/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.

Pip (coming soon)

  1. Make surepip is up-to-date, then install usingpip:
  • pip install -U pip
  • pip install -U qbitkit

Virtual Environment

  1. Locally cloneqbitkit,cd into the directory we just cloned it into:
  • git clone https://github.com/brianlechthaler/qbitkit.git
  • cd qbitkit
  1. Updatepip, 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
  1. Install Dependencies:
  • pip install -Ur requirements.txt
  1. Build and Install withsetup.py:
  • python setup.py build
  • python setup.py install

Linux

  1. Make sure you havepip 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
  1. To make sure you're using the rightpip from the rightpython, you shouldrun this command before running subsequent commands:
  • alias 'pip=python3 -m pip'
  1. You may needgit if it isn't yet installed, for example on Debian-based systems:
  • sudo apt-get install -qq -y git

Installer Script (recommended)

  1. Change directory into qbitkit/bin
  • cd bin
  1. Run script
  • /bin/sh install.sh

Pip (coming soon)

  1. Make surepip 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

Python Virtual Environment

  1. Cloneqbitkit locally, thencd to the directory you just cloned:
  • git clone https://github.com/qbitkit/qbitkit.git
  • cd qbitkit
  1. Create a virtual environment, then activate it:
  • virtualenv --python=python3 venv && . venv/bin/activate
  1. Install requirements, then usesetup.py to buildqbitkit then installqbitkit into the virtualenv:
  • pip install -r requirements.txt && python setup.py build && python setup.py install

🔣 Features ofqbitkit

  • 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. Withqbitkit, 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 intoqbitkit

🔄 Project Lifecycle

  • 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


[8]ページ先頭

©2009-2025 Movatter.jp