jpmorganchase / QOKit

QOKit
https://www.jpmorgan.com/technology/applied-research
Apache License 2.0
51 stars 23 forks source link

add small N labs para #77

Closed ZichangHe closed 3 weeks ago

ZichangHe commented 3 weeks ago

Add small N data to the LABS parameter dataframes.

N in [3,4,5,6] for MF, N in [3,4,5] for overlap, with p up to 5. For most cases, p=2 solves the problem exactly.

rsln-s commented 3 weeks ago

Thanks @ZichangHe! Couple of quick comments.

  1. The parameters should be saved with orient='index' for the diff to look nice and for the tests not to break. I fixed it using:
    import pandas as pd
    df = pd.read_json("best_LABS_QAOA_parameters_wrt_overlap.json")
    df.to_json('best_LABS_QAOA_parameters_wrt_overlap.json', orient='index', indent=4)

You can check the diff like this:

$ git diff main -- best_LABS_QAOA_parameters_wrt_MF.json | grep '^[+-]' | grep -Ev '"[0-9]+":{'
--- a/qokit/assets/best_LABS_QAOA_parameters_wrt_MF.json
+++ b/qokit/assets/best_LABS_QAOA_parameters_wrt_MF.json
+        "N":3,
+        "p":1,
+        "merit factor":4.5,
+        "gamma":[
+            -0.7853981599
+        ],
+        "beta":[
+            0.3926990842
+        ],
+        "AR":1.0,
+        "nseeds":null,
+        "overlap":1.0
+    },
+        "N":3,
+        "p":2,
+        "merit factor":4.5,
+        "gamma":[
+            -0.7857086708,
+            0.0550850251
+        ],
+        "beta":[
+            0.3912955591,
+            0.0014120801
+        ],
+        "AR":1.0,
+        "nseeds":null,
+        "overlap":1.0
+    },
...
  1. For N=5, there are multiple entries that achieve overlap 1. Specifically, p=3 already achieves overlap of 1, but p=4 and p=5 are also included. Is there a reason for that? If not, they should be removed since they are not, in any meaningful sense, "optimized" parameters; smaller p already solves the problem exactly.
ZichangHe commented 3 weeks ago

Thanks, I will remove the unnecessary higher p data. One more change to make, I will update N = 7 data which was contained in the original data frame but not fully optimized.