chemcoord.AsymmetricUnitCartesian

class chemcoord.AsymmetricUnitCartesian(frame=None, atoms=None, coords=None, index=None, metadata=None, _metadata=None)[source]

Manipulate cartesian coordinates while preserving the point group.

This class has all the methods of a Cartesian, with one additional get_cartesian() method and contains only one member of each symmetry equivalence class.

__init__(frame=None, atoms=None, coords=None, index=None, metadata=None, _metadata=None)

How to initialize a Cartesian instance.

Parameters:
  • frame (pd.DataFrame) – A Dataframe with at least the columns ['atom', 'x', 'y', 'z']. Where 'atom' is a string for the elementsymbol.

  • atoms (sequence) – A list of strings. (Elementsymbols)

  • coords (sequence) – A n_atoms * 3 array containg the positions of the atoms. Note that atoms and coords are mutually exclusive to frame. Besides atoms and coords have to be both either None or not None.

Returns:

A new cartesian instance.

Return type:

Cartesian

Methods

__init__([frame, atoms, coords, index, ...])

How to initialize a Cartesian instance.

add_data([new_cols])

Adds a column with the requested data.

align(other[, mass_weight])

Align two Cartesians.

apply(*args, **kwargs)

Applies function along input axis of DataFrame.

applymap(*args, **kwargs)

Applies function elementwise

basistransform(new_basis[, old_basis, ...])

Transform the frame to a new basis.

change_numbering(rename_dict[, inplace])

Return the reindexed version of Cartesian.

check_absolute_refs(construction_table)

Checks first three rows of construction_table for linear references

check_dihedral(construction_table)

Checks, if the dihedral defining atom is colinear.

copy()

correct_absolute_refs(construction_table)

Reindexe construction_table if linear reference in first three rows present.

correct_dihedral(construction_table[, ...])

Reindexe the dihedral defining atom if linear reference is used.

cut_cuboid([a, b, c, origin, ...])

Cut a cuboid specified by edge and radius.

cut_sphere([radius, origin, outside_sliced, ...])

Cut a sphere specified by origin and radius.

fragmentate([give_only_index, use_lookup])

Get the indices of non bonded parts in the molecule.

from_ase_atoms(atoms)

Create an instance of the own class from an ase molecule

from_pymatgen_molecule(molecule)

Create an instance of the own class from a pymatgen molecule

get_align_transf(other[, mass_weight, centered])

Return the rotation matrix that aligns other onto self.

get_angle_degrees(indices)

Return the angles between given atoms.

get_ase_atoms()

Create an Atoms instance of the ase library

get_asymmetric_unit([eq])

get_barycenter()

Return the mass weighted average location.

get_bond_lengths(indices)

Return the distances between given atoms.

get_bonds([self_bonding_allowed, offset, ...])

Return a dictionary representing the bonds.

get_cartesian()

Return a Cartesian where all members of a symmetry equivalence class are inserted back in.

get_centroid()

Return the average location.

get_construction_table([fragment_list, ...])

Create a construction table for a Zmatrix.

get_coordination_sphere(index_of_atom[, ...])

Return a Cartesian of atoms in the n-th coordination sphere.

get_dihedral_degrees(indices[, start_row])

Return the dihedrals between given atoms.

get_distance_to([origin, other_atoms, sort])

Return a Cartesian with a column for the distance from origin.

get_electron_number([charge])

Return the number of electrons.

get_equivalent_atoms([tolerance])

Returns sets of equivalent atoms with symmetry operations

get_fragment(list_of_indextuples[, ...])

Get the indices of the atoms in a fragment.

get_grad_zmat(construction_table[, as_function])

Return the gradient for the transformation to a Zmatrix.

get_inertia()

Calculate the inertia tensor and transforms along rotation axes.

get_pointgroup([tolerance])

Returns a PointGroup object for the molecule.

get_pymatgen_molecule()

Create a Molecule instance of the pymatgen library

get_shortest_distance(other)

Calculate the shortest distance between self and other

get_total_mass()

Returns the total mass in g/mol.

get_without(fragments[, use_lookup])

Return self without the specified fragments.

get_zmat([construction_table, use_lookup])

Transform to internal coordinates.

has_same_sumformula(other)

Determines if other has the same sumformula

insert(loc, column, value[, ...])

Insert column into molecule at specified location.

partition_chem_env([n_sphere, use_lookup])

This function partitions the molecule into subsets of the same chemical environment.

read_cjson(buf)

Read a cjson file or a dictionary.

read_xyz(buf[, start_index, get_bonds, ...])

Read a file of coordinate information.

reindex_similar(other[, n_sphere])

Reindex other to be similarly indexed as self.

replace([to_replace, value, inplace, limit, ...])

Replace values given in 'to_replace' with 'value'.

reset_index()

Resets the index to 0...n

restrict_bond_dict(bond_dict)

Restrict a bond dictionary to self.

set_index(keys[, drop, append, inplace, ...])

Set the DataFrame index (row labels) using one or more existing columns.

sort_index([axis, level, ascending, ...])

Sort object by labels (along an axis)

sort_values(by[, axis, ascending, inplace, ...])

Sort by the values along either axis

subs(*args)

Substitute a symbolic expression in ['x', 'y', 'z']

symmetrize([max_n, tolerance, epsilon])

Returns a symmetrized molecule

to_cjson([buf])

Write a cjson file or return dictionary.

to_latex([buf, columns, col_space, header, ...])

Render a DataFrame to a tabular environment table.

to_string([buf, columns, col_space, header, ...])

Render a DataFrame to a console-friendly tabular output.

to_xyz([buf, sort_index, index, header, ...])

Write xyz-file

to_zmat(*args, **kwargs)

Deprecated, use get_zmat()

view([viewer, use_curr_dir])

View your molecule.

write_xyz(*args, **kwargs)

Deprecated, use to_xyz()

Attributes

columns

Returns the columns.

dtypes

empty

iloc

Label based indexing

index

Returns the index.

loc

Label based indexing

shape