Quantum Singular Value Transformation toolkit developed by the Institute for Quantum Computing at Baidu Research.
Project description
Copyright (c) 2022 Institute for Quantum Computing, Baidu Inc. All Rights Reserved.
About QSVT Toolkit
QSVT toolkit is a Quantum Singular Value Transformation toolkit based on QCompute and developed by the Institute for Quantum Computing at Baidu Research. It aims to implement quantum simulation and other algorithms on quantum devices or simulators more conveniently. Currently, it includes three main modules:
-
Quantum Singular Value Transformation (QSVT) is used for implementing singular value transformations of quantum operations, whose input and output are both block-encodings of quantum operations.
-
Symmetric Quantum Signal Processing (SQSP) is used for encoding such transformation functions and completing such quantum circuits in QSVT. SQSP is introduced for implementing the encoding step more effectively.
-
Hamiltonian Simulation is one of the most significant applications for QSVT, and even quantum computing. It provides functions to generate quantum circuits for time evolution operators of Hamiltonians.
QSVT toolkit is based on QCompute, a Python-based open-source quantum computing platform SDK also developed by Institute for Quantum Computing. It provides a full-stack programming experience for senior users via hybrid quantum programming language features and high-performance simulators. You can install QCompute via pypi. When you install QSVT toolkit, the dependency QCompute will be automatically installed. Please refer to QCompute's official Open Source page for more details.
Installation
Create Python Environment
We recommend using Anaconda as the development environment management tool for Python3. Anaconda supports multiple mainstream operating systems (Windows, macOS, and Linux). It provides Scipy, Numpy, Matplotlib, and many other scientific computing and drawing packages. Conda, a virtual environment manager, can be used to install and update the latest Python packages. Here we give simple instructions on how to use conda to create and manage virtual environments.
-
First, open the command line (Terminal) interface: Windows users can enter
Anaconda Prompt
; macOS users can use the key combinationcommand + space
and then enterTerminal
. -
After opening the Terminal window, enter
conda create --name qsvt_env python=3.9
to create a Python 3.9 environment named
qsvt_env
. With the following command, we can activate the virtual environment created,conda activate qsvt_env
For more detailed instructions on conda, please refer to the Official Tutorial.
Install QSVT Toolkit
QSVT toolkit is compatible with 64-bit Python 3.9, on Linux, macOS (10.14 or later) and Windows. We recommend installing it with pip
. After Activating the conda environment, then enter
pip install qcompute-qsvt
This will install the QSVT toolkit binaries as well as the QSVT toolkit package.
For those using an older version of QSVT toolkit, update by installing with the --upgrade
flag. The new version includes additional features and bug fixes.
Run Examples
Now, you can try to write a simple program to check whether QSVT toolkit has been successfully installed. For example, run the following program,
import numpy as np
from QCompute import *
from qcompute_qsvt.Application.HamiltonianSimulation import func_HS_QSVT
func_HS_QSVT(list_str_Pauli_rep=[(1, 'X0X1'), (1, 'X0Z1'), (1, 'Z0X1'), (1, 'Z0Z1')],
num_qubit_sys=2, float_tau=-np.pi / 8, float_epsilon=1e-6, circ_output=False)
we will operate a time evolution operator on initial state $|00\rangle$ for Hamiltonian $X\otimes X + X\otimes Z + Z\otimes X + Z\otimes Z$ and time $-\pi/8$ with precision 1e-6
, and then measure such final state.
Note that more examples are provided in the source codes, tutorials and API documentation. You can get started from there.
Tutorials
QSVT toolkit provides quick start for using the Hamiltonian Simulation module, as well as a brief introduction to the theories for users to learn and get started. The current content of the following tutorial is organized as follows, and it is recommended that beginners read and study in order:
- Brief Introduction
- Quantum Signal Processing
- Block-Encoding and Linear Combination of Unitary Operations
- Quantum Eigenvalue and Singular Value Transformation
- Hamiltonian Simulation
We will supply more detailed and comprehensive tutorials in the future.
API Documentation
For those who are looking for explanation on the python classes and functions in QSVT toolkit, please refer to our API documentation.
Feedbacks
Users are encouraged to contact us via email quantum@baidu.com with general questions, unfixed bugs, and potential improvements. We hope to make QSVT toolkit better together with the community!
Research based on QSVT Toolkit
We encourage researchers and developers to use QSVT toolkit to explore quantum algorithms. If your work uses QSVT toolkit, please feel free to send us a notice via quantum@baidu.com and cite us with the following BibTeX:
@misc{QSVT,
title = {{Quantum Sigular Value Transformation toolkit in Baidu Quantum Platform}},
year = {2022},
url = {https://quantum-hub.baidu.com/qsvt/}
}
Changelog
The changelog of this project can be found in CHANGELOG.md.
Copyright and License
QSVT toolkit uses Apache-2.0 license.
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 Distributions
Built Distribution
Hashes for qcompute_qsvt-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e54fb2d386bedff97eef7498f3a95e302f36da4c3bf48cd7251a74d595decbc |
|
MD5 | 8247e701a2170f887f633214d32ca0e9 |
|
BLAKE2b-256 | 9a3642d95260f4171b73951e40868e87e26a9c2eb91cfcbc81385402bbc4d5e5 |