Skip to main content

Wavefunction initializers for Qiskit based on matrix product states (MPS)

Project description

Qiskit MPS Initializer

PyPI - License PyPI - Version

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.quantum_state 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(data=psi, number_of_layers=number_of_mps_layers)

# generate the initializer circuit for this state
circuit = state.mps_initializer_circuit

# the circuit object is a qiskit.QuantumCircuit object which
# means you can do whatever you could natively do in Qiskit
circuit.draw('mpl')

[!IMPORTANT] Note that the documentation of this package is in preparation now and will be linked here. Until then, you can check out the source code to get an idea of functions and classes exported in this package.

[!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 (ty is currently in beta, pyrefly is also another candidate, both built using Rust)
  • Unit testing: pytest (no Rust-based alternative)
    • Randomization: hypothesis

Dependencies

  • Quantum circuits: qiskit
  • Data modeling & validation: pydatic
  • 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

qiskit_mps_initializer-0.1.1.tar.gz (60.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qiskit_mps_initializer-0.1.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file qiskit_mps_initializer-0.1.1.tar.gz.

File metadata

File hashes

Hashes for qiskit_mps_initializer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 55faa64544d975115d45ff0bc4d5560de44023378c7fd2d9b63c139ea0e8a34c
MD5 2bc79dc5c6a89476ca4c1134ddd333b1
BLAKE2b-256 d2ea9db79c71199dc70e3f21ebc89eb957fd7d2792f522f2ef9ccbd34c064b6b

See more details on using hashes here.

File details

Details for the file qiskit_mps_initializer-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for qiskit_mps_initializer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 009a8058c57590856714eff5e765976c75a4f4987e5007a192c90f597bde0812
MD5 80e9bf1e13d05c003efdc2bd87159c1b
BLAKE2b-256 74e3d2e1cf800cfd71eb91d22063d02746711f2d422bd07b5f2b68d8922d0e4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page