5.2.1. atoms.Atoms

class eminus.atoms.Atoms(atom, pos, ecut=30, a=20, spin=None, charge=0, unrestricted=None, center=False, verbose=None)[source]

Atoms object that holds all system and cell parameters.

Parameters:
  • atom

    Atom symbols.

    A string can be given, e.g., with CH4 that will be parsed to ["C", "H", "H", "H", "H"]. When calculating atoms one can directly provide the charge, e.g., with Li-q3.

  • pos – Atom positions.

Keyword Arguments:
  • ecut

    Cut-off energy.

    Defaults to 30 Eh (ca. 816 eV).

  • a

    Cell size or vacuum size.

    Floats will create a cubic unit cell. Defaults to a 20 a0 (ca. 10.5 A) cubic cell. Scaled lattice vectors can be given to build a custom cell.

  • spin

    Number of unpaired electrons.

    This is the difference between the number of up and down electrons.

  • charge – Charge of the system.

  • unrestricted

    Handling of spin.

    False for restricted, True for unrestricted, and None for automatic detection.

  • center

    Center the system inside the cell.

    Aligns the geometric center of mass with the center of the call and rotates the system, such that its geometric moment of inertia aligns with the coordinate axes. Can be one of bool, “shift”, and “rotate”.

  • verbose

    Level of output.

    Can be one of “critical”, “error”, “warning”, “info” (default), or “debug”. An integer value can be used as well, where larger numbers mean more output, starting from 0. None will use the global logger verbosity value.

Methods

I(W[, ik])

Backward transformation from reciprocal space to real-space.

Idag(W[, ik, full])

Conjugated backward transformation from real-space to reciprocal space.

J(W[, ik, full])

Forward transformation from real-space to reciprocal space.

Jdag(W[, ik])

Conjugated forward transformation from reciprocal space to real-space.

K(W, ik)

Preconditioning operator with k-point dependency.

L(W[, ik])

Laplacian operator with k-point dependency.

Linv(W)

Inverse Laplacian operator.

O(W)

Overlap operator.

T(W, dr)

Translation operator.

build()

Build all parameters of the Atoms object.

clear()

Initialize or clear parameters that will be built out of the inputs.

kernel()

Build all parameters of the Atoms object.

recenter([center])

Recenter the system inside the cell.

set_k(k[, wk])

Interface to set custom k-points.

view(*args, **kwargs)

Unified display function.

write(filename, *args, **kwargs)

Unified file writer function.

Attributes

G

G-vectors.

G2

Squared magnitudes of G-vectors.

G2c

Truncated squared magnitudes of G-vectors.

Gk2

Squared magnitudes of G+k-vectors.

Gk2c

Truncated squared magnitudes of G+k-vectors.

Natoms

Number of atoms.

Ns

Number of real-space grid points.

Omega

Unit cell volume.

Sf

Structure factor per atom.

Z

Valence charge per atom.

a

Cell/Vacuum size.

active

Mask for active G-vectors.

atom

Atom symbols.

center

Enables centering the system in the cell.

charge

System charge.

dV

Volume element to multiply when integrating field properties.

ecut

Cut-off energy.

f

Occupation numbers per state.

pos

Atom positions.

r

Real-space sampling points.

s

Real-space sampling of the cell.

spin

Number of unpaired electrons.

unrestricted

Enables unrestricted spin handling.

verbose

Verbosity level.

occ

Occupations object.

kpts

KPoints object.

is_built

Determines the Atoms object build status.

I(W, ik=-1)

Backward transformation from reciprocal space to real-space.

This operator acts on the options 3, 4, 5, and 6.

Reference: Comput. Phys. Commun. 128, 1.

Parameters:
  • atoms – Atoms object.

  • W – Expansion coefficients of unconstrained wave functions in reciprocal space.

Keyword Arguments:

ik – k-point index.

Returns:

The operator applied on W.

Idag(W, ik=-1, full=False)

Conjugated backward transformation from real-space to reciprocal space.

This operator acts on options 1 and 2.

Reference: Comput. Phys. Commun. 128, 1.

Parameters:
  • atoms – Atoms object.

  • W – Expansion coefficients of unconstrained wave functions in reciprocal space.

Keyword Arguments:
  • ik – k-point index.

  • full – Whether to transform in the full or in the active space.

Returns:

The operator applied on W.

J(W, ik=-1, full=True)

Forward transformation from real-space to reciprocal space.

This operator acts on options 1 and 2.

Reference: Comput. Phys. Commun. 128, 1.

Parameters:
  • atoms – Atoms object.

  • W – Expansion coefficients of unconstrained wave functions in reciprocal space.

Keyword Arguments:
  • ik – k-point index.

  • full – Whether to transform in the full or in the active space.

Returns:

The operator applied on W.

Jdag(W, ik=-1)

Conjugated forward transformation from reciprocal space to real-space.

This operator acts on the options 3, 4, 5, and 6.

Reference: Comput. Phys. Commun. 128, 1.

Parameters:
  • atoms – Atoms object.

  • W – Expansion coefficients of unconstrained wave functions in reciprocal space.

Keyword Arguments:

ik – k-point index.

Returns:

The operator applied on W.

K(W, ik)

Preconditioning operator with k-point dependency.

This operator acts on options 3 and 5.

Reference: Comput. Mater. Sci. 14, 4.

Parameters:
  • atoms – Atoms object.

  • W – Expansion coefficients of unconstrained wave functions in reciprocal space.

  • ik – k-point index.

Returns:

The operator applied on W.

L(W, ik=-1)

Laplacian operator with k-point dependency.

This operator acts on options 3 and 5.

Reference: Comput. Phys. Commun. 128, 1.

Parameters:
  • atoms – Atoms object.

  • W – Expansion coefficients of unconstrained wave functions in reciprocal space.

Keyword Arguments:

ik – k-point index.

Returns:

The operator applied on W.

Linv(W)

Inverse Laplacian operator.

This operator acts on options 3 and 4.

Reference: Comput. Phys. Commun. 128, 1.

Parameters:
  • atoms – Atoms object.

  • W – Expansion coefficients of unconstrained wave functions in reciprocal space.

Returns:

The operator applied on W.

O(W)

Overlap operator.

This operator acts on the options 3, 4, 5, and 6.

Reference: Comput. Phys. Commun. 128, 1.

Parameters:
  • atoms – Atoms object.

  • W – Expansion coefficients of unconstrained wave functions in reciprocal space.

Returns:

The operator applied on W.

T(W, dr)

Translation operator.

This operator acts on options 5 and 6.

Reference: https://ccrma.stanford.edu/~jos/st/Shift_Theorem.html

Parameters:
  • atoms – Atoms object.

  • W – Expansion coefficients of unconstrained wave functions in reciprocal space.

  • ik – k-point index.

  • dr – Real-space shifting vector.

Returns:

The operator applied on W.

build()[source]

Build all parameters of the Atoms object.

clear()[source]

Initialize or clear parameters that will be built out of the inputs.

kernel()

Build all parameters of the Atoms object.

recenter(center=None)[source]

Recenter the system inside the cell.

Keyword Arguments:

center – Point to center the system around.

set_k(k, wk=None)[source]

Interface to set custom k-points.

Parameters:

k – k-point coordinates.

Keyword Arguments:

wk – k-point weights.

property G

G-vectors.

property G2

Squared magnitudes of G-vectors.

property G2c

Truncated squared magnitudes of G-vectors.

property Gk2

Squared magnitudes of G+k-vectors.

property Gk2c

Truncated squared magnitudes of G+k-vectors.

property Natoms

Number of atoms.

property Ns

Number of real-space grid points.

property Omega

Unit cell volume.

property Sf

Structure factor per atom.

property Z

Valence charge per atom.

property a

Cell/Vacuum size.

property active

Mask for active G-vectors.

property atom

Atom symbols.

property center

Enables centering the system in the cell.

property charge

System charge.

property dV

Volume element to multiply when integrating field properties.

property ecut

Cut-off energy.

property f

Occupation numbers per state.

is_built

Determines the Atoms object build status.

kpts

KPoints object.

occ

Occupations object.

property pos

Atom positions.

property r

Real-space sampling points.

property s

Real-space sampling of the cell.

property spin

Number of unpaired electrons.

property unrestricted

Enables unrestricted spin handling.

property verbose

Verbosity level.