Skip to content

Incorrect number of pairs and doc error in selfCoordNum #908

@giacomofiorin

Description

@giacomofiorin

Describe the bug
The number of pairs in selfCoordNum is calculated from a wrong formula:
$N_{\mathrm{pairs}} = (N-1)(N-1)$
However, it should be:
$N_{\mathrm{pairs}} = N(N-1)/2$
(as correctly reported in the doc).

Additionally, the doc wrongly lists cutoff3 as an allowed keyword.

This expression is used in two places:

  1. To defined a default upperBoundary for the selfCoordNum function, which would only apply if the user doesn't provide any.
  2. To allocate a pairlist buffer, but this is harmless because it simply results in a bigger buffer than needed.

Back-end (i.e. package that uses Colvars)
All

Colvars version
All since 020f555

Expected behavior
The number of pairs should be calculated correctly

Output log
Not message in the log: the number of pairs is used to define default boundaries for the CV internally, which would only apply if the user doesn't provide any.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugTo be used only in issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions