Skip to content
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

Fix Metropolis for sparse distributions #347

Merged
merged 4 commits into from
Mar 9, 2021
Merged

Fix Metropolis for sparse distributions #347

merged 4 commits into from
Mar 9, 2021

Conversation

stavros11
Copy link
Member

Fixes #346 using the idea mentioned there. Execution time and KL divergence for random distributions are the same as our existing code:

nshots master time (sec) fix time (sec) KL master KL fix
100000000 0.148165 0.238486 1.99e-05 1.25e-05
200000000 0.309631 0.478443 1.15e-05 9.90e-06
400000000 0.458794 0.828578 1.23e-05 8.05e-06
600000000 0.676857 1.156601 9.35e-06 8.28e-06
800000000 1.037136 1.502599 1.14e-05 6.70e-06
1000000000 0.986530 1.843876 1.03e-05 8.21e-06
2000000000 1.920199 3.533490 9.72e-06 7.11e-06
4000000000 3.620555 7.008676 9.70e-06 6.89e-06
6000000000 5.468573 10.519186 9.39e-06 7.12e-06
100 0.001501 0.001475 1.80e+01 1.82e+01
10000 0.002878 0.002937 1.51e-01 1.57e-01
10000000 0.022121 0.027112 1.16e-04 9.69e-05
nqubits master time (sec) fix time (sec) KL master KL fix
6 0.020047 0.036727 1.57e-05 8.39e-06
8 0.023921 0.029751 3.62e-05 2.38e-05
10 0.022121 0.027112 1.16e-04 9.69e-05
12 0.026822 0.034296 5.29e-04 3.59e-04
14 0.024820 0.040488 1.75e-03 1.56e-03
16 0.032375 0.042690 7.62e-03 6.16e-03
18 0.037547 0.060351 3.12e-02 2.92e-02
20 0.083534 0.113640 1.96e-01 1.72e-01
22 0.271751 0.321594 2.22e+00 1.98e+00
24 0.891320 0.934847 6.75e+00 6.53e+00
26 3.006421 3.102790 8.49e+00 8.42e+00

@stavros11 stavros11 requested a review from scarrazza March 9, 2021 13:22
@codecov
Copy link

codecov bot commented Mar 9, 2021

Codecov Report

Merging #347 (a3ea890) into master (4ed77c7) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #347   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           76        76           
  Lines        12387     12406   +19     
=========================================
+ Hits         12387     12406   +19     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...qibo/tests_new/test_tensorflow_custom_operators.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ed77c7...a3ea890. Read the comment docs.

Copy link
Member

@scarrazza scarrazza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks looks good.

@scarrazza scarrazza merged commit f9d9703 into master Mar 9, 2021
@delete-merged-branch delete-merged-branch bot deleted the fixmetropolis branch March 9, 2021 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frequency custom operator fails for some states
2 participants