0% found this document useful (0 votes)
26 views6 pages

The Cell Object

The Cell object represents a unit cell of a crystal structure defined by three lattice vectors. It behaves like a 3x3 array containing the lattice vectors. Common functionality includes obtaining the lengths and angles of the lattice vectors, the cell volume, and transforming between Cartesian and scaled positions within the unit cell. The Cell can be used to define reciprocal lattices and band structure paths.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views6 pages

The Cell Object

The Cell object represents a unit cell of a crystal structure defined by three lattice vectors. It behaves like a 3x3 array containing the lattice vectors. Common functionality includes obtaining the lengths and angles of the lattice vectors, the cell volume, and transforming between Cartesian and scaled positions within the unit cell. The Cell can be used to define reciprocal lattices and band structure paths.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

index | modules | gitlab | page source

The Cell object


The Cell object represents three la ce vectors forming a parallel epiped.

atoms.cell is a Cell object.

Examples:

>>> from ase.build import bulk


>>> cell = bulk('Au').cell
>>> cell
Cell([[0.0, 2.04, 2.04], [2.04, 0.0, 2.04], [2.04, 2.04, 0.0]], pbc=True)

The cell behaves like a 3x3 array when used like one:

>>> cell[:]
array([[0. , 2.04, 2.04],
[2.04, 0. , 2.04],
[2.04, 2.04, 0. ]])

Common func onality:

>>> cell.lengths()
array([2.88499567, 2.88499567, 2.88499567])
>>> cell.angles()
array([60., 60., 60.])
>>> cell.volume
16.979328000000002

class ase.cell.Cell(array) [source]

Parallel epipedal unit cell of up to three dimensions.

This object resembles a 3x3 array whose [i, j]-th element is the jth Cartesian coordinate of the ith
unit vector.

Cells of less than three dimensions are represented by placeholder unit vectors that are zero.

Create cell.

Parameters:

array: 3x3 arraylike object

The three cell vectors: cell[0], cell[1], and cell[2].

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
angles() [source]

Return an array with the three angles alpha, beta, and gamma.

area(i) [source]

Area spanned by the two vectors with index different from i.

areas() [source]

Areas spanned by cell vector pairs (1, 2), (2, 0), and (0, 2).

classmethod ascell(cell) [source]

Return argument as a Cell object. See ase.cell.Cell.new() .

A new Cell object is created if necessary.

bandpath(path: Op onal[str] = None, npoints: Op onal[int] = None, *, density: Op onal[float] = None,


special_points: Op onal[Mapping[str, Sequence[float]]] = None, eps: float = 0.0002, pbc: Union[bool,
Sequence[bool]] = True)→ BandPath [source]

Build a BandPath for this cell.

If special points are None, determine the Bravais la ce of this cell and return a suitable
Brillouin zone path with standard special points.

If special special points are given, interpolate the path directly from the available data.

Parameters:

path: string

String of special point names defining the path, e.g. ‘GXL’.

npoints: int

Number of points in total. Note that at least one point is added for each special point in the
path.

density: float

density of kpoints along the path in Å⁻¹.

special_points: dict

Dic onary mapping special points to scaled kpoint coordinates. For example {'G': [0, 0,

0], 'X': [1, 0, 0]} .

eps: float

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Tolerance for determining Bravais la ce.

pbc: three bools

Whether cell is periodic in each direc on. Normally not necessary. If cell has three nonzero
cell vectors, use e.g. pbc=[1, 1, 0] to request a 2D bandpath nevertheless.

Example

>>> cell = Cell.fromcellpar([4, 4, 4, 60, 60, 60])


>>> cell.bandpath('GXW', npoints=20)
BandPath(path='GXW', cell=[3x3], special_points={GKLUWX}, kpts=[20x3])

cartesian_positions(scaled_posi ons)→ ndarray [source]

Calculate Cartesian posi ons from scaled posi ons.

cellpar(radians=False) [source]

Get unit cell parameters. Sequence of 6 numbers.

First three are unit cell vector lengths and second three are angles between them:

[len(a), len(b), len(c), angle(b,c), angle(a,c), angle(a,b)]

in degrees.

See also ase.geometry.cell.cell_to_cellpar() .

complete() [source]

Convert missing cell vectors into orthogonal unit vectors.

copy() [source]

Return a copy of this cell.

classmethod fromcellpar(cellpar, ab_normal=(0, 0, 1), a_direc on=None) [source]

Return new Cell from cell lengths and angles.

See also cellpar_to_cell() .

get_bravais_lattice(eps=0.0002, *, pbc=True) [source]

Return BravaisLattice for this cell:

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
>>> cell = Cell.fromcellpar([4, 4, 4, 60, 60, 60])
>>> print(cell.get_bravais_lattice())
FCC(a=5.65685)

 Note

The Bravais la ce object follows the AFlow conven ons.


cell.get_bravais_lattice().tocell() may differ from the original cell by a permuta on or
other opera on which maps it to the AFlow conven on. For example, the orthorhombic
la ce enforces a < b < c.

To build a bandpath for a par cular cell, use ase.cell.Cell.bandpath() instead of this
method. This maps the kpoints back to the original input cell.

property handedness: int

Sign of the determinant of the matrix of cell vectors.

1 for right-handed cells, -1 for le , and 0 for cells that do not span three dimensions.

lengths() [source]

Return the length of each la ce vector as an array.

mask() [source]

Boolean mask of which cell vectors are nonzero.

minkowski_reduce() [source]

Minkowski-reduce this cell, returning new cell and mapping.

See also ase.geometry.minkowski_reduction.minkowski_reduce() .

classmethod new(cell=None) [source]

Create new cell from any parameters.

If cell is three numbers, assume three lengths with right angles.

If cell is six numbers, assume three lengths, then three angles.

If cell is 3x3, assume three cell vectors.

niggli_reduce(eps=1e-05) [source]

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Niggli reduce this cell, returning a new cell and mapping.

See also ase.build.tools.niggli_reduce_cell() .

normal(i) [source]

Normal vector of the two vectors with index different from i.

This is the cross product of those vectors in cyclic order from i.

normals() [source]

Normal vectors of each axis as a 3x3 matrix.

property orthorhombic: bool

Return whether this cell is represented by a diagonal matrix.

permute_axes(permuta on) [source]

Permute axes of cell.

property rank: int

“Return the dimension of the cell.

Equal to the number of nonzero la ce vectors.

reciprocal()→ Cell [source]

Get reciprocal la ce as a Cell object.

The reciprocal cell is defined such that

cell.reciprocal() @ cell.T == np.diag(cell.mask())

within machine precision.

Does not include factor of 2 pi.

scaled_positions(posi ons)→ ndarray [source]

Calculate scaled posi ons from Cartesian posi ons.

The scaled posi ons are the posi ons given in the basis of the cell vectors. For the purpose of
defining the basis, cell vectors that are zero will be replaced by unit vectors as per complete() .

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
standard_form() [source]

Rotate axes such that unit cell is lower triangular. The cell handedness is preserved.

A lower-triangular cell with posi ve diagonal entries is a canonical (i.e. unique) descrip on. For
a le -handed cell the diagonal entries are nega ve.

Returns:

rcell: the standardized cell object

Q: ndarray

The orthogonal transforma on. Here, rcell @ Q = cell, where cell is the input cell and rcell is
the lower triangular (output) cell.

uncomplete(pbc) [source]

Return new cell, zeroing cell vectors where not periodic.

property volume: float

Get the volume of this cell.

If there are less than 3 la ce vectors, return 0.

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com

You might also like