boltzkit.utils.molecular.marginals

Functions

filter_z_matrix_columns(z_matrix, num_columns)

get_bond_angles(samples, topology, z_matrix)

get_bond_lengths(samples, topology, z_matrix)

get_dihedral_angles(samples, topology, z_matrix)

get_phi_psi_vectors(samples, topology)

Compute backbone φ (phi) and ψ (psi) torsion angles from Cartesian samples.

get_trajectory(samples, topology)

boltzkit.utils.molecular.marginals.get_trajectory(samples: ndarray, topology: Topology)[source]
boltzkit.utils.molecular.marginals.get_phi_psi_vectors(samples: ndarray, topology: Topology)[source]

Compute backbone φ (phi) and ψ (psi) torsion angles from Cartesian samples.

Parameters:
  • samples (np.ndarray) – Cartesian coordinates with shape (batch, n_atoms, 3).

  • topology (md.Topology) – MDTraj topology corresponding to the atomic coordinates.

Returns:

  • phis (np.ndarray) – Array of phi torsion angles in radians with shape (batch, n_phi).

  • psis (np.ndarray) – Array of psi torsion angles in radians with shape (batch, n_psi).

Notes

The angles are computed using MDTraj’s compute_phi and compute_psi functions. Returned angles are in radians and lie in the interval [-π, π].

boltzkit.utils.molecular.marginals.filter_z_matrix_columns(z_matrix: list[tuple[int, int, int, int]], num_columns: int, start: int = 0, filter_None=True, filter_negative=True)[source]
boltzkit.utils.molecular.marginals.get_bond_lengths(samples: ndarray, topology: Topology, z_matrix: list[tuple[int, int, int, int]]) ndarray[source]
boltzkit.utils.molecular.marginals.get_bond_angles(samples: ndarray, topology: Topology, z_matrix: list[tuple[int, int, int, int]]) ndarray[source]
boltzkit.utils.molecular.marginals.get_dihedral_angles(samples: ndarray, topology: Topology, z_matrix: list[tuple[int, int, int, int]]) ndarray[source]