Closed rsln-s closed 9 months ago
@rsln-s @gromitsun
I made change accommodate sign change based on a parameter. This I feel is more robust and requires just one time change for 'minimization' and 'maximization' problems. This does not affect LABS code, and can be refactored according to this design. if you guys satisfied with this do not approve, I will make changes for terms to be converted to diagonal upfront.
@rsln-s - I have updated qaoa_objective_maxcut.py to calculate precomputed_diagonal_hamiltonian upfront for terms too.
I have updated the code in qaoa_objective.py for qiskit simulator to call precompute_vectorized_cpu_parallel to get precomputed energies and removed precompute_terms function
@rsln-s Since yesterday I am trying to debug why black is failing for a file I did not change in the Action. Black check works without any issues on both my LVDI and my Mac Laptop. However all test cases passes and code is running as expected. Can you please try at your end by pushing the portfolio_optimization.py file?
Hey @rajgane07, I believe it was a black versioning issue. Bumping black version to 24.1a1
(pip install -U black==24.1a1
) solved it (see 5a1967d). On my Mac, by default pip install black
installs black-23.12.1
, which appears to behave differently.
@rsln-s - Thanks for the upate. I think all the Actions are green (except documentation). Can you please review and merge the code? I would like to take the latest to work on next issue
Adding a test confirming that terms and precomputed objective give the same result