Wavefunction initializers for Qiskit based on matrix product states (MPS)
Project description
Qiskit MPS Initializer
This package provides extra tools on Qiskit enabling you to initialize wavefunctions on a quantum computer using techniques based on matrix product states (MPS).
User guide
Installation
The easiest way to get started is using pip which installs the package and its dependencies in your project
pip install qiskit-mps-initializer
You can alternatively use uv, poetry or any other python package manager to install this package.
Usage
Once you have installed the package, you can import tools from it.
from qiskit_mps_initializer.datatypes import QuantumState
# wavefunction as an array of numbers, could use np.array as well
psi = [1, 3, 1, 2, 7, 8, 0, 1]
# number of layers of two-qubit gates to use for the initializer
number_of_mps_layers = 2
# create the state object
state = QuantumState.from_dense_data(data=psi, normalize=True)
# generate the initializer circuit for this state
circuit = state.generate_mps_initializer_circuit(number_of_layers=number_of_mps_layers)
# the circuit object is a qiskit.QuantumCircuit object which
# means you can do whatever you could natively do in Qiskit
circuit.draw('mpl')
Documentation
The project's documentation is located here. Check it out for more information.
[!CAUTION] This project is in alpha. This means you should expect drastic changes in the api in later releases.
Project credits
Tools
- Project and dependency manager:
uv - Linter:
ruff - Formatter & style:
ruff - Static typechecking:
pyright(tyis currently in beta,pyreflyis also another candidate, both built using Rust) - Unit testing:
pytest(no Rust-based alternative)- Randomization:
hypothesis
- Randomization:
- Documentation:
mkdocs- API auto-generation:
mkdocstrings-python - Theme:
mkdocs-material
- API auto-generation:
Dependencies
- Quantum circuits:
qiskit - Data modeling & validation:
pydatic- Numpy support:
pydantic-numpy
- Numpy support:
- Tensor networks:
quimb
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qiskit_mps_initializer-0.2.4.tar.gz.
File metadata
- Download URL: qiskit_mps_initializer-0.2.4.tar.gz
- Upload date:
- Size: 157.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df24b26c76e93d92b96f6efc0d95e5471611171efb5a5fb8467d8a2370ee8b7e
|
|
| MD5 |
8568f00abdd49f648dcb509fb9c4f8ba
|
|
| BLAKE2b-256 |
0ebae5735392313f18586681ff0c729f2815f72b3d385028a093ddf05a6206bb
|
File details
Details for the file qiskit_mps_initializer-0.2.4-py3-none-any.whl.
File metadata
- Download URL: qiskit_mps_initializer-0.2.4-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07134a22ed9c1f1e030593963043e4cec91813889e26a1875d554d49e2513c2e
|
|
| MD5 |
e2e9acca8ead20abbae19a960c5e9330
|
|
| BLAKE2b-256 |
8d58037b772503ede2c57a59ded92ab8e47d954861e66087326c0a8f0ac92676
|