Skip to content

[Bug]: complex number forces produced #273

Description

@jkalayan

Bug Report

When combined_forcetorque and customised_axes are True, complex numbers are produced for some translated forces, for molecules that are one united-atom in size/ not covalently bonded to other united atoms.


To Reproduce


YAML configuration

run1:
  
  top_traj_file: ["~/GAFF/hydrogen-sulphide/molecules.top", "~/GAFF/hydrogen-sulphide/trajectory.crd"]
  force_file: "~/GAFF/hydrogen-sulphide/forces.frc"
  file_format: "MDCRD"
  end: 1
  temperature: 213
  water_entropy: False
  kcal_force_units: True
  combined_forcetorque: True
  customised_axes: True

Actual output

CodeEntropy/CodeEntropy/levels.py:421 in get_weighted_forces 
                             |   418 │   │                                                                                                             │
                             │   419 │   │   for atom in bead.atoms:                                                                                   │
                             │   420 │   │   │   forces_local = np.matmul(trans_axes, data_container.atoms[atom.index].force)                          │
                             │ ❱ 421 │   │   │   forces_trans += forces_local                                                                          │
                             │   422 │   │                                                                                                             │
                             │   423 │   │   if highest_level:                                                                                         │
                             │   424 │   │   │   forces_trans = force_partitioning * forces_trans   
UFuncTypeError: Cannot cast ufunc 'add' output from dtype('complex128') to dtype('float64') with casting rule 'same_kind'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions