-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: more efficient state sampling #324
Comments
Hi, @kwkbtr san,
Or am I misunderstanding something? |
@m-ymzk san, |
So there is a case that a value including a stochastic variation is required instead of an ideal value. |
How about using scipy multinomial?
When I ran this it completed within 1 millisecond, sampling 10^12 times at 10 qubits. In practice, we may need to call scipy's C++ interface from qulacs. |
Yes, we are currently using multinomial in numpy. |
We currently use
QuantumState::sampling
for state sampling.The current implementation involves random number generation for
sampling_count
times:qulacs/src/cppsim/state.hpp
Lines 668 to 674 in 00040b9
For our use cases, it is often the case that the
sampling_count
is much larger than the dimension of a state vector (e.g.sampling_count
= 10^12 whilequbit_count
is around 10). In such a case, the random number generation is quite time-consuming.We only need statistics of sampling for our use cases (i.e.
00...0
occurredm_1
times,00...1
occurredm_2
times, ...).For such use cases, it might be more efficient if we sample the statistics by using a multinomial distribution with parameters given by probabilities of a single measurement on the quantum state.
The text was updated successfully, but these errors were encountered: