Skip to content

Qubit-state Reconstruction algorithm based on MPS-SwapTest hybrid method.

License

Notifications You must be signed in to change notification settings

frankwswang/MSQR.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MSQR.jl

Build Status Coverage

MSQR is the short form for MPS-SWAP-test hybrid structural Quantum state Reconstruction algorithm.

Main functions

MScircuit

Build the quantum circuit for MPS-Swap Test(MStest) and MSQR(MSQRtrain!).

MStest

Use Swap Test algorithm to measure overlaps between a Target wave function(register) and a random MPS wave function generated by a qubit-reusable circuit.

MSQRtrain!

Combining MPS-Swap Test method and Quantum Gradient Optimization, MSQR can train a MPS circuit with adjustable parameters to reconstruct a wave function that has similar entanglements with the target wave function.

Setup Guide

Julia Environment

Installation

Please first install another unregistered package QMPS. Type ] in Julia REPL to enter Pkg mode, then type:

pkg> add https://github.com/frankwswang/QMPS.jl

Then use the same procedure to install this project package:

pkg> add https://github.com/frankwswang/MSQR.jl

How to use

Please type using QMPS and using MSQR to use any functions of this package. MSQR relies on a Julia Quantum Computation Simulation Framework package called Yao to realize its full functionality and currently compatiple version is Yao 0.6. You need to type using Yao in order to interact with MSQR using Yao's functions.

For more introductions and tutorials about MSQR's functions please check the examples directory in the repository as well as the function documentation using Julia's Help mode.

Recommended training configuration

Hyper-parameters Values
Measure Times 5000
SGD(ADAM) η = 0.01 β = (0.9,0.999)
Random Seed(Julia) 1234

CUDA GPU support

If your GPU supports CUDA, you may also install CUDA-supported version of Yao: CuYao to gain significant calculation acceleration for MSQR. After properly installing CuYao and typing using CuYao, you can gain GPU acceleration(saved time may vary due to different models of GPU) calling each following functions:

  • MSQRtrain!
  • SWAPtrain!
  • SWAPtest
  • MSTtest
  • MStest

If you want to manually switch off any above function's CUDA support, just add the optional function argument useCuYao = false when calling the function.

Examples

  • MSTest.jl: Showing the function of MPSSwapTest.
  • MSQRTest.jl: Showing a training example of MSQR.

References

  • Ekert, A. K., Alves, C. M., Oi, D. K., Horodecki, M., Horodecki, P., & Kwek, L. C. (2002). Direct estimations of linear and nonlinear functionals of a quantum state. Physical review letters, 88(21), 217901. (DOI: 10.1103/PhysRevLett.88.217901)

  • Liu, J. G., Zhang, Y. H., Wan, Y., & Wang, L. (2019). Variational quantum eigensolver with fewer qubits. Physical Review Research, 1(2), 023025.(DOI: 10.1103/PhysRevResearch.1.023025)

License

MSQR.jl is released under Apache License 2.0.

About

Qubit-state Reconstruction algorithm based on MPS-SwapTest hybrid method.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages