Function Index

Callable Python interfaces are grouped below by task. Analysis wrappers accept the same input files as their command-line counterparts. Lower-level numerical functions operate on arrays or PQAnalysis objects and do not parse command-line arguments. For worked recipes, see Learn the Python API. The bundled files are in Example data.

Analysis workflows

rdf(input_file[, md_format, export_files])

Calculates the radial distribution function (RDF) using a given input file.

msd(input_file[, md_format, export_files])

Calculates the mean square displacement (MSD) using a given input file.

vacf(input_file[, md_format, export_files])

Calculates the velocity auto-correlation function (VACF) using a given input file.

vibrations(input_file[, export_files])

Run vibrational analysis from an input file.

check_momentum(trajectory_files[, output, ...])

Calculate the total linear momentum norm per frame and write it.

build_spectrum(input_file[, output, alpha, ...])

Broaden a two-column stick spectrum file and write the result.

Numerical methods

apodization_window(n_points, time_step[, ...])

Calculates the one-sided legacy apodization window.

vacf_spectrum(time, correlation[, ftsize, ...])

Calculates the legacy cosine-transform spectrum of a correlation function.

alpha_from_fwhm(fwhm)

Convert a Gaussian full width at half maximum to the exponent alpha.

fwhm_from_alpha(alpha)

Convert a Gaussian exponent alpha to the full width at half maximum.

wavenumber_grid([wavenumber_min, ...])

Build the regular wavenumber grid of the broadened spectrum.

broaden(wavenumbers, intensities, grid[, ...])

Broaden a stick spectrum on a wavenumber grid.

calculate(atom_masses, atom_coords, hessian)

Calculate wavenumbers, force constants, reduced masses and normal modes.

read_hessian_file(filename)

Read a plain square Hessian matrix.

select_mode_indices(wavenumbers[, modes, ...])

Select mode indices from a user-facing one-based mode selection.

Analysis tables

infer_output_format(filename)

Infer a requested output format from a recognized filename suffix.

read_analysis_table(filename)

Read native, CSV, TSV or XVG analysis data by content.

write_analysis_table(table, file, output_format)

Write an analysis table to an open text stream.

convert_analysis_output(input_file, output_files)

Convert one analysis table to one or more output files.

Structure and trajectory I/O

read_trajectory(filename[, md_format, ...])

API function for reading a trajectory from a file.

read_trajectory_generator(filename[, ...])

API function for building a frame generator from a trajectory file.

write_trajectory(traj[, filename, ...])

Wrapper for TrajectoryWriter to write a trajectory to a file.

calculate_frames_of_trajectory_file(filename)

Calculate the number of frames in a trajectory file.

read_restart_file(filename[, ...])

API function for reading a restart file.

write_restart_file(atomic_system[, ...])

Write an atomic system to a restart file.

read_gen_file(filename)

Function to read a gen file.

write_gen_file(system[, filename, periodic, ...])

Function to write a gen file.

read_topology_file(filename)

Function to read a topology file.

write_topology_file(bonded_topology[, ...])

Wrapper function to write a topology file.

read_box(filename)

Reads a data-style box file.

read_optimizer_file(filename)

Read a PQ optimizer output file.

write(object_to_write[, filename, mode])

API write wrapper function for writing different objects to a file.

write_box(traj[, filename, output_format])

Writes the given trajectory to the file in a selected box file format.

check_trajectory_pbc(cells)

Checks no cell in the trajectory is Cell() i.e. checks if the trajectory is never in vacuum.

check_trajectory_vacuum(cells)

Checks if all cells of the trajectory are in vacuum i.e. cell = Cell().

Format conversion

rst2xyz(restart_file[, output, print_box, ...])

Converts a restart file to a xyz file and prints it to stdout or writes it to a file.

xyz2rst(xyz_file[, velocity_file, ...])

Converts a xyz file to a restart file and prints it to stdout or writes it to a file.

xyz2gen(xyz_file[, output, periodic, mode, ...])

Converts a xyz file to a gen file and prints it to stdout or writes it to a file.

gen2xyz(gen_file[, output, md_format, ...])

Converts a gen file to a xyz file and prints it to stdout or writes it to a file.

traj2box(trajectory_files, vmd[, output, mode])

Converts multiple trajectory files to a box file and prints it to stdout or writes it to a file.

traj2extxyz(trajectory_files[, output, ...])

Converts one or more PQ xyz trajectory files to extended xyz format and prints it to stdout or writes it to a file.

traj2qmcfc(trajectory_files[, output, mode])

Converts multiple trajectory files from a PQ format to a QMCFC format and prints it to stdout or writes it to a file.

See Package Reference for classes, enums, exceptions and the generated module hierarchy.