Skip to content

Instantly share code, notes, and snippets.

@Stephen2252Ro
Stephen2252Ro / double2.h
Created April 14, 2022 12:47 — forked from jmbr/double2.h
Simple example of the RATTLE algorithm
#ifndef DOUBLE2_H
#define DOUBLE2_H
#include <cmath>
#include <ostream>
#include <initializer_list>
struct double2 {
union {
@Stephen2252Ro
Stephen2252Ro / compute_distance_matrix.py
Created April 14, 2022 12:35 — forked from jmbr/compute_distance_matrix.py
Compute RMS distances between frames in an mdtraj Trajectory object
import numpy as np
import mdtraj as md
import tqdm
def compute_distance_matrix(trajectory: md.Trajectory) -> np.ndarray:
"""Compute distance matrix.
"""
topology = trajectory.topology