Skip to content

Does batch mode support different spins and multiplicities? #277

Description

@niklashoelter

It appears that io.atoms_to_state does not pass any of the atoms object properties to the SimState object. In FairChem, these properties are provided via atoms.info, which is a dictionary containing values such as "charge" and "spin".

Could you clarify if the batch mode also supports different spins and multiplicities? If not, would it be possible to add support for passing these properties (e.g., via atoms.info or a similar mechanism) to the SimState object?

This would be helpful for workflows that require specifying different quantum numbers for each atom or molecule in the batch.

Thank you!

Activity

  1. CompRhys commented on Oct 7, 2025

    @CompRhys
    Member

    Related issue: #253

    Short answer is at this point no but it should be possible to add via _global_attributes in SimState and correct plumbing on the ModelInterface.

  2. niklashoelter commented on Oct 7, 2025

    @niklashoelter
    ContributorAuthor

    Sorry for the duplicate issue - is there any implementation of this planned in the near future? Or are you looking for contributions?

  3. CompRhys commented on Oct 7, 2025

    @CompRhys
    Member

    Contributions always super welcome! Maybe @orionarcher could prioritise this given a few requests now if you don't feel like trying to tackle it sooner?

  4. orionarcher commented on Oct 8, 2025

    @orionarcher
    Collaborator

    Yeah I can bump this up in my priorities, clearly an in-demand feature! You are also welcome to take a crack at it @niklashoelter! Best place to start would be a proposal for how to tackle it.

  5. Nekkrad commented on Oct 28, 2025

    @Nekkrad

    Just an heads up, charge and spin are also required by force fields trained on OMOL dataset such as OrbMol and MACE-OMOL

  6. thomasloux commented on Oct 29, 2025

    @thomasloux
    Collaborator

    Should be added in _system_attributes and I would suggest to keep SimState and not create a new dataclass Molecular. Then either the value used is None, but at the moment this choice as been excluded. A default value could be used, it's the choice in fairchem model:
    https://github.com/facebookresearch/fairchem/blob/main/src/fairchem/core/calculate/ase_calculator.py#L270

    but does not seem to be a default value for OrbMol:
    https://github.com/orbital-materials/orb-models/blob/main/orb_models/forcefield/nn_util.py#L137
    https://github.com/orbital-materials/orb-models/blob/main/orb_models/forcefield/calculator.py#L100

  7. thomasloux commented on Oct 29, 2025

    @thomasloux
    Collaborator

    Main reason against creating a new dataclass is simply that it would be a pain for subclass, at least given how it's implemented at the moment. But if there is a nice way to implement that, it would probably be better than None/default value

  8. curtischong commented on Nov 10, 2025

    @curtischong
    Collaborator

    I think this was why I initially wanted to make system_attributes a dictionary of tensors in #228. (rather than just a set of attribute names) Because I saw orb do this and it's a general interface for people to add new attributes. I think we need to add 3 dictionaries to SimState, for atom_attributes, system_attributes, and global_attributes to support models that output additional properties (mag moments, even hessians)

    I've been thinking about this for a few weeks now and I needed to say this and get it off my chest.

  9. niklashoelter commented on Dec 12, 2025

    @niklashoelter
    ContributorAuthor

    Are there any news on this issue/enhancement (and #253) already or any agreement on which proposed solution might be best?

  10. orionarcher commented on Dec 12, 2025

    @orionarcher
    Collaborator

    I forgot about this thread but I added support for charge and spin in #373!

    If more model properties continue being added we may need a general solution, but for now I just added them directly to SimState.

  11. locked and limited conversation to collaborators on Dec 12, 2025
  12. converted this issue into a discussion #383 on Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions