Skip to content

Bug: constraints in PyCI interface#210

Merged
kzsigmond merged 4 commits into
mainfrom
186-bug-constraints-in-interface
Jun 6, 2026
Merged

Bug: constraints in PyCI interface#210
kzsigmond merged 4 commits into
mainfrom
186-bug-constraints-in-interface

Conversation

@kzsigmond

Copy link
Copy Markdown
Contributor

This pull request fixes the constraint passing within the Fanpy-PyCI interface.

Constraint Handling and Adapter Pattern:

  • Introduced a new ConstraintAdapter class in fanpy/interface/pyci_utils.py to bridge the difference between Fanpy and PyCI constraint signatures. PyCI objectives define x as [wfn_params, energy], while the Fanpy constraints need an input of [wfn_params] [1] [2]
  • Refactored constraint passing in the PyCI interface to ensure constraints are correctly adapted and added to the objective. [1] [2] [3] [4] [5] [6]
  • The normalization constraint is built within the PyCI objective.

Testing Improvements:

  • added tests for constraint adapter
  • added test cases for constraints in test_interface_pyci.py

@kzsigmond kzsigmond added this to the v2.0.0 milestone Jun 1, 2026
@kzsigmond kzsigmond requested a review from rugwed-lokhande June 1, 2026 17:35
@kzsigmond kzsigmond self-assigned this Jun 1, 2026
@kzsigmond kzsigmond added the bug Something isn't working label Jun 1, 2026
@kzsigmond kzsigmond linked an issue Jun 1, 2026 that may be closed by this pull request
@kzsigmond kzsigmond force-pushed the 186-bug-constraints-in-interface branch from a6cb301 to 1364643 Compare June 4, 2026 19:54
@kzsigmond kzsigmond marked this pull request as ready for review June 4, 2026 19:54
@kzsigmond kzsigmond merged commit 92cf25a into main Jun 6, 2026
3 checks passed
@kzsigmond kzsigmond deleted the 186-bug-constraints-in-interface branch June 6, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: constraints in interface

2 participants