Skip to content

Fix gtoval used in OBDM sample_onebody()#494

Merged
lkwagner merged 3 commits intoWagnerGroup:masterfrom
cychow2:fix_obdm_eval_gto
Dec 5, 2025
Merged

Fix gtoval used in OBDM sample_onebody()#494
lkwagner merged 3 commits intoWagnerGroup:masterfrom
cychow2:fix_obdm_eval_gto

Conversation

@cychow2
Copy link
Contributor

@cychow2 cychow2 commented Nov 18, 2025

OBDM sample_onebody() now calls eval_gto() with gtoval according to the basis (spherical or Cartesian) specified in the mol object.

"""
n = configs.configs.shape[0]
if orbitals._mol.cart:
if type(orbitals) == pyqmc.wf.orbitals.MoleculeOrbitalEvaluator:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very fragile fix. If we ever use different orbital types or change anything, this will break. Instead you need to have another parameter that tells it about the gtoval parameter.

@lkwagner
Copy link
Contributor

Thanks--unfortunately the use of private variables and type== cannot be accepted as is. Please change to be less fragile!

@cychow2
Copy link
Contributor Author

cychow2 commented Nov 21, 2025

I've made gtoval an additional parameter of sample_onebody(). Since it's also used in tbdm, I added a private variable self._gtoval in the tbdm class like I did for the obdm class, and pass it to sample_onebody().

@lkwagner lkwagner merged commit 46d8f16 into WagnerGroup:master Dec 5, 2025
3 checks passed
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.

2 participants