pyvibdmc.analysis.analyze_wfn

Classes

AnalyzeWfn

Module Contents

class pyvibdmc.analysis.analyze_wfn.AnalyzeWfn(coordinates)[source]
xx
static dot_pdt(v1, v2)[source]

Takes two stacks of vectors and dots the pairs of vectors together

static exp_val(operator, dw)[source]

Calculation of an expectation value using Monte Carlo Integration

Parameters:
  • operator (np.ndarray) – array of bond lengths, bond angles, potentials, dipole moments, etc.

  • dw (np.ndarray) – Descendant Weights

Returns:

Expectation value (single float)

bond_length(atm1, atm2)[source]

Computes the norm of the vector between two atoms.

Parameters:
  • atm1 (int) – desired atom number 1 (python index starts at 0)

  • atm2 (int) – desired atom number 2

Returns:

norm of x[atm1]-x[atm2]

bond_angle(atm1, atm_vert, atm3)[source]

Calculate atm1 - atm_vert - atm3 angle

Parameters:
  • atm1 (int) – Index of the first external atom (python index starts at 0)

  • atm_vert (int) – Index of the atom at the vertex (python index starts at 0)

  • atm3 (int) – Index of the second external atom (python index starts at 0)

Returns:

Angle in radians

bisecting_vector(atm1, atm_vert, atm3)[source]

Get normalized bisecting vector of two vectors (two bond lengths). It is assumed that the two flanking atoms have the same central atom. |b|*a + |a|*b

Parameters:
  • atm1 (int) – Index of the first external atom (python index starts at 0)

  • atm_vert (int) – Index of the atom at the vertex (python index starts at 0)

  • atm3 (int) – Index of the second external atom (python index starts at 0)

Returns:

normalized bisecting vector

dihedral(atm_1, atm_2, atm_3, atm_4)[source]

Defines the dihedral coordinate using 3 vectors. vec_1 and vec_2 form a plane, and vec_2 and vec_3 form a plane. The dihedral angle is the calculated angle betwen these two planes. The sign is dependent on the direction of the vectors, as the cross product is taken between the two pairs of two vectors https://stackoverflow.com/questions/20305272/dihedral-torsion-angle-from-four-points-in-cartesian-coordinates-in-python https://en.wikipedia.org/w/index.php?title=Dihedral_angle&oldid=689165217#Angle_between_three_vectors

get_component(atm, xyz)[source]

Get x, y, or z component of a vector that corresponds to a particular atom in some predetermined cooridnate system.

Parameters:
  • atm – atom’s index in numpy array

  • xyz (int) – Either 0 (x), 1 (y), or 2 (z)

Type:

int

Returns:

vector of x, y, or z components of a stack of vectors

static cart_to_spherical(vecc)[source]

Takes stack of cartesian vectors (nx3) and translates them to stack of r theta phi coordinates, with the assumption that you are already in the coordinate frame you desire.

static projection_1d(attr, desc_weights, bins=25, range=None, normalize=True)[source]

Project the probability amplitude onto a particular coordinate, 1D Histogram.

Parameters:
  • attr (bool) – the coordinate to be projected onto (bond length, bond angle, etc.)

  • desc_weights (np.ndarray) – the descendant weights for psi**2

  • bins – Number of bins in histogram (higher number, more number of walkers needed)

  • range (tuple) – Range over which attr is histogrammed

  • normalize – Normalizes the wave function along coordinate

Returns:

np.ndarray of shape (bin_num-1 x 2), bin centers, amplitude at bin centers

static projection_2d(attr1, attr2, desc_weights, bins=[25, 25], range=None, normalize=True)[source]

Project the probability amplitude onto a 2 coordinates, 2D Histogram.

Parameters:
  • attr1 – coordinate 1 to be projected onto (bond length, bond angle, etc.)

  • attr2 – coordinate 2 to be projected onto (bond length, bond angle, etc.)

  • desc_weights (np.ndarray) – the descendant weights for psi**2

  • bins – Number of bins for histogram in both directions (higher number, more number of walkers needed)

  • range (list of two tuples) – Range over which attr is histogrammed

  • normalize – Normalizes the wave function along both coordinates (integrated area under 2D surface is 1)

Returns:

np.ndarray of shape (bin_num-1 x 2), bin centers x, bin centers y, and then the 2D array with amplitude.