Public API#

View Module Index

class sire.maths.EnergyTrajectory#

This class holds the trajectory of energies, organised by timestep the energy was recorded and the types of energy (e.g. kinetic, potential, values at different lambda windows)

assign((EnergyTrajectory)arg1, (EnergyTrajectory)other) EnergyTrajectory :#
C++ signature :

SireMaths::EnergyTrajectory {lvalue} assign(SireMaths::EnergyTrajectory {lvalue},SireMaths::EnergyTrajectory)

clear_properties()#

clearProperties( (EnergyTrajectory)arg1) -> None :

C++ signature :

void clearProperties(SireMaths::EnergyTrajectory {lvalue})

clone((EnergyTrajectory)arg1) EnergyTrajectory :#
C++ signature :

SireMaths::EnergyTrajectory clone(SireMaths::EnergyTrajectory)

count((EnergyTrajectory)arg1) int :#

Return the number of time values (number of rows)

C++ signature :

int count(SireMaths::EnergyTrajectory {lvalue})

energies((EnergyTrajectory)arg1, (object)key) object :#
Return all of the energy values for the passed key (the energy-key column).

This is in the same order as the times, and is in the default internal unit

C++ signature :

QVector<double> energies(SireMaths::EnergyTrajectory {lvalue},QString)

energies( (EnergyTrajectory)arg1, (object)key, (GeneralUnit)energy_unit) -> object :
Return all of the energies fro the passed key converted to the

passed unit

C++ signature :

QVector<double> energies(SireMaths::EnergyTrajectory {lvalue},QString,SireUnits::Dimension::GeneralUnit)

get((EnergyTrajectory)arg1, (int)i) object :#
Return the time and energy components at the ith row.

Values are returned in internal units

C++ signature :

QHash<QString, double> get(SireMaths::EnergyTrajectory {lvalue},int)

get( (EnergyTrajectory)arg1, (int)i, (GeneralUnit)time_unit, (GeneralUnit)energy_unit) -> object :
Return the time and energy components at the ith row.

Values are returned in the specified units

C++ signature :

QHash<QString, double> get(SireMaths::EnergyTrajectory {lvalue},int,SireUnits::Dimension::GeneralUnit,SireUnits::Dimension::GeneralUnit)

get_labels()#

getLabels( (EnergyTrajectory)arg1, (int)i) -> object :

C++ signature :

QHash<QString, QString> getLabels(SireMaths::EnergyTrajectory {lvalue},int)

get_labels_as_numbers()#

getLabelsAsNumbers( (EnergyTrajectory)arg1, (int)i) -> object :

C++ signature :

QHash<QString, double> getLabelsAsNumbers(SireMaths::EnergyTrajectory {lvalue},int)

has_property()#

hasProperty( (EnergyTrajectory)arg1, (PropertyName)key) -> bool :

C++ signature :

bool hasProperty(SireMaths::EnergyTrajectory {lvalue},SireBase::PropertyName)

is_empty()#
isEmpty( (EnergyTrajectory)arg1) -> bool :

Return whether or not this is empty

C++ signature :

bool isEmpty(SireMaths::EnergyTrajectory {lvalue})

is_null()#

isNull( (EnergyTrajectory)arg1) -> bool :

C++ signature :

bool isNull(SireMaths::EnergyTrajectory {lvalue})

keys((EnergyTrajectory)arg1) object :#

Return all of the energy keys

C++ signature :

QStringList keys(SireMaths::EnergyTrajectory {lvalue})

label_keys()#

labelKeys( (EnergyTrajectory)arg1) -> object :

C++ signature :

QStringList labelKeys(SireMaths::EnergyTrajectory {lvalue})

labels((EnergyTrajectory)arg1, (object)key) object :#
C++ signature :

QVector<QString> labels(SireMaths::EnergyTrajectory {lvalue},QString)

labels_as_numbers()#

labelsAsNumbers( (EnergyTrajectory)arg1, (object)key) -> object :

C++ signature :

QVector<double> labelsAsNumbers(SireMaths::EnergyTrajectory {lvalue},QString)

properties((EnergyTrajectory)arg1) Properties :#
C++ signature :

SireBase::Properties properties(SireMaths::EnergyTrajectory {lvalue})

property((EnergyTrajectory)arg1, (PropertyName)key) Property :#
C++ signature :

SireBase::Property property(SireMaths::EnergyTrajectory {lvalue},SireBase::PropertyName)

property_keys()#

propertyKeys( (EnergyTrajectory)arg1) -> object :

C++ signature :

QStringList propertyKeys(SireMaths::EnergyTrajectory {lvalue})

remove_property()#

removeProperty( (EnergyTrajectory)arg1, (object)key) -> None :

C++ signature :

void removeProperty(SireMaths::EnergyTrajectory {lvalue},QString)

set((EnergyTrajectory)arg1, (GeneralUnit)time, (object)energies) None :#
Set the energies at time time to the components contained

in energies

C++ signature :

void set(SireMaths::EnergyTrajectory {lvalue},SireUnits::Dimension::GeneralUnit,QHash<QString, SireUnits::Dimension::GeneralUnit>)

set( (EnergyTrajectory)arg1, (GeneralUnit)time, (object)energies, (object)labels) -> None :

C++ signature :

void set(SireMaths::EnergyTrajectory {lvalue},SireUnits::Dimension::GeneralUnit,QHash<QString, SireUnits::Dimension::GeneralUnit>,QHash<QString, QString>)

set_property()#

setProperty( (EnergyTrajectory)arg1, (object)key, (Property)value) -> None :

C++ signature :

void setProperty(SireMaths::EnergyTrajectory {lvalue},QString,SireBase::Property)

size((EnergyTrajectory)arg1) int :#

Return the number of time values (number of rows)

C++ signature :

int size(SireMaths::EnergyTrajectory {lvalue})

times((EnergyTrajectory)arg1) object :#
Return all of the time values (the time column). This is

sorted from earliest to latest time, and is in the default internal unit

C++ signature :

QVector<double> times(SireMaths::EnergyTrajectory {lvalue})

times( (EnergyTrajectory)arg1, (GeneralUnit)time_unit) -> object :

Return all of the times converted to the passed unit

C++ signature :

QVector<double> times(SireMaths::EnergyTrajectory {lvalue},SireUnits::Dimension::GeneralUnit)

to_alchemlyb(temperature=None, energy_unit: str = 'kcal/mol')#

Return the energy trajectory as an alchemlyb-formatted pandas DataFrame

Parameters:
  • temperature (temperature) – The temperature of the simulation. If this is not set then the temperature from this table’s ensemble or temperature property will be used.

  • energy_unit (str) – Whichever of the alchemlyb energy units you want the output DataFrame to use. This is in alchemlyb format, e.g. kcal/mol, kJ/mol, or kT

Returns:

A pandas DataFrame that is compatible with alchemlyb.

Return type:

pandas.DataFrame

to_pandas(temperature=None, to_alchemlyb: bool = False, energy_unit: str = None)#

Return the energy trajectory as a pandas DataFrame

Parameters:
  • temperature (temperature) – The temperature of the simulation. If this is not set then the temperature from this table’s ensemble or temperature property will be used. Note that you only need a temperature if you are converting to alchemlyb format.

  • to_alchemlyb (bool) – This will format the DataFrame in a way that is compatible with alchemlyb. This will allow the DataFrame to be used as part of an alchemlyb free energy calculation.

  • energy_unit (str) – Whichever of the alchemlyb energy units you want the output DataFrame to use. This is in alchemlyb format, e.g. kcal/mol, kJ/mol, or kT. This is only used if to_alchemlyb is set to True.

to_string()#

toString( (EnergyTrajectory)arg1) -> object :

C++ signature :

QString toString(SireMaths::EnergyTrajectory {lvalue})

typename()#

typeName() -> str :

C++ signature :

char const* typeName()

what((EnergyTrajectory)arg1) str :#
C++ signature :

char const* what(SireMaths::EnergyTrajectory {lvalue})

class sire.maths.Matrix#

This class represents a 3x3 square matrix, used to represent 3D transformations.

Author: Christopher Woods

assign((Matrix)arg1, (Matrix)other) Matrix :#
C++ signature :

SireMaths::Matrix {lvalue} assign(SireMaths::Matrix {lvalue},SireMaths::Matrix)

at((Matrix)arg1, (int)i, (int)j) float :#

Return the element at index i,j

C++ signature :

double at(SireMaths::Matrix {lvalue},int,int)

checked_offset()#
checkedOffset( (Matrix)arg1, (int)i, (int)j) -> int :

Return the offset into the array of the value at index [i,j] Throw: SireError::invalid_index

C++ signature :

int checkedOffset(SireMaths::Matrix {lvalue},int,int)

clone((Matrix)arg1) Matrix :#
C++ signature :

SireMaths::Matrix clone(SireMaths::Matrix)

column0((Matrix)arg1) Vector :#

Return each column

C++ signature :

SireMaths::Vector column0(SireMaths::Matrix {lvalue})

column1((Matrix)arg1) Vector :#

Return each column

C++ signature :

SireMaths::Vector column1(SireMaths::Matrix {lvalue})

column2((Matrix)arg1) Vector :#

Return each column

C++ signature :

SireMaths::Vector column2(SireMaths::Matrix {lvalue})

static covariance((object)p, (object)q[, (int)n=-1]) Matrix :#

Return the covariance matrix of the passed arrays of points. This matches point p[i] against point q[i], and only calculates up to either the specified number of points, if n > 0, or to min(len(p),len(q))

C++ signature :

SireMaths::Matrix covariance(QVector<SireMaths::Vector>,QVector<SireMaths::Vector> [,int=-1])

determinant((Matrix)arg1) float :#

Return the determinant of the matrix

C++ signature :

double determinant(SireMaths::Matrix {lvalue})

diagonal((Matrix)arg1) Vector :#

Return the diagonal of this matrix

C++ signature :

SireMaths::Vector diagonal(SireMaths::Matrix {lvalue})

diagonalise((Matrix)arg1) object :#

Return the eigenvectors and eigenvalues of this matrix

C++ signature :

boost::tuples::tuple<SireMaths::Vector, SireMaths::Matrix, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> diagonalise(SireMaths::Matrix {lvalue})

enforce_symmetric()#
enforceSymmetric( (Matrix)arg1) -> None :

Ensure that this matrix is symmetric - this is done by copying the upper-right diagonal to the lower-left diagonal. Note that you should only really use this function on matricies that you know are symmetric, but may have lost some of their symmetry due to numerical rounding error

C++ signature :

void enforceSymmetric(SireMaths::Matrix {lvalue})

get_principal_axes()#
getPrincipalAxes( (Matrix)arg1) -> Matrix :

Obtain the principal axes of this matrix. This can only be performed if this matrix is symmetric. You should only call this function for matricies that you know are symmetric, as this function will assume that the matrix is symmetric, and will thus only use the upper-right diagonal of values. The returned principal axes will be sorted from the highest eigenvalue to the lowest.

C++ signature :

SireMaths::Matrix getPrincipalAxes(SireMaths::Matrix {lvalue})

static identity() Matrix :#

Return the identity matrix

C++ signature :

SireMaths::Matrix identity()

inverse((Matrix)arg1) Matrix :#

Return the inverse of this matrix. Throws a math_error if this matrix cannot be inverted.

C++ signature :

SireMaths::Matrix inverse(SireMaths::Matrix {lvalue})

is_diagonal()#
isDiagonal( (Matrix)arg1) -> bool :

Return whether or not this is a diagonal matrix

C++ signature :

bool isDiagonal(SireMaths::Matrix {lvalue})

is_identity()#
isIdentity( (Matrix)arg1) -> bool :

Return whether or not this matrix is equal to the identity matrix

C++ signature :

bool isIdentity(SireMaths::Matrix {lvalue})

is_symmetric()#
isSymmetric( (Matrix)arg1) -> bool :

Return whether or not this is a symmetric matrix

C++ signature :

bool isSymmetric(SireMaths::Matrix {lvalue})

is_zero()#
isZero( (Matrix)arg1) -> bool :

Return whether or not this matrix is all zero

C++ signature :

bool isZero(SireMaths::Matrix {lvalue})

offset((Matrix)arg1, (int)i, (int)j) int :#
C++ signature :

int offset(SireMaths::Matrix {lvalue},int,int)

row0((Matrix)arg1) Vector :#

Return each row

C++ signature :

SireMaths::Vector row0(SireMaths::Matrix {lvalue})

row1((Matrix)arg1) Vector :#

Return each row

C++ signature :

SireMaths::Vector row1(SireMaths::Matrix {lvalue})

row2((Matrix)arg1) Vector :#

Return each row

C++ signature :

SireMaths::Vector row2(SireMaths::Matrix {lvalue})

set_to_identity()#
setToIdentity( (Matrix)arg1) -> None :

Set the matrix to identity

C++ signature :

void setToIdentity(SireMaths::Matrix {lvalue})

single_value_decomposition()#
singleValueDecomposition( (Matrix)arg1) -> object :

Return the single value decomposition of this matrix. This calculates the decomposition of this matrix into U S V^T, returning U, S and V in the tuple

C++ signature :

boost::tuples::tuple<SireMaths::Matrix, SireMaths::Matrix, SireMaths::Matrix, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> singleValueDecomposition(SireMaths::Matrix {lvalue})

svd((Matrix)arg1) object :#

Return the single value decomposition of this matrix. This calculates the decomposition of this matrix into U S V^T, returning U, S and V in the tuple

C++ signature :

boost::tuples::tuple<SireMaths::Matrix, SireMaths::Matrix, SireMaths::Matrix, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> svd(SireMaths::Matrix {lvalue})

to_string()#
toString( (Matrix)arg1) -> object :

Return a QString representation of the matrix

C++ signature :

QString toString(SireMaths::Matrix {lvalue})

trace((Matrix)arg1) Vector :#

Return the trace of the matrix

C++ signature :

SireMaths::Vector trace(SireMaths::Matrix {lvalue})

transpose((Matrix)arg1) Matrix :#

Return the transpose of the matrix

C++ signature :

SireMaths::Matrix transpose(SireMaths::Matrix {lvalue})

typename()#

typeName() -> str :

C++ signature :

char const* typeName()

what((Matrix)arg1) str :#
C++ signature :

char const* what(SireMaths::Matrix {lvalue})

xx((Matrix)arg1) float :#
C++ signature :

double xx(SireMaths::Matrix {lvalue})

xy((Matrix)arg1) float :#
C++ signature :

double xy(SireMaths::Matrix {lvalue})

xz((Matrix)arg1) float :#
C++ signature :

double xz(SireMaths::Matrix {lvalue})

yx((Matrix)arg1) float :#
C++ signature :

double yx(SireMaths::Matrix {lvalue})

yy((Matrix)arg1) float :#
C++ signature :

double yy(SireMaths::Matrix {lvalue})

yz((Matrix)arg1) float :#
C++ signature :

double yz(SireMaths::Matrix {lvalue})

static zero() Matrix :#

Return the null matrix

C++ signature :

SireMaths::Matrix zero()

zx((Matrix)arg1) float :#
C++ signature :

double zx(SireMaths::Matrix {lvalue})

zy((Matrix)arg1) float :#
C++ signature :

double zy(SireMaths::Matrix {lvalue})

zz((Matrix)arg1) float :#
C++ signature :

double zz(SireMaths::Matrix {lvalue})

class sire.maths.RanGenerator#

This class provides a thread-safe, copyable and streamable random number generator. Copies are guaranteed to produce different random number sequences (thus the possibility of accidental repeat random numbers is removed).

Author: Christopher Woods

assign((RanGenerator)arg1, (RanGenerator)other) RanGenerator :#
C++ signature :

SireMaths::RanGenerator {lvalue} assign(SireMaths::RanGenerator {lvalue},SireMaths::RanGenerator)

clone((RanGenerator)arg1) RanGenerator :#
C++ signature :

SireMaths::RanGenerator clone(SireMaths::RanGenerator)

detach((RanGenerator)arg1) None :#

Detach from shared storage

C++ signature :

void detach(SireMaths::RanGenerator {lvalue})

get_state()#
getState( (RanGenerator)arg1) -> object :

Return the current state of the random number generator. Use this if you truly wish to get reproducible sequences of random numbers

C++ signature :

QVector<unsigned int> getState(SireMaths::RanGenerator {lvalue})

static global() RanGenerator :#

Return a reference to the global random number generator (shared between all threads)

C++ signature :

SireMaths::RanGenerator global()

lock((RanGenerator)arg1) None :#

Take hold of the generator lock. Only you can now generate random numbers while this lock is held

C++ signature :

void lock(SireMaths::RanGenerator {lvalue})

locked_rand((RanGenerator)arg1) float :#
Return a random real number on [0,1]. Should only be called while

you hold the generator lock

C++ signature :

double locked_rand(SireMaths::RanGenerator {lvalue})

locked_rand( (RanGenerator)arg1, (float)maxval) -> float :

Return a random real number on [0,maxval]. Should only be called while you hold the generator lock

C++ signature :

double locked_rand(SireMaths::RanGenerator {lvalue},double)

locked_rand( (RanGenerator)arg1, (float)minval, (float)maxval) -> float :

Return a random real number on [minval,maxval]. Should only be called while you hold the generator lock

C++ signature :

double locked_rand(SireMaths::RanGenerator {lvalue},double,double)

locked_rand_norm()#
locked_randNorm( (RanGenerator)arg1) -> float :

Return a random number generated from the normal distribution with mean 0 and standard deviation 1. You must hold the generator lock when calling this function

C++ signature :

double locked_randNorm(SireMaths::RanGenerator {lvalue})

locked_randNorm( (RanGenerator)arg1, (float)minval, (float)maxval) -> float :

Return a random number from the normal distribution with supplied mean and variance. You must hold the generator lock when calling this function

C++ signature :

double locked_randNorm(SireMaths::RanGenerator {lvalue},double,double)

locked_vector_on_sphere()#
locked_vectorOnSphere( (RanGenerator)arg1) -> Vector :

Return a random vector on the unit sphere. You must hold the generator lock when calling this function

C++ signature :

SireMaths::Vector locked_vectorOnSphere(SireMaths::RanGenerator {lvalue})

locked_vectorOnSphere( (RanGenerator)arg1, (float)radius) -> Vector :

Return a random vector on the sphere with radius radius. You must hold the generator lock when calling this function

C++ signature :

SireMaths::Vector locked_vectorOnSphere(SireMaths::RanGenerator {lvalue},double)

nrand((RanGenerator)arg1, (int)n) object :#

Return an array of n random numbers on [0,1]

C++ signature :

QVector<double> nrand(SireMaths::RanGenerator {lvalue},int)

nrand( (RanGenerator)arg1, (int)n, (float)maxval) -> object :

Return an array of n random numbers on [0,maxval]

C++ signature :

QVector<double> nrand(SireMaths::RanGenerator {lvalue},int,double)

nrand( (RanGenerator)arg1, (int)n, (float)minval, (float)maxval) -> object :

Return an array of n random numbers on [minval,maxval]

C++ signature :

QVector<double> nrand(SireMaths::RanGenerator {lvalue},int,double,double)

nrand( (RanGenerator)arg1, (object)result) -> None :

Fill the passed array of doubles with random numbers. This replaces each value in the array with a random number on [0,1]

C++ signature :

void nrand(SireMaths::RanGenerator {lvalue},QVector<double> {lvalue})

nrand( (RanGenerator)arg1, (object)result, (float)maxval) -> None :

Fill the passed array of doubles with random numbers. This replaces each value in the array with a random number on [0,maxval]

C++ signature :

void nrand(SireMaths::RanGenerator {lvalue},QVector<double> {lvalue},double)

nrand( (RanGenerator)arg1, (object)result, (float)minval, (float)maxval) -> None :

Fill the passed array of doubles with random numbers. This replaces each value in the array with a random number on [minval,maxval]

C++ signature :

void nrand(SireMaths::RanGenerator {lvalue},QVector<double> {lvalue},double,double)

nrand_norm()#
nrandNorm( (RanGenerator)arg1, (object)result, (float)mean, (float)variance) -> None :

Fill the passed array with random numbers drawn from the normal distribution with supplied mean and variance

C++ signature :

void nrandNorm(SireMaths::RanGenerator {lvalue},QVector<double> {lvalue},double,double)

nrandNorm( (RanGenerator)arg1, (int)n, (float)mean, (float)variance) -> object :

Return an array of N random numbers drawn from the normal distribution with supplied mean and variance

C++ signature :

QVector<double> nrandNorm(SireMaths::RanGenerator {lvalue},int,double,double)

nvector_on_sphere()#
nvectorOnSphere( (RanGenerator)arg1, (object)result) -> None :

Fill the passed array with random vectors on a unit sphere

C++ signature :

void nvectorOnSphere(SireMaths::RanGenerator {lvalue},QVector<SireMaths::Vector> {lvalue})

nvectorOnSphere( (RanGenerator)arg1, (object)result, (float)radius) -> None :

Fill the passed array with random vectors on a sphere with radius radius

C++ signature :

void nvectorOnSphere(SireMaths::RanGenerator {lvalue},QVector<SireMaths::Vector> {lvalue},double)

nvectorOnSphere( (RanGenerator)arg1, (int)n) -> object :

Return an array of n random vectors on a unit sphere

C++ signature :

QVector<SireMaths::Vector> nvectorOnSphere(SireMaths::RanGenerator {lvalue},int)

nvectorOnSphere( (RanGenerator)arg1, (int)n, (float)radius) -> object :

Return an array of n random vectors on a sphere of radius radius

C++ signature :

QVector<SireMaths::Vector> nvectorOnSphere(SireMaths::RanGenerator {lvalue},int,double)

rand((RanGenerator)arg1) float :#

Return a random real number on [0,1]

C++ signature :

double rand(SireMaths::RanGenerator {lvalue})

rand( (RanGenerator)arg1, (float)maxval) -> float :

Return a random real number on [0,maxval]

C++ signature :

double rand(SireMaths::RanGenerator {lvalue},double)

rand( (RanGenerator)arg1, (float)minval, (float)maxval) -> float :

Return a random real number on [minval,maxval]

C++ signature :

double rand(SireMaths::RanGenerator {lvalue},double,double)

rand53((RanGenerator)arg1) float :#

Return a high-precision random real number on [0,1)

C++ signature :

double rand53(SireMaths::RanGenerator {lvalue})

rand53( (RanGenerator)arg1, (float)maxval) -> float :

Return a high-precision random real number on [0,1)

C++ signature :

double rand53(SireMaths::RanGenerator {lvalue},double)

rand53( (RanGenerator)arg1, (float)minval, (float)maxval) -> float :

Return a high-precision random real number on [minval,maxval)

C++ signature :

double rand53(SireMaths::RanGenerator {lvalue},double,double)

rand_bool()#
randBool( (RanGenerator)arg1) -> bool :

Return a random true or false value

C++ signature :

bool randBool(SireMaths::RanGenerator {lvalue})

rand_int()#
randInt( (RanGenerator)arg1) -> int :

Return a random 32bit unsigned integer in [0,2^32 - 1]

C++ signature :

unsigned int randInt(SireMaths::RanGenerator {lvalue})

randInt( (RanGenerator)arg1, (int)maxval) -> int :

Return a random 32bit unsigned integer in [0,maxval]

C++ signature :

unsigned int randInt(SireMaths::RanGenerator {lvalue},unsigned int)

randInt( (RanGenerator)arg1, (int)minval, (int)maxval) -> int :

Return a random 32bit integer in [minval,maxval]

C++ signature :

int randInt(SireMaths::RanGenerator {lvalue},int,int)

rand_int64()#
randInt64( (RanGenerator)arg1) -> int :

Return a random 64bit unsigned integer on [0,2^64 - 1]

C++ signature :

unsigned long long randInt64(SireMaths::RanGenerator {lvalue})

randInt64( (RanGenerator)arg1, (int)maxval) -> int :

Return a random 64bit unsigned integer on [0,maxval]

C++ signature :

unsigned long long randInt64(SireMaths::RanGenerator {lvalue},unsigned long long)

randInt64( (RanGenerator)arg1, (int)minval, (int)maxval) -> int :

Return a random 64bit integer on [minval,maxval]

C++ signature :

long long randInt64(SireMaths::RanGenerator {lvalue},long long,long long)

rand_norm()#
randNorm( (RanGenerator)arg1) -> float :

Return a random number generated from the normal distribution with mean 0 and standard deviation 1

C++ signature :

double randNorm(SireMaths::RanGenerator {lvalue})

randNorm( (RanGenerator)arg1, (float)mean, (float)variance) -> float :

Return a random number from the normal distribution with supplied mean and variance.

C++ signature :

double randNorm(SireMaths::RanGenerator {lvalue},double,double)

seed((RanGenerator)arg1) None :#
See the generator with a new, random seed - this will detach

this explicitly shared copy of the generator

C++ signature :

void seed(SireMaths::RanGenerator {lvalue})

seed( (RanGenerator)arg1, (int)seed) -> None :

Seed the generator with s - this will detach this explicitly shared copy of the generator

C++ signature :

void seed(SireMaths::RanGenerator {lvalue},unsigned int)

seed( (RanGenerator)arg1, (object)seed) -> None :

Seed the generator with seed - this will detach this explicitly shared copy of the generator

C++ signature :

void seed(SireMaths::RanGenerator {lvalue},QVector<unsigned int>)

seed( (RanGenerator)arg1, (RanGenerator)other) -> None :

Seed the generator with another generator - this really just copies the generator as they are all explicit copies of one another

C++ signature :

void seed(SireMaths::RanGenerator {lvalue},SireMaths::RanGenerator)

seed_global()#
seedGlobal() -> None :

Seed the global random number generator

C++ signature :

void seedGlobal()

seedGlobal( (int)seed) -> None :

Seed the global random number generator

C++ signature :

void seedGlobal(unsigned int)

seedGlobal( (object)seed) -> None :

Seed the global random number generator

C++ signature :

void seedGlobal(QVector<unsigned int>)

seedGlobal( (RanGenerator)other) -> None :

Seed the global random number generator

C++ signature :

void seedGlobal(SireMaths::RanGenerator)

set_state()#
setState( (RanGenerator)arg1, (object)state) -> None :

Load the state into this generator - the state must have been produced by the getState() function above. This will detach this copy from shared storage. Throw: SireError::incompatible_error

C++ signature :

void setState(SireMaths::RanGenerator {lvalue},QVector<unsigned int>)

typename()#

typeName() -> str :

C++ signature :

char const* typeName()

unlock((RanGenerator)arg1) None :#

Release the generator lock

C++ signature :

void unlock(SireMaths::RanGenerator {lvalue})

vector_on_sphere()#
vectorOnSphere( (RanGenerator)arg1) -> Vector :

Return a random vector on the unit sphere

C++ signature :

SireMaths::Vector vectorOnSphere(SireMaths::RanGenerator {lvalue})

vectorOnSphere( (RanGenerator)arg1, (float)radius) -> Vector :

Return a random vector on the sphere with radius radius

C++ signature :

SireMaths::Vector vectorOnSphere(SireMaths::RanGenerator {lvalue},double)

what((RanGenerator)arg1) str :#
C++ signature :

char const* what(SireMaths::RanGenerator {lvalue})

class sire.maths.Sphere(*args, **kwargs)[source]#

A sphere in 3D space

class sire.maths.Torsion#

This class represents a torsion in three dimensional space, e.g. four points in space, not necessarily lying in a plane. A torsion is used to calculate dihedral angles (imagine each point is an atom). I am not happy with the name of this class, and welcome suggestions :-)

Author: Christopher Woods

angle((Torsion)arg1) object :#

Return the torsion angle of this torsion (the torsion angle 0-1-2-3 around the 1-2 line)

C++ signature :

SireUnits::Dimension::PhysUnit<0, 0, 0, 0, 0, 0, 1> angle(SireMaths::Torsion {lvalue})

at((Torsion)arg1, (int)i) Vector :#

Return the point at index i

C++ signature :

SireMaths::Vector at(SireMaths::Torsion {lvalue},int)

clone((Torsion)arg1) Torsion :#
C++ signature :

SireMaths::Torsion clone(SireMaths::Torsion)

count((Torsion)arg1) int :#

Return the number of points in a torsion (4)

C++ signature :

int count(SireMaths::Torsion {lvalue})

improper_angle()#
improperAngle( (Torsion)arg1) -> object :

Return the improper angle of this torsion (the acute angle between the vector 0-1 and the plane formed by 1-2-3)

C++ signature :

SireUnits::Dimension::PhysUnit<0, 0, 0, 0, 0, 0, 1> improperAngle(SireMaths::Torsion {lvalue})

line03((Torsion)arg1) Line :#

Return the line from point 0 to point 3

C++ signature :

SireMaths::Line line03(SireMaths::Torsion {lvalue})

line12((Torsion)arg1) Line :#

Return the line from point 1 to point 2

C++ signature :

SireMaths::Line line12(SireMaths::Torsion {lvalue})

point((Torsion)arg1, (int)i) Vector :#

Return the point at index i

C++ signature :

SireMaths::Vector point(SireMaths::Torsion {lvalue},int)

to_string()#
toString( (Torsion)arg1) -> object :

Return a string representation of this torsion

C++ signature :

QString toString(SireMaths::Torsion {lvalue})

triangle1((Torsion)arg1) Triangle :#

Return the triangle around point 1, i.e. point0-point1-point2

C++ signature :

SireMaths::Triangle triangle1(SireMaths::Torsion {lvalue})

triangle2((Torsion)arg1) Triangle :#

Return the triangle around point 2, i.e. point1-point2-point3

C++ signature :

SireMaths::Triangle triangle2(SireMaths::Torsion {lvalue})

typename()#

typeName() -> str :

C++ signature :

char const* typeName()

vector03((Torsion)arg1) Vector :#

Return the vector from point 0 to point 3

C++ signature :

SireMaths::Vector vector03(SireMaths::Torsion {lvalue})

vector12((Torsion)arg1) Vector :#

Return the vector from point 1 to point 2

C++ signature :

SireMaths::Vector vector12(SireMaths::Torsion {lvalue})

what((Torsion)arg1) str :#
C++ signature :

char const* what(SireMaths::Torsion {lvalue})

class sire.maths.Transform#

This class holds everything needed to apply a transformation on a set of points. This holds the amount by which to translate the points, together with the center of rotation and amount by which to rotate

Author: Christopher Woods

apply((Transform)arg1, (Vector)point) Vector :#

Apply this transformation to the passed point, returning the result

C++ signature :

SireMaths::Vector apply(SireMaths::Transform {lvalue},SireMaths::Vector)

apply( (Transform)arg1, (object)points) -> object :

Apply this transformation to all of the passed points, returning the results

C++ signature :

QVector<SireMaths::Vector> apply(SireMaths::Transform {lvalue},QVector<SireMaths::Vector>)

assign((Transform)arg1, (Transform)other) Transform :#
C++ signature :

SireMaths::Transform {lvalue} assign(SireMaths::Transform {lvalue},SireMaths::Transform)

clone((Transform)arg1) Transform :#
C++ signature :

SireMaths::Transform clone(SireMaths::Transform)

inverse((Transform)arg1) Transform :#

Return the inverse of this transformation

C++ signature :

SireMaths::Transform inverse(SireMaths::Transform {lvalue})

is_null()#
isNull( (Transform)arg1) -> bool :

Return whether this is null (has no transformation)

C++ signature :

bool isNull(SireMaths::Transform {lvalue})

is_zero()#
isZero( (Transform)arg1) -> bool :

Return whether this is zero (has no transformation)

C++ signature :

bool isZero(SireMaths::Transform {lvalue})

reverse((Transform)arg1, (Vector)point) Vector :#

Apply the inverse of this transformation to the passed point, returning the result

C++ signature :

SireMaths::Vector reverse(SireMaths::Transform {lvalue},SireMaths::Vector)

reverse( (Transform)arg1, (object)points) -> object :

Apply this transformation to all of the passed points, returning the results

C++ signature :

QVector<SireMaths::Vector> reverse(SireMaths::Transform {lvalue},QVector<SireMaths::Vector>)

rotation_center()#
rotationCenter( (Transform)arg1) -> Vector :

Return the center of rotation

C++ signature :

SireMaths::Vector rotationCenter(SireMaths::Transform {lvalue})

rotation_matrix()#
rotationMatrix( (Transform)arg1) -> Matrix :

Return the rotation matrix

C++ signature :

SireMaths::Matrix rotationMatrix(SireMaths::Transform {lvalue})

rotation_quaternion()#
rotationQuaternion( (Transform)arg1) -> Quaternion :

Return the rotation matrix as a quaternion

C++ signature :

SireMaths::Quaternion rotationQuaternion(SireMaths::Transform {lvalue})

to_string()#

toString( (Transform)arg1) -> object :

C++ signature :

QString toString(SireMaths::Transform {lvalue})

translation_delta()#
translationDelta( (Transform)arg1) -> Vector :

Return the amount by which to translate

C++ signature :

SireMaths::Vector translationDelta(SireMaths::Transform {lvalue})

typename()#

typeName() -> str :

C++ signature :

char const* typeName()

what((Transform)arg1) str :#
C++ signature :

char const* what(SireMaths::Transform {lvalue})

class sire.maths.Triangle#

This class represents a triangle in three-dimensional space. (or three points)

Author: Christopher Woods

angle((Triangle)arg1) object :#
C++ signature :

SireUnits::Dimension::PhysUnit<0, 0, 0, 0, 0, 0, 1> angle(SireMaths::Triangle {lvalue})

angle0((Triangle)arg1) object :#
C++ signature :

SireUnits::Dimension::PhysUnit<0, 0, 0, 0, 0, 0, 1> angle0(SireMaths::Triangle {lvalue})

angle1((Triangle)arg1) object :#
C++ signature :

SireUnits::Dimension::PhysUnit<0, 0, 0, 0, 0, 0, 1> angle1(SireMaths::Triangle {lvalue})

angle2((Triangle)arg1) object :#
C++ signature :

SireUnits::Dimension::PhysUnit<0, 0, 0, 0, 0, 0, 1> angle2(SireMaths::Triangle {lvalue})

at((Triangle)arg1, (int)i) Vector :#
C++ signature :

SireMaths::Vector at(SireMaths::Triangle {lvalue},int)

clone((Triangle)arg1) Triangle :#
C++ signature :

SireMaths::Triangle clone(SireMaths::Triangle)

count((Triangle)arg1) int :#
C++ signature :

int count(SireMaths::Triangle {lvalue})

line0((Triangle)arg1) Line :#
C++ signature :

SireMaths::Line line0(SireMaths::Triangle {lvalue})

line1((Triangle)arg1) Line :#
C++ signature :

SireMaths::Line line1(SireMaths::Triangle {lvalue})

line2((Triangle)arg1) Line :#
C++ signature :

SireMaths::Line line2(SireMaths::Triangle {lvalue})

point((Triangle)arg1, (int)i) Vector :#
C++ signature :

SireMaths::Vector point(SireMaths::Triangle {lvalue},int)

to_string()#
toString( (Triangle)arg1) -> object :

Return a string representation of the triangle

C++ signature :

QString toString(SireMaths::Triangle {lvalue})

typename()#

typeName() -> str :

C++ signature :

char const* typeName()

vector((Triangle)arg1) Vector :#
C++ signature :

SireMaths::Vector vector(SireMaths::Triangle {lvalue})

vector0((Triangle)arg1) Vector :#
C++ signature :

SireMaths::Vector vector0(SireMaths::Triangle {lvalue})

vector1((Triangle)arg1) Vector :#
C++ signature :

SireMaths::Vector vector1(SireMaths::Triangle {lvalue})

vector2((Triangle)arg1) Vector :#
C++ signature :

SireMaths::Vector vector2(SireMaths::Triangle {lvalue})

what((Triangle)arg1) str :#
C++ signature :

char const* what(SireMaths::Triangle {lvalue})

class sire.maths.Vector(*args, **kwargs)[source]#

A 3D point in space, or a 3D vector in space. This is a simple class containing 3 double precision values. These values represent points in units of Angstroms.

sire.maths.align((object)p, (object)q[, (bool)fit=True]) object :#
C++ signature :

QVector<SireMaths::Vector> align(QVector<SireMaths::Vector>,QVector<SireMaths::Vector> [,bool=True])

sire.maths.create_quaternion(angle=None, axis=None, matrix=None, quaternion=None)[source]#

Create a quaternion from the passed angle and axis of the passed rotation matrix. If a rotation matrix is passed then this will ignore the passed angle and axis. If a quaternion is passed then this will ignore the matrix, angle and axis arguments.

angle: (float or angle)

The angle to rotate by - this is interpreted as degrees if you pass in a float. Otherwise use sire.units.degrees or sire.units.radians to specify the angle unit. This is superseded by the matrix and quaternion arguments.

axis: sire.maths.Vector (or anything that can convert to a Vector)

The vector about which to rotate. If this is not specified, and no other rotation specification is used, then the rotation is about the z axis. This is superseded by the matrix and quaternion arguments.

quaternion: sire.maths.Quaternion

The Quaternion description of the rotation. Note that, if you pass this, then the angle, axis and matrix arguments will be ignored.

matrix: sire.maths.Matrix

The 3x3 rotation matrix that describes the rotation. Note that, if you pass this, then the angle and axis arguments will be ignored. This is superseded by the quaternion argument.

Returns: sire.maths.Quaternion

The quaternion that represents the rotation

sire.maths.get_alignment()#

getAlignment( (object)p, (object)q [, (bool)fit=True]) -> Transform :

C++ signature :

SireMaths::Transform getAlignment(QVector<SireMaths::Vector>,QVector<SireMaths::Vector> [,bool=True])

sire.maths.kabasch((object)p, (object)q) Matrix :#
C++ signature :

SireMaths::Matrix kabasch(QVector<SireMaths::Vector>,QVector<SireMaths::Vector>)

sire.maths.kabasch_fit()#

kabaschFit( (object)p, (object)q) -> Transform :

C++ signature :

SireMaths::Transform kabaschFit(QVector<SireMaths::Vector>,QVector<SireMaths::Vector>)

sire.maths.rotate(point, angle=None, axis=None, matrix=None, quaternion=None, center=None)[source]#

Rotate the passed point by the passed angle and axis, or the passed matrix, or the passed quaternion, optionally centering the rotation about the passed center.

point: sire.maths.Vector

The vector to be rotated

angle: (float or angle)

The angle to rotate by - this is interpreted as degrees if you pass in a float. Otherwise use sire.units.degrees or sire.units.radians to specify the angle unit. This is superseded by the matrix and quaternion arguments.

axis: sire.maths.Vector (or anything that can convert to a Vector)

The vector about which to rotate. If this is not specified, and no other rotation specification is used, then the rotation is about the z axis. This is superseded by the matrix and quaternion arguments.

quaternion: sire.maths.Quaternion

The Quaternion description of the rotation. Note that, if you pass this, then the angle, axis and matrix arguments will be ignored.

matrix: sire.maths.Matrix

The 3x3 rotation matrix that describes the rotation. Note that, if you pass this, then the angle and axis arguments will be ignored. This is superseded by the quaternion argument.

center: sire.maths.Vector

The center of rotation. Defaults to (0,0,0) if not set.

Returns: sire.maths.Vector

The rotated vector

sire.maths.pi π (3.141592653589793)#

Convert a string or number to a floating point number, if possible.