All Projects → Blueqat → Blueqat

Blueqat / Blueqat

Licence: apache-2.0
Quantum Computer Library for Everyone

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Blueqat

learn-qc-with-python-and-qsharp
Companion code for Learn Quantum Computing with Python and Q# Book by Dr. Sarah Kaiser and Dr. Chris Granade 💖
Stars: ✭ 62 (-79.19%)
Mutual labels:  quantum, quantum-computing, quantum-algorithms
Quantum-Computing-Collection-Of-Resources
A Well Maintained Repository On Quantum Computing Resources [Code+Theory] Updated Regularly During My Time At IBM, Qubit x Qubit And The Coding School's Introduction To Quantum Computing Course '21
Stars: ✭ 183 (-38.59%)
Mutual labels:  quantum, quantum-computing, quantum-algorithms
Quantum-Computing-Resources
This repository contains the best resources for learning practical quantum computing. This repository will be updated frequently.
Stars: ✭ 60 (-79.87%)
Mutual labels:  quantum, quantum-computing, quantum-algorithms
Quantum-Computer-Simulator-with-Algorithms
C++ simulator of quantum registers and quantum algorithms
Stars: ✭ 15 (-94.97%)
Mutual labels:  quantum, quantum-computing, quantum-algorithms
Teach Me Quantum
⚛ 10 week Practical Course on Quantum Information Science and Quantum Computing - with Qiskit and IBMQX
Stars: ✭ 118 (-60.4%)
Mutual labels:  quantum-algorithms, quantum-computing, quantum
qibo
A framework for quantum computing with hardware acceleration.
Stars: ✭ 120 (-59.73%)
Mutual labels:  quantum, quantum-computing, quantum-algorithms
unitaryhack
Rules and information for the 2021 unitaryHACK event hosted by @unitaryfund
Stars: ✭ 16 (-94.63%)
Mutual labels:  quantum, quantum-computing, quantum-algorithms
Grove
Quantum algorithms built using pyQuil.
Stars: ✭ 332 (+11.41%)
Mutual labels:  quantum-algorithms, quantum-computing, quantum
Strawberryfields
Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
Stars: ✭ 505 (+69.46%)
Mutual labels:  quantum-algorithms, quantum-computing, quantum
Qpanda 2
QPanda 2 is an open source quantum computing framework developed by OriginQC that can be used to build, run, and optimize quantum algorithms.
Stars: ✭ 128 (-57.05%)
Mutual labels:  quantum-algorithms, quantum-computing, quantum
qcl
Quantum Computation Language port from http://tph.tuwien.ac.at/~oemer/qcl.html
Stars: ✭ 29 (-90.27%)
Mutual labels:  quantum, quantum-computing, quantum-algorithms
OpenFermion-PySCF
OpenFermion plugin to interface with the electronic structure package PySCF.
Stars: ✭ 76 (-74.5%)
Mutual labels:  quantum-computing, quantum-algorithms
Quantum-Machine-Learning
This repository contains implementations of Quantum Machine Learning algorithms, feature maps, variational circuits and research papers.
Stars: ✭ 47 (-84.23%)
Mutual labels:  quantum-computing, quantum-algorithms
cusp cirq demo
Demonstration of CUSP algorithm using Cirq
Stars: ✭ 35 (-88.26%)
Mutual labels:  quantum-computing, quantum-algorithms
Qpp
A modern C++11 quantum computing library
Stars: ✭ 277 (-7.05%)
Mutual labels:  quantum-computing, quantum
cirq-on-iqm
Cirq adapter for IQM's quantum computers
Stars: ✭ 21 (-92.95%)
Mutual labels:  quantum-computing, quantum-algorithms
quantumjava
Samples related to "Quantum Computing for Java Developers"
Stars: ✭ 86 (-71.14%)
Mutual labels:  quantum, quantum-computing
algorithm-zoo
Implementations of algorithms from http://quantumalgorithmzoo.org/
Stars: ✭ 17 (-94.3%)
Mutual labels:  quantum, quantum-algorithms
miniqubit
Quantum emulator of the IBM Quantum experience
Stars: ✭ 24 (-91.95%)
Mutual labels:  quantum, quantum-computing
launchpad
Resources to get started in Quantum Computing!
Stars: ✭ 21 (-92.95%)
Mutual labels:  quantum-computing, quantum-algorithms

.. image:: https://raw.githubusercontent.com/Blueqat/Blueqat/master/blueqat_logo_blue.png :target: https://github.com/Blueqat/Blueqat :alt: Blueqat :scale: 30 %

======= blueqat

A quantum computing SDK

Version

.. image:: https://badge.fury.io/py/blueqat.svg :target: https://badge.fury.io/py/blueqat

Build info

.. image:: https://circleci.com/gh/Blueqat/Blueqat.svg?style=svg :target: https://circleci.com/gh/Blueqat/Blueqat

Tutorial

https://github.com/Blueqat/Blueqat-tutorials

Install

.. code-block:: sh

git clone https://github.com/Blueqat/Blueqat
cd Blueqat
pip3 install -e .

or

.. code-block:: sh

pip3 install blueqat

Circuit

.. code-block:: python

from blueqat import Circuit
import math

#number of qubit is not specified
c = Circuit()

#if you want to specified the number of qubit
c = Circuit(3) #3qubits

Method Chain

.. code-block:: python

# write as chain
Circuit().h[0].x[0].z[0]

# write in separately
c = Circuit().h[0]
c.x[0].z[0]

Slice

.. code-block:: python

Circuit().z[1:3] # Zgate on 1,2
Circuit().x[:3] # Xgate on (0, 1, 2)
Circuit().h[:] # Hgate on all qubits
Circuit().x[1, 2] # 1qubit gate with comma

Rotation Gate

.. code-block:: python

Circuit().rz(math.pi / 4)[0]

Measurement

.. code-block:: python

Circuit().m[0]

Run()

.. code-block:: python

Circuit().h[0].cx[0,1].run()

Run(shots=n)

.. code-block:: python

c = Circuit().h[0].cx[0,1].m[:]
c.run(shots=100) # => Counter({'00': 48, '11': 52}) (random value.)

Hamiltonian

.. code-block:: python

from blueqat.pauli import *

hamiltonian1 = (1.23 * Z[0] + 4.56 * X[1] * Z[2]) ** 2
hamiltonian2 = (2.46 * Y[0] + 5.55 * Z[1] * X[2] * X[1]) ** 2
hamiltonian = hamiltonian1 + hamiltonian2
print(hamiltonian)

simplify the hamiltonian

.. code-block:: python

hamiltonian = hamiltonian.simplify()
print(hamiltonian)

VQE

.. code-block:: python

from blueqat import vqe
from blueqat.pauli import qubo_bit as q

hamiltonian = -3*q(0)-3*q(1)-3*q(2)-3*q(3)-3*q(4)+2*q(0)*q(1)+2*q(0)*q(2)+2*q(0)*q(3)+2*q(0)*q(4)+2*q(1)*q(2)+2*q(1)*q(3)+2*q(1)*q(4)+2*q(2)*q(3)+2*q(2)*q(4)+2*q(3)*q(4)
step = 2

result = vqe.Vqe(vqe.QaoaAnsatz(hamiltonian, step)).run()
print(result.most_common(12))

If you want to create an ising model hamiltonian use Z(x) instead of q(x) in the equation

.. code-block:: python

hamiltonian = Z(0)-3*Z(1)+2*Z(0)*Z(1)+2*Z(0)*Z(2)

Blueqat to Qiskit

.. code-block:: python

qiskit.register(APItoken)
sampler = blueqat.vqe.get_qiskit_sampler(backend="backend name")
result = blueqat.vqe.Vqe(QaoaAnsatz(...), sampler=sampler).run(verbose=True)

Blueqat to QASM

.. code-block:: python

Circuit.to_qasm()

#OPENQASM 2.0;
#include "qelib1.inc";
#qreg q[1];
#creg c[1];
#h q[0];

Example

2-qubit Grover

.. code-block:: python

from blueqat import Circuit
c = Circuit().h[:2].cz[0,1].h[:].x[:].cz[0,1].x[:].h[:].m[:]
print(c.run(shots=1))

Maxcut QAOA

.. code-block:: python

from blueqat import vqe, pauli
edges = [(0, 1), (1, 2), (2, 3), (3, 0), (1, 3), (0, 2), (4, 0), (4, 3)]
ansatz = vqe.QaoaAnsatz(sum([pauli.Z(i) * pauli.Z(j) for i, j in edges]), 1)
result = vqe.Vqe(ansatz).run()
print(
"""   {4}
  / \\
 {0}---{3}
 | x |
 {1}---{2}""".format(*result.most_common()[0][0]))

Document

https://blueqat.readthedocs.io/en/latest/

Author

Takumi Kato (blueqat), Yuichiro Minato (blueqat), Yuma Murata (D Slit Technologies), Satoshi Takezawa (TerraSky)

Disclaimer

Copyright 2020 The Blueqat Developers.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].