nifty8.operators.contraction_operator module#

class ContractionOperator(domain, spaces, power=0)[source]#

Bases: LinearOperator

A LinearOperator which sums up fields into the direction of subspaces.

This Operator sums up a field which is defined on a DomainTuple to a DomainTuple which is a subset of the former.

Parameters:
  • domain (Domain, tuple of Domain or DomainTuple)

  • spaces (None, int or tuple of int) – The elements of “domain” which are contracted. If None, everything is contracted

  • power (int, default=0) – If nonzero, the fields defined on self.domain are weighted with the specified power along the submdomains which are contracted.

__init__(domain, spaces, power=0)[source]#
apply(x, mode)[source]#

Applies the Operator to a given x, in a specified mode.

Parameters:
  • x (nifty8.field.Field) – The input Field, defined on the Operator’s domain or target, depending on mode.

  • mode (int) –

    • TIMES: normal application

    • ADJOINT_TIMES: adjoint application

    • INVERSE_TIMES: inverse application

    • ADJOINT_INVERSE_TIMES or INVERSE_ADJOINT_TIMES: adjoint inverse application

Returns:

The processed Field defined on the Operator’s target or domain, depending on mode.

Return type:

nifty8.field.Field

IntegrationOperator(domain, spaces)[source]#

A LinearOperator which integrates fields into the direction of subspaces.

This Operator integrates a field which is defined on a DomainTuple to a DomainTuple which is a subset of the former.

Parameters:
  • domain (Domain, tuple of Domain or DomainTuple)

  • spaces (None, int or tuple of int) – The elements of “domain” which are contracted. If None, everything is contracted