A cross-platform open-source high-level quantum computing library
Project description
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
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)
Built Distribution
quantumcat-0.1.5-py3-none-any.whl
(72.0 kB
view hashes)
Close
Hashes for quantumcat-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca170bc16de4089232af30728f0044e3e24f58c94310e000e980c31abdcb4e6d |
|
MD5 | 3316665fdf9b2da8ec8b7fda362c3343 |
|
BLAKE2b-256 | ecbb8344bedbc463f6f0b455aba4818ea1de46b2ba7efb28d7519e673bf6c3c7 |