Skip to main content

A high-level cross-platform open-source quantum computing library

Project description

Quantum Cat Logo

Table of Contents

Introduction

A high-level cross-platform open-source quantum computing library so that the quantum community could concentrate on building quantum applications without much effort.

Purpose

The purpose of this library is to help developers create cross-platform quantum applications in few lines of code without having knowledge of gates and circuits.

Current Problems

  • Basic Knowledge of quantum gates and circuits required:
    Presently, It is very tough to create quantum applications given the fact that many available libraries are low-level libraries i.e. developers have to understand low-level concepts such as gates and circuits before they can actually start working on quantum applications. This is not natural to many developers who are accustomed to high-level concepts rather than worrying about gates and circuits.

  • Platform dependent code:
    To execute code on platforms such as IBM, Google, and so on, Developers need to write code separately for each platform independently putting lots of efforts.

Goal

Developers can create quantum applications in few lines of code. Few examples (In progress):

  • Quantum application for predicting stock price
from quantumcat.applications import Finance
from quantumcat.utils import operations

input = {'script_name': 'GOOGL'}
finance = Finance(input=input, operation=operations.stock_price_prediction)
results = finance.execute(provider=providers.Google, api='feasdgr2354gdsfgd01438')  # OR provider=providers.IBM_PROVIDER, For IBM Qiskit

print(results)
  • Quantum machine learning application for image classification
from quantumcat.applications import Classifier

input_dataset = load_data('/path')
classifier = Classifier(input=input_dataset)
results = classifier.predict(provider=providers.Google, api='feasdgr2354gdsfgd01438')  # OR provider=providers.IBM_PROVIDER, For IBM Qiskit

Platforms Supported

  • IBM Qiskit
  • Google Cirq
  • Amazon Braket

Gates Supported

Click here to view gates supported

Properties

  • Superposition
  • Entanglement
  • Phase Kickback

Algorithms

  • Grover's
  • Deutsch-Jozsa (In Progress)
  • Quantum Phase Estimation (Upcoming)
  • Bernstein-Vazirani Algorithm (Upcoming)

Examples

Circuit Creation

from quantumcat.circuit import QCircuit

num_of_qubits = 3
num_of_bits = 3
qc = QCircuit(num_of_qubits, num_of_bits)

Single Qubit Gate

qc.x_gate(0) # apply X gate on qubit 0

Two Qubit Gate

qc.cx_gate(0, 1) # control qubit, target qubit

Multi Qubit Gate

qc.mct_gate([0, 1], 2) # control qubits array, target qubit

Draw Circuit

from quantumcat.utils import providers

qc.draw_circuit(provider=providers.GOOGLE_PROVIDER) # OR provider=providers.IBM_PROVIDER, For IBM Qiskit

Execute

results = qc.execute(provider=providers.GOOGLE_PROVIDER, repetitions=1024) # OR provider=providers.IBM_PROVIDER, For IBM Qiskit

Superposition

qc.superposition(0) # put qubit 0 in superposition

Entanglement

qc.entangle(0, 1) # entangle qubit 0 with qubit 1

Phase Kickback

qc.phase_kickback(0) # apply |-> to qubit 0

Grovers Algorithm

Unknown Solution

# Finding solution for sudoku
clause_list_sudoku = [[0, 1], [0, 2], [1, 3], [2, 3]]
grovers_algorithm_unknown_solution = GroversAlgorithm(clause_list=clause_list_sudoku, flip_output=True, solution_known='N')
result = grovers_algorithm_unknown_solution.execute(repetitions=2, provider=providers.GOOGLE_PROVIDER) # OR provider=providers.IBM_PROVIDER, For IBM Qiskit
print(results) # solutions are 1001 and 0110

q0=10
q1=01
q2=01
q3=10

Known Solution

# Unstructured search
grovers_algorithm_known_solution = GroversAlgorithm(solution_known='Y', search_keyword=101)
result = grovers_algorithm_known_solution.execute(repetitions=1, provider=providers.GOOGLE_PROVIDER) # OR provider=providers.IBM_PROVIDER, For IBM Qiskit
print(results)

q0=1
q1=0
q2=1

Applications (In progress)

Finance

Image Classification

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantumcat-0.1.2.tar.gz (28.6 kB view hashes)

Uploaded Source

Built Distribution

quantumcat-0.1.2-py3-none-any.whl (513.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page