LogicQubit is a simple library for quantum computing simulation.
Project description
Features
- Numerical and symbolic simulation of quantum algorithms
- Plot states and current operation, density matrix and measurement graphs
- The state values can be represented as angles, which helps in the analysis of the fourrier quantum transform.
- Operations can be performed directly on the instantiated qubit object or using qubit indices.
- Support GPU
Table of Contents
Installation
pip install logicqubit
Startup
logicQuBit = LogicQuBit(n_qubits, symbolic = True)
Where n_qubits is the number of qubits, and symbolic defines whether the values a and b of the qubits will be symbolic or not, if the symbolic input is omitted the calculation will be numeric.
To instantiate a qubit
q = Qubit()
To instantiate a qubit register
reg = QubitRegister(num_qubits)
Operations
Operations on one qubit
The operation can be performed as q.Gate(parameters) or logicQuBit.Gate(id_qubit, parameters).
Operations on two qubits
In this case, the operation can be performed as q.Gate(control_qubit, parameters) or logicQuBit.Gate(control_qubit, target_qubit, parameters).
*The need for parameters depends on the type of gate.
List of available gates
Single-qubit gates: X, Y, Z, V, S, T, H, RX, RY, RZ, U, U1, U2, U3.
Two-qubits gates: CX or CNOT, CY, CZ, CV, CS, CT, CRX, CRY, CRZ, CU, CU1, CU2, CU3, SWAP.
Three-qubits gates: CCX or Toffoli, Fredkin.
Code sample
from logicqubit.logic import *
logicQuBit = LogicQuBit(3)
a = Qubit()
b = Qubit()
c = Qubit()
a.H()
b.H()
c.CCX(a,b) # and operation
Other code samples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for logicqubit-1.5.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf24d2fa789612bd15d80efa912fbb68728823a462006efff2e31310dddc5662 |
|
MD5 | 95e4b84cbfc8ee757a0608f71c8f7b07 |
|
BLAKE2b-256 | 93719235585185afaa259691a60bf65100585f0fc612eacf629295909f6d76c2 |