wangleiphy / BetaVQE.jl

Solving Quantum Statistical Mechanics with Variational Autoregressive Networks and Quantum Circuits
MIT License
33 stars 6 forks source link

Statistical error? #8

Closed akio-tomiya closed 2 years ago

akio-tomiya commented 2 years ago

Hi, now I can successfully execute the code. I want to know, how can I put statistical error for sampling? I think there are two sources, one is for p and another is from quantum part. What values in JLD2 is the mean values, right?

wangleiphy commented 2 years ago

What values in JLD2 is the mean values, right?

That's right.

You can estimate error bars using standard deviation of samples (compute std in addition to mean) https://github.com/wangleiphy/BetaVQE.jl/blob/master/src/free_energy.jl#L16 The error bar will contain only thermal fluctuation since we compute exact quantum expectation value there.

If needed, you can mimic quantum measurement to get additional statistical noises in the quantum part.

akio-tomiya commented 2 years ago

Thanks, I understand that.

If needed, you can mimic quantum measurement to get additional statistical noises in the quantum part.

Do you mean some numerical evaluation in Yao.jl? (I don't know Yao has such functionality though. It corresponds to "shot experiment" function in other framework.)

Do you mean exact diagonalization used in the training and/or evaluation of expectation values?

wangleiphy commented 2 years ago

I meant we compute quantum expectation <psi|H|psi> and its gradient exactly in the code.

Here is an example of getting stochastic gradient from "shot measurement" https://github.com/wangleiphy/YaoTutorial/blob/master/vqe.jl#L16

akio-tomiya commented 2 years ago

Thank you very much!