vayesta.core.symmetry

Submodules

vayesta.core.symmetry.group

class vayesta.core.symmetry.group.SymmetryGroup(mol, xtol=1e-08, check_basis=True, check_label=False)[source]

Bases: object

Detect symmetry group automatically (use spglib?).

property natom
property nao
property dimension
compare_atoms(atom1, atom2, check_basis=None, check_label=None)[source]

Compare atom symbol and (optionally) basis between atom1 and atom2.

get_closest_atom(coords)[source]

pos in internal coordinates.

add_rotation(order, axis, center, unit='ang')[source]
set_translations(nimages)[source]

Set translational symmetry.

Parameters:

nimages (array(3)) – Number of translationally symmetric images in the direction of the first, second, and third lattice vector.

clear_translations()[source]

vayesta.core.symmetry.operation

class vayesta.core.symmetry.operation.SymmetryOperation(group)[source]

Bases: object

property mol
property xtol
property natom
property nao
call_wrapper(a, *args, axis=0, **kwargs)[source]

Common pre- and post-processing for all symmetries.

Symmetry specific processing is performed in call_kernel.

call_kernel(*args, **kwargs)[source]
apply_to_point(r0)[source]
get_atom_reorder()[source]

Reordering of atoms for a given rotation.

Returns:

  • reorder (list)

  • inverse (list)

get_ao_reorder(atom_reorder)[source]
rotate_angular_orbitals(a, rotmats)[source]

Rotate between orbitals in p,d,f,… shells.

class vayesta.core.symmetry.operation.SymmetryIdentity(group)[source]

Bases: SymmetryOperation

apply_to_point(r0)[source]
get_atom_reorder()[source]

Reordering of atoms for a given rotation.

Returns:

  • reorder (list)

  • inverse (list)

call_kernel(*args, **kwargs)
call_wrapper(a, *args, axis=0, **kwargs)

Common pre- and post-processing for all symmetries.

Symmetry specific processing is performed in call_kernel.

get_ao_reorder(atom_reorder)
property mol
property nao
property natom
rotate_angular_orbitals(a, rotmats)

Rotate between orbitals in p,d,f,… shells.

property xtol
class vayesta.core.symmetry.operation.SymmetryInversion(group, center=(0, 0, 0))[source]

Bases: SymmetryOperation

apply_to_point(r0)[source]
call_kernel(a)[source]
call_wrapper(a, *args, axis=0, **kwargs)

Common pre- and post-processing for all symmetries.

Symmetry specific processing is performed in call_kernel.

get_ao_reorder(atom_reorder)
get_atom_reorder()

Reordering of atoms for a given rotation.

Returns:

  • reorder (list)

  • inverse (list)

property mol
property nao
property natom
rotate_angular_orbitals(a, rotmats)

Rotate between orbitals in p,d,f,… shells.

property xtol
class vayesta.core.symmetry.operation.SymmetryReflection(group, axis, center=(0, 0, 0))[source]

Bases: SymmetryOperation

as_matrix()[source]

Householder matrix. Does not account for shifted origin!

apply_to_point(r0)[source]

Householder transformation.

call_kernel(a)[source]
call_wrapper(a, *args, axis=0, **kwargs)

Common pre- and post-processing for all symmetries.

Symmetry specific processing is performed in call_kernel.

get_ao_reorder(atom_reorder)
get_atom_reorder()

Reordering of atoms for a given rotation.

Returns:

  • reorder (list)

  • inverse (list)

property mol
property nao
property natom
rotate_angular_orbitals(a, rotmats)

Rotate between orbitals in p,d,f,… shells.

property xtol
class vayesta.core.symmetry.operation.SymmetryRotation(group, rotvec, center=(0, 0, 0))[source]

Bases: SymmetryOperation

as_matrix()[source]
apply_to_point(r0)[source]
call_kernel(a)[source]
call_wrapper(a, *args, axis=0, **kwargs)

Common pre- and post-processing for all symmetries.

Symmetry specific processing is performed in call_kernel.

get_ao_reorder(atom_reorder)
get_atom_reorder()

Reordering of atoms for a given rotation.

Returns:

  • reorder (list)

  • inverse (list)

property mol
property nao
property natom
rotate_angular_orbitals(a, rotmats)

Rotate between orbitals in p,d,f,… shells.

property xtol
class vayesta.core.symmetry.operation.SymmetryTranslation(group, vector, boundary=None, atom_reorder=None, ao_reorder=None)[source]

Bases: SymmetryOperation

call_kernel(a)[source]
inverse()[source]
property lattice_vectors
property inv_lattice_vectors
property boundary_phases
property vector_xyz

Translation vector in real-space coordinates (unit = Bohr).

property inverse_atom_reorder
apply_to_point(r0)
call_wrapper(a, *args, axis=0, **kwargs)

Common pre- and post-processing for all symmetries.

Symmetry specific processing is performed in call_kernel.

get_atom_reorder()[source]

Reordering of atoms for a given translation.

Returns:

  • reorder (list)

  • inverse (list)

  • phases (list)

property mol
property nao
property natom
rotate_angular_orbitals(a, rotmats)

Rotate between orbitals in p,d,f,… shells.

property xtol
get_ao_reorder(atom_reorder=None, atom_reorder_phases=None)[source]

vayesta.core.symmetry.symmetry

vayesta.core.symmetry.symmetry.unit_vector(vector)[source]

Returns the unit vector of the vector.

vayesta.core.symmetry.symmetry.angle_between(v1, v2)[source]

Returns the angle in radians between vectors ‘v1’ and ‘v2’:

>>> angle_between((1, 0, 0), (0, 1, 0))

1.5707963267948966 >>> angle_between((1, 0, 0), (1, 0, 0)) 0.0 >>> angle_between((1, 0, 0), (-1, 0, 0)) 3.141592653589793

class vayesta.core.symmetry.symmetry.Symmetry(mf, log=<Logger vayesta.core.symmetry.symmetry (INFO)>)[source]

Bases: object

property mol
property cell
property natom
property natom_unique
get_unique_atoms()[source]
primitive_lattice_vectors()[source]
atom_coords(unit='Bohr')[source]
lattice_vectors()[source]
property pbcndims

0 = No PBC, 1 = 1D 2 = 2D, 3 = 3D.

Type:

Number of periodic boundary conditions

property has_pbc
compare_atoms(atom1, atom2, respect_labels=False, respect_basis=True)[source]

Compare atom symbol and (optionally) basis between atom1 and atom2.

find_subcells(respect_basis=True, respect_labels=False, respect_dm1=None, r_tol=1e-05, dm1_tol=1e-06)[source]

Find subcells within cell, with unit cell vectors parallel to the supercell.

Parameters:
  • respect_basis (bool, optional) – If True, the basis functions are considered when determining the symmetry. Default: True.

  • respect_labels (bool, optional) – If True, the labels of atoms (such as “H1” or “C*”) are considered when determining the symmetry. Default: False.

  • respect_dm1 (array or None, optional) – If a (tuple of) density-matrix is passed, it is considered when determining the symmetry. Default: None.

  • r_tol (float, optional) – Real space tolerance to determine if two atoms are symmetry equivalent. Default: 1e-5.

  • dm1_tol (float, optional) – Density-matrix tolerance to determine the symmetry. Default: 1e-6.

Returns:

nsubcells – Number of primitive subcells in (a0, a1, a2) direction.

Return type:

tuple(3)

vayesta.core.symmetry.tsymmetry

Translational symmetry module.

vayesta.core.symmetry.tsymmetry.to_bohr(a, unit)[source]
vayesta.core.symmetry.tsymmetry.get_mesh_tvecs(cell, tvecs, unit='Ang')[source]
vayesta.core.symmetry.tsymmetry.loop_tvecs(cell, tvecs, unit='Ang', include_origin=False)[source]
vayesta.core.symmetry.tsymmetry.tsymmetric_atoms(cell, rvecs, xtol=1e-08, unit='Ang', check_element=True, check_basis=True)[source]

Get indices of translationally symmetric atoms.

Parameters:
  • cell (pyscf.pbc.gto.Cell) – Unit cell.

  • rvecs ((3, 3) array) – The rows contain the real space translation vectors.

  • xtol (float, optional) – Tolerance to identify equivalent atom positions. Default: 1e-8

  • unit (['Ang', 'Bohr']) – Unit of rvecs and xtol. Default: ‘Ang’.

Returns:

indices – List with length cell.natm. Each element represents the lowest atom index of a translationally symmetry equivalent atom.

Return type:

list

vayesta.core.symmetry.tsymmetry.compare_atoms(cell, atm1, atm2, check_basis=True)[source]
vayesta.core.symmetry.tsymmetry.reorder_atoms(cell, tvec, boundary=None, unit='Ang', check_basis=True)[source]

Reordering of atoms for a given translation.

Parameters:

tvec – Translation vector.

Returns:

  • reorder (list)

  • inverse (list)

vayesta.core.symmetry.tsymmetry.reorder_atoms2aos(cell, atom_reorder, atom_phases)[source]
vayesta.core.symmetry.tsymmetry.reorder_aos(cell, tvec, unit='Ang')[source]
vayesta.core.symmetry.tsymmetry.get_tsymmetry_op(cell, tvec, unit='Ang')[source]

Module contents