treams._core.PhysicsArray

treams._core.PhysicsArray#

class treams._core.PhysicsArray(arr, ann=(), /, **kwargs)[source]#

Physics-aware array.

A physics aware array is a special type of :class`treams.util.AnnotatedArray`. Additionally to keeping track of the annotations, it is enhanced by the ability to create suiting linear operators to perform tasks like rotations, translations, or expansions into different basis sets and by applying special rules for the physical properties of PhysicsDict upon matrix multiplications, see also __matmul__().

__init__(arr, ann=(), /, **kwargs)[source]#

Initialization.

Methods

__init__(arr[, ann])

Initialization.

all([axis, dtype, out, keepdims, where])

Test if all elements (along an axis) are True.

any([axis, dtype, out, keepdims, where])

Test if any element (along an axis) is True.

astype(*args, **kwargs)

Return array as given type.

conj(*args, **kwargs)

Complex conjugate elementwise.

conjugate(*args, **kwargs)

Complex conjugate elementwise.

cumprod([axis, dtype, out])

Cumulative product of elements (along an axis).

cumsum([axis, dtype, out])

Cumulative sum of elements (along an axis).

diagonal([offset, axis1, axis2])

Get the diagonal of the array.

flatten([order])

Flatten array to one dimension.

max([axis, out, keepdims, initial, where])

Maximum (along an axis).

min([axis, out, keepdims, initial, where])

Minimum (along an axis).

prod([axis, dtype, out, keepdims, initial, ...])

Product of elements (along an axis).

relax(*args[, mro])

Try creating AnnotatedArray subclasses if possible.

sum([axis, dtype, out, keepdims, initial, where])

Sum of elements (along an axis).

swapaxes(axis1, axis2)

trace([offset, axis1, axis2, dtype, out])

Trace of an array.

transpose([axes])

Transpose array dimensions.

Attributes

T

Transpose.

ann

Array annotations.

bfield

Attach an operator to an object as attribute.

changepoltype

Polarization change matrix, see also treams.operators.ChangePoltype.

dfield

Attach an operator to an object as attribute.

efield

Attach an operator to an object as attribute.

expand

Expansion matrix, see also treams.operators.Expand.

expandlattice

Lattice expansion matrix, see also treams.operators.ExpandLattice.

ffield

Field evaluation matrix, see also treams.operators.EField.

gfield

Attach an operator to an object as attribute.

hfield

Attach an operator to an object as attribute.

imag

Imaginary part of the array.

ndim

Number of array dimensions.

permute

Permutation matrix, see also treams.operators.Permute.

real

Real part of the array.

rotate

Rotation matrix, see also treams.operators.Rotate.

shape

Array shape.

size

Array size.

translate

Translation matrix, see also treams.operators.Translate.