dyson.representations.dynamic#

Container for a dynamic representation.

Classes

Dynamic(grid, array[, reduction, component, ...])

Dynamic representation.

class dyson.representations.dynamic.Dynamic(grid: _TGrid, array: Array, reduction: Reduction = Reduction.NONE, component: Component = Component.FULL, hermitian: bool = False)[source]#

Bases: BaseRepresentation, Generic[_TGrid]

Dynamic representation.

The dynamic representation is a set of arrays in some physical space at each point in a time or frequency grid. This class contains the arrays and the grid information.

classmethod from_lehmann(lehmann: Lehmann, grid: _TGrid, reduction: Reduction = Reduction.NONE, component: Component = Component.FULL) Dynamic[_TGrid][source]#

Construct a dynamic representation from a Lehmann representation.

Parameters:
  • lehmann – The Lehmann representation to convert.

  • grid – The grid on which the dynamic representation is defined.

  • reduction – The reduction of the dynamic representation.

  • component – The component of the dynamic representation.

Returns:

A dynamic representation.

property nphys: int#

Get the number of physical degrees of freedom.

property grid: _TGrid#

Get the grid on which the dynamic representation is defined.

property array: Array#

Get the array of values at each point in the grid.

property reduction: Reduction#

Get the reduction of the dynamic representation.

property component: Component#

Get the component of the dynamic representation.

property hermitian: bool#

Get a boolean indicating if the system is Hermitian.

property dtype: dtype#

Get the data type of the array.

copy(deep: bool = True, reduction: Reduction | None = None, component: Component | None = None) Dynamic[_TGrid][source]#

Return a copy of the dynamic representation.

Parameters:
  • deep – Whether to return a deep copy of the energies and couplings.

  • component – The component of the dynamic representation.

  • reduction – The reduction of the dynamic representation.

Returns:

A new dynamic representation.

as_dynamic(component: Component | None = None, reduction: Reduction | None = None) Dynamic[_TGrid][source]#

Return the dynamic representation with the specified component and reduction.

Parameters:
  • component – The component of the dynamic representation.

  • reduction – The reduction of the dynamic representation.

Returns:

A new dynamic representation with the specified component and reduction.

rotate(rotation: Array | tuple[Array, Array]) Dynamic[_TGrid][source]#

Rotate the dynamic representation.

Parameters:

rotation – The rotation matrix to apply to the array. If the matrix has three dimensions, the first dimension is used to rotate on the left, and the second dimension is used to rotate on the right.

Returns:

A new dynamic representation with the rotated array.