Skip to content
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.

Problems when comparing classical and quantum negative phase #1

Open
tbsyyjz01 opened this issue Nov 20, 2018 · 0 comments
Open

Problems when comparing classical and quantum negative phase #1

tbsyyjz01 opened this issue Nov 20, 2018 · 0 comments

Comments

@tbsyyjz01
Copy link

tbsyyjz01 commented Nov 20, 2018

Hi,

Thank you for sharing your source code for arXiv:1712.05304. I am PhD student in quantum computation and I am running your code to reproduce your results but I meet some problems.

When I try to print out the classical and quantum negative phase, I got different values, for example:

NEGATIVE PHASE (QUANTUM)
[[9.59270790e-11]
[9.59271278e-11]
[9.59271180e-11]
[9.59271114e-11]]
Negative PHASE(classical)
[[0.25784845]
[0.26259779]
[0.23950028]
[0.23258783]]

The only things I changed in your code is some of QAOA part for new version of grove:
full_QAOA = QAOA(self.qvm, qubits=np.arange(n_system), steps=self.n_qaoa_steps, ref_ham=full_mixer_operator, cost_ham=full_cost_operator, driver_ref=state_prep, store_basis=True, minimizer=fmin_bfgs, minimizer_kwargs={'maxiter':50}, vqe_options={'samples': self.n_quantum_measurements}, rand_seed=1234)

Also, another problem is that the CD-1 algorithm you use is for unit values in {0,1} but your quantum model and DATA should have unit values in {-1,1}, is it right? (correct me if I am wrong).

I tried to modify CD-1 algorithm for unit values in {-1,1}. And the exact negative phase calculated meets the CD-1 result but is off from the quantum results. I also tried to directly calculate the distribution of the quantum part by below code:

model_nus, model_gammas, model_para_prog, _ = self.make_unclamped_QAOA()
model_sampling_prog = model_para_prog(np.hstack((model_nus, model_gammas)))
samplings=self.qvm.run_and_measure(model_sampling_prog,range(self.n_visible),10000)

The distribution I sampled from the quantum is different from what I calculated exactly. I change the steps to 2 and beta to 1(I am not sure here, but beta = 2 still gives wrong distribution) (this is 2 visible units and 2 hidden units RBM without biases)

By beta=1, one example:
quantum: array([0.19426, 0.19714, 0.07278, 0.53582])
exact: array([0.1444419, 0.3555581, 0.3555581, 0.1444419])
By beta=2, one example:
quantum: array([0.10238, 0.10662, 0.01528, 0.77572])
exact: array([0.1444419, 0.3555581, 0.3555581, 0.1444419])

Is there something I missed? Any suggestions on how to get the right quantum distribution would be very appreciated.

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant