schrodinger.application.desmond.measurement module

A class for simple arithmetic with uncertainty.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.desmond.measurement.Measurement(value, uncertainty=nan)

Bases: object

Basic method for uncertainty propagation: Say we have a few measurements: x1, x2, x3, …, and they each has a uncertainty: d1, d2, d3, …, respectively. Now we have a function: f( x1, x2, x3, … ), we want to get the value of this function with given measurements x1, x2, x3, … and also the uncertainty of the result of f. A way to do this is the following:

  1. We need to get the contribution to the uncertainty of f result due to each measurement: fd1, fd2, fd3, … This can be given by the following equations:

    fd1 = df / dx1 * d1 fd2 = df / dx2 * d2 fd3 = df / dx3 * d3 …

    where `df / dx1’ is a partial derivative of f with respect to x1.

  2. With fd1, fd2, fd3, …, we can get the uncertainty of f using this equation:

    fd = math.sqrt( fd1 * fd1 + fd2 * fd2 + fd3 * fd3 + … )

__init__(value, uncertainty=nan)
to_string(num_digits)

Convert Measurement to string with given num_digits decimal places

classmethod from_string(s)

Convert string (e.g: “5.0+-0.3”) to Measurement

schrodinger.application.desmond.measurement.string2measurement(s)

Convert string (e.g: “5.0+-0.3”) to Measurement

This method is deprecated in favor of Measurement.from_string