Closed ChienKaiMa closed 2 years ago
I found solution to this issue by modifying the code from p_marginal /= nfact
to p_marginal = p_marginal / nfact
. I think I'll open a pull request for that.
Thanks, looks like the problem indeed is when some normalization factor is >= 2**64, it needs to be cast as a 'object' by numpy. Will take a look at PR momentarily.
Regarding the difference between sampling and 'simulation' - sampling is just one of many types of simulation. In fact, classically speaking, it's often somehow the least useful as you are intentionally introducing noise - but it also closest to mimicking the output of a real quantum computer. Also, for certain optimization problems (e.g. QAOA), once you have tuned your circuit you also the need to 'sample' candidate bitstring solutions, for which e.g. just computing local expectations is insufficient, though doing this in a perfectly unbiased way like Circuit.sample
is probably overkill too.
I found similar error messages in #96 's comment, but I think I should open a new issue for it.
Problem
I tried to sample several random quantum circuits (reduced to depth=6), from 4x4, 4x5, 5x5 to 9x10 qubits. My program
simulator/quimb_qasm_sim.py
behaved as I wished with circuits under 64 qubits, but it returned the following message when the qubit number is greater than 64:Other details (may or may not be useful)
backend
forsample
function:cupy
P.S.
I want to know the difference between circuit sampling and circuit simulation, and the pros and cons of each, but I didn't find good explanations online. Is there any suggested materials?