MSQR is the short form for MPS-SWAP-test hybrid structural Quantum state Reconstruction algorithm.
Build the quantum circuit for MPS-Swap Test(MStest
) and MSQR(MSQRtrain!
).
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.
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.
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
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.
Hyper-parameters | Values |
---|---|
Measure Times | 5000 |
SGD(ADAM) | η = 0.01 β = (0.9,0.999) |
Random Seed(Julia) | 1234 |
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.
- MSTest.jl: Showing the function of
MPSSwapTest
. - MSQRTest.jl: Showing a training example of
MSQR
.
-
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)
MSQR.jl is released under Apache License 2.0.