jpmorganchase / QOKit

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

parameter `p` doesn't seem like it is used in the `get_qaoa_labs_objective` function #58

Open shreehari117 opened 6 months ago

shreehari117 commented 6 months ago

The get_qaoa_labs_objective function takes N and p, along with other parameters. The get_qaoa_labs_objective calls get_qaoa_objective, where p does not seem like it is used.

jhnnsjkbk commented 5 months ago

Hey! I stumbled across the same thing. p is never used. However, p is indirectly set by the length of e.g., theta such as here: https://github.com/jpmorganchase/QOKit/blob/af4d306c3bd77fb036baa75d2f416879b73e5d6a/qokit/parameter_utils.py#L125. It's quite uncommon and looks a bit hacky to me, but I might miss something. Hope this helps. Essentially, you would want to not set p but the length of e.g. theta.