pymor.operators.block

Module Contents

class pymor.operators.block.BlockColumnOperator(blocks, range_spaces=None, source_spaces=None, solver=None, name=None)[source]

Bases: BlockOperatorBase

A column vector of arbitrary Operators.

blocked_range = True[source]
blocked_source = False[source]
class pymor.operators.block.BlockDiagonalOperator(blocks, solver=None, name=None)[source]

Bases: BlockOperator

Block diagonal Operator of arbitrary Operators.

This is a specialization of BlockOperator for the block diagonal case.

Methods

apply

Apply the operator to a VectorArray.

apply_adjoint

Apply the adjoint operator.

assemble

Assemble the operator for given parameter values.

apply(U, mu=None)[source]

Apply the operator to a VectorArray.

Parameters:
Returns:

|VectorArray| of the operator evaluations.

apply_adjoint(V, mu=None)[source]

Apply the adjoint operator.

For any given linear Operator op, parameter values mu and VectorArrays U, V in the source resp. range we have:

op.apply_adjoint(V, mu).dot(U) == V.inner(op.apply(U, mu))

Thus, when op is represented by a matrix M, apply_adjoint is given by left-multiplication of (the complex conjugate of) M with V.

Parameters:
  • VVectorArray of vectors to which the adjoint operator is applied.

  • mu – The parameter values for which to apply the adjoint operator.

Returns:

|VectorArray| of the adjoint operator evaluations.

assemble(mu=None)[source]

Assemble the operator for given parameter values.

The result of the method strongly depends on the given operator. For instance, a matrix-based operator will assemble its matrix, a LincombOperator will try to form the linear combination of its operators, whereas an arbitrary operator might simply return a FixedParameterOperator. The only assured property of the assembled operator is that it no longer depends on a Parameter.

If the operator has a Solver, the assembled Operator will be equipped with the same Solver.

Parameters:

mu – The parameter values for which to assemble the operator.

Returns:

Parameter-independent, assembled |Operator|.

class pymor.operators.block.BlockEmbeddingOperator(block_space, component, solver=None, name=None)[source]

Bases: BlockColumnOperator

A column vector of arbitrary Operators.

class pymor.operators.block.BlockOperator(blocks, range_spaces=None, source_spaces=None, solver=None, name=None)[source]

Bases: BlockOperatorBase

A matrix of arbitrary Operators.

This operator can be applied to a compatible BlockVectorArrays.

Parameters:

blocks – Two-dimensional array-like where each entry is an Operator or None.

blocked_range = True[source]
blocked_source = True[source]
class pymor.operators.block.BlockOperatorBase(blocks, range_spaces=None, source_spaces=None, solver=None, name=None)[source]

Bases: pymor.operators.interface.Operator

Base block Operator.

Methods

apply

Apply the operator to a VectorArray.

apply_adjoint

Apply the adjoint operator.

as_range_array

Return a VectorArray representation of the operator in its range space.

as_source_array

Return a VectorArray representation of the operator in its source space.

assemble

Assemble the operator for given parameter values.

d_mu

Return the operator's derivative with respect to a given parameter.

jacobian

Return the operator's Jacobian as a new Operator.

apply(U, mu=None)[source]

Apply the operator to a VectorArray.

Parameters:
Returns:

|VectorArray| of the operator evaluations.

apply_adjoint(V, mu=None)[source]

Apply the adjoint operator.

For any given linear Operator op, parameter values mu and VectorArrays U, V in the source resp. range we have:

op.apply_adjoint(V, mu).dot(U) == V.inner(op.apply(U, mu))

Thus, when op is represented by a matrix M, apply_adjoint is given by left-multiplication of (the complex conjugate of) M with V.

Parameters:
  • VVectorArray of vectors to which the adjoint operator is applied.

  • mu – The parameter values for which to apply the adjoint operator.

Returns:

|VectorArray| of the adjoint operator evaluations.

as_range_array(mu=None)[source]

Return a VectorArray representation of the operator in its range space.

In the case of a linear operator with NumpyVectorSpace as source, this method returns for given parameter values mu a VectorArray V in the operator’s range, such that

V.lincomb(U.to_numpy()) == self.apply(U, mu)

for all VectorArrays U.

Parameters:

mu – The parameter values for which to return the VectorArray representation.

Returns:

V – The VectorArray defined above.

as_source_array(mu=None)[source]

Return a VectorArray representation of the operator in its source space.

In the case of a linear operator with NumpyVectorSpace as range, this method returns for given parameter values mu a VectorArray V in the operator’s source, such that

self.range.make_array(V.inner(U)) == self.apply(U, mu)

for all VectorArrays U.

Parameters:

mu – The parameter values for which to return the VectorArray representation.

Returns:

V – The VectorArray defined above.

assemble(mu=None)[source]

Assemble the operator for given parameter values.

The result of the method strongly depends on the given operator. For instance, a matrix-based operator will assemble its matrix, a LincombOperator will try to form the linear combination of its operators, whereas an arbitrary operator might simply return a FixedParameterOperator. The only assured property of the assembled operator is that it no longer depends on a Parameter.

If the operator has a Solver, the assembled Operator will be equipped with the same Solver.

Parameters:

mu – The parameter values for which to assemble the operator.

Returns:

Parameter-independent, assembled |Operator|.

d_mu(parameter, index=0)[source]

Return the operator’s derivative with respect to a given parameter.

If the operator has a Solver, the derivative Operator will be equipped with the same Solver.

Parameters:
  • parameter – The parameter w.r.t. which to return the derivative.

  • index – Index of the parameter’s component w.r.t which to return the derivative.

Returns:

New |Operator| representing the partial derivative.

jacobian(U, mu)[source]

Return the operator’s Jacobian as a new Operator.

If the operator has a Solver, the Jacobian Operator will be equipped with the solver’s jacobian_solver.

Parameters:
  • U – Length 1 VectorArray containing the vector for which to compute the Jacobian.

  • mu – The parameter values for which to compute the Jacobian.

Returns:

Linear |Operator| representing the Jacobian.

class pymor.operators.block.BlockProjectionOperator(block_space, component, solver=None, name=None)[source]

Bases: BlockRowOperator

A row vector of arbitrary Operators.

class pymor.operators.block.BlockRowOperator(blocks, range_spaces=None, source_spaces=None, solver=None, name=None)[source]

Bases: BlockOperatorBase

A row vector of arbitrary Operators.

blocked_range = False[source]
blocked_source = True[source]
class pymor.operators.block.SecondOrderModelOperator(alpha, beta, A, B, solver=None, name=None)[source]

Bases: BlockOperator

BlockOperator appearing in SecondOrderModel.to_lti().

This represents a block operator

\[\begin{split}\mathcal{A} = \begin{bmatrix} \alpha I & \beta I \\ B & A \end{bmatrix},\end{split}\]

which satisfies

\[\begin{split}\mathcal{A}^H &= \begin{bmatrix} \overline{\alpha} I & B^H \\ \overline{\beta} I & A^H \end{bmatrix}, \\ \mathcal{A}^{-1} &= \begin{bmatrix} (\alpha A - \beta B)^{-1} A & -\beta (\alpha A - \beta B)^{-1} \\ -(\alpha A - \beta B)^{-1} B & \alpha (\alpha A - \beta B)^{-1} \end{bmatrix}, \\ \mathcal{A}^{-H} &= \begin{bmatrix} A^H (\alpha A - \beta B)^{-H} & -B^H (\alpha A - \beta B)^{-H} \\ -\overline{\beta} (\alpha A - \beta B)^{-H} & \overline{\alpha} (\alpha A - \beta B)^{-H} \end{bmatrix}.\end{split}\]
Parameters:

Methods

apply

Apply the operator to a VectorArray.

apply_adjoint

Apply the adjoint operator.

assemble

Assemble the operator for given parameter values.

apply(U, mu=None)[source]

Apply the operator to a VectorArray.

Parameters:
Returns:

|VectorArray| of the operator evaluations.

apply_adjoint(V, mu=None)[source]

Apply the adjoint operator.

For any given linear Operator op, parameter values mu and VectorArrays U, V in the source resp. range we have:

op.apply_adjoint(V, mu).dot(U) == V.inner(op.apply(U, mu))

Thus, when op is represented by a matrix M, apply_adjoint is given by left-multiplication of (the complex conjugate of) M with V.

Parameters:
  • VVectorArray of vectors to which the adjoint operator is applied.

  • mu – The parameter values for which to apply the adjoint operator.

Returns:

|VectorArray| of the adjoint operator evaluations.

assemble(mu=None)[source]

Assemble the operator for given parameter values.

The result of the method strongly depends on the given operator. For instance, a matrix-based operator will assemble its matrix, a LincombOperator will try to form the linear combination of its operators, whereas an arbitrary operator might simply return a FixedParameterOperator. The only assured property of the assembled operator is that it no longer depends on a Parameter.

If the operator has a Solver, the assembled Operator will be equipped with the same Solver.

Parameters:

mu – The parameter values for which to assemble the operator.

Returns:

Parameter-independent, assembled |Operator|.