nifty8.operators.value_inserter module#

class ValueInserter(target, index)[source]#

Bases: LinearOperator

Inserts one value into a field which is zero otherwise.

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

  • index (iterable of int) – The index of the target into which the value of the domain shall be inserted.

__init__(target, index)[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