Skip to main content

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

Project description

Quantum Cat Logo

Table of Contents

Introduction

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

Purpose

quantumcat is a cross-platform library and is built on the principle of write once and execute any quantum provider. The purpose of this library is to help developers create cross-platform quantum applications in few lines of code.

Problems with current QC Libraries

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

Installation

pip install quantumcat

Platforms Supported

  • Google Cirq
  • IBM Qiskit
  • Amazon Braket
  • IonQ (Via Braket)
  • Rigetti (Via Braket)

Gates Supported

Click here to view gates supported

Examples

Circuit Creation

from quantumcat.circuit import QCircuit

num_of_qubits = 3
qc = QCircuit(num_of_qubits)

Single-Qubit Gate

qc.x_gate(0) 
# applies 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

Superposition

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

Entanglement

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

Phase Kickback

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

Draw Circuit

from quantumcat.utils import providers

qc.draw_circuit(provider=providers.GOOGLE_PROVIDER) 
# OR providers.IBM_PROVIDER / providers.AMAZON_PROVIDER 

Execute on Simulators

from quantumcat.utils import providers

results = qc.execute(provider=providers.GOOGLE_PROVIDER, repetitions=1024) 
# OR providers.IBM_PROVIDER / providers.AMAZON_PROVIDER

Execute on real IBM device

from quantumcat.utils import providers

results = qc.execute(provider=providers.IBM_PROVIDER, repetitions=1024, 
api='API KEY from IBM Quantum dashboard', device='IBM DEVICE NAME such as ibmq_manila or ibmq_quito')
# Copy API and Device name from https://quantum-computing.ibm.com/

Applications

Random Number Generator

from quantumcat.utils import providers, constants
from quantumcat.applications.generator import RandomNumber

random_number = RandomNumber(length=2, output_type=constants.DECIMAL)\
        .execute(provider=providers.GOOGLE_PROVIDER)
# OR providers.IBM_PROVIDER / providers.AMAZON_PROVIDER
print(random_number)

# To generate random number on actual IBM device
random_number = RandomNumber(length=2, output_type=constants.DECIMAL)\
        .execute(provider=providers.IBM_PROVIDER, repetitions=1024, 
api='API KEY from IBM Quantum dashboard', device='IBM DEVICE NAME such as ibmq_manila or ibmq_quito')
print(random_number)

Password Generator

from quantumcat.applications.generator import Password

password = Password(8).generate()
print(password)
# Length should be between 5 - 20
# Password is generated in hexadecimal format using QRNG@ANU JSON API

OTP Generator

from quantumcat.applications.generator import OTP

otp = OTP().generate()
print(otp)
# 5 digits OTP is generated using QRNG@ANU JSON API

License

Apache License 2.0

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.5.tar.gz (32.5 kB view hashes)

Uploaded Source

Built Distribution

quantumcat-0.1.5-py3-none-any.whl (72.0 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