Skip to main content

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

Project description

Qiskit MPS Initializer

PyPI - License PyPI - Version PyPI - Python 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 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 (ty is currently in beta, pyrefly is also another candidate, both built using Rust)
  • Unit testing: pytest (no Rust-based alternative)
    • Randomization: hypothesis
  • Documentation: mkdocs
    • API auto-generation: mkdocstrings-python
    • Theme: mkdocs-material

Dependencies

  • Quantum circuits: qiskit
  • Data modeling & validation: pydatic
    • Numpy support: pydantic-numpy
  • 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.2.2.tar.gz (100.7 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.2.2-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for qiskit_mps_initializer-0.2.2.tar.gz
Algorithm Hash digest
SHA256 f55d37589911fb5c4059c3dc0fb966a6cb56216e7940464c2eb0be791596be5e
MD5 186afdd9459a224017065c9a938ac03a
BLAKE2b-256 6cbfed0ed65b28637a5ba062c7b73fb22aeac128be933aee6081a29129fcb501

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qiskit_mps_initializer-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 33c84e37d3f25115c5154780212719fd34b3b768e73062331303d7c1778c4156
MD5 5e866df8806d87aad11d2534db23bc94
BLAKE2b-256 1bc382cacccbf2e087bf46876cb0fd0f2ac6be0b1cff3e8159a5202eddcfad78

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