Skip to content

Fix/falqon demo issue 1726#1729

Open
rosspeili wants to merge 2 commits intoPennyLaneAI:masterfrom
rosspeili:fix/falqon-demo-issue-1726
Open

Fix/falqon demo issue 1726#1729
rosspeili wants to merge 2 commits intoPennyLaneAI:masterfrom
rosspeili:fix/falqon-demo-issue-1726

Conversation

@rosspeili
Copy link
Copy Markdown
Contributor

Title: fix: correct Hc and commutator formulas, and build_hamiltonian coefficients in FALQON demo

Summary:
The FALQON demo's cost Hamiltonian formula, commutator formula, and build_hamiltonian() function all used incorrect coefficients. The root cause is a hidden 1/4 normalization applied by pennylane.qaoa.cost.edge_driver (used internally by qaoa.max_clique) that was not reflected in the demo's written math.

Specific corrections:

  • H_c formula: edge coefficient 33/4; added a note explaining the edge_driver normalization
  • [H_d, H_c] formula: first-sum coefficient 33/4, second-sum 31
  • i[H_d, H_c] formula: first-sum coefficient 63/2, second-sum 62
  • build_hamiltonian(): edge term coefficients 61.5, second-sum 62
  • Added a .. note:: block showing qml.commutator as a concise general-purpose alternative
  • Bumped dateOfLastModification in metadata.json

The FALQON algorithm converged correctly before and after this fix — the sign of β_k is preserved by the operator structure, so the guarantee d/dt ⟨H_c⟩ ≤ 0 holds regardless. This PR makes the written math match the actual code output.

Relevant references:

Possible Drawbacks:
None. The algorithm behaviour is unchanged; only the mathematical exposition is corrected.

Related GitHub Issues:
Closes #1726

@rosspeili rosspeili requested review from a team as code owners March 27, 2026 08:55
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

Your preview is ready 🎉!

You can view your changes here

Deployed at: 2026-03-27 16:11:23 UTC

…ts in FALQON demo

Fixes PennyLaneAI#1726 (PennyLaneAI#1726)

- Correct Hc formula: coefficient 3 -> 3/4 (hidden normalization in edge_driver)
- Add explanatory note about the 1/4 factor from pennylane.qaoa.cost.edge_driver
- Correct commutator [Hd, Hc] formula: first-sum coeff 3->3/4, second-sum coeff 3->1
- Correct i[Hd, Hc] formula: first-sum coeff 6->3/2, second-sum coeff 6->2
- Fix build_hamiltonian(): edge term coefficients 6->1.5, second-sum 6->2
- Add note block showing qml.commutator as a general-purpose alternative
- Bump dateOfLastModification in metadata.json
@rosspeili rosspeili force-pushed the fix/falqon-demo-issue-1726 branch from 69dae19 to 99540bb Compare March 27, 2026 09:01
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.

[BUG] the FALQON demo has issues in some formulas and code

1 participant