mr2.operators.models.BMC.GradientBlock

class mr2.operators.models.BMC.GradientBlock[source]

Bases: BMCBlock

Gradient-only block with position-dependent phase accrual.

__init__(duration: Tensor | float, positions: SpatialDimension[Tensor], gradient_x: Tensor | float = 0.0, gradient_y: Tensor | float = 0.0, gradient_z: Tensor | float = 0.0) None[source]

Initialize the block.

Parameters:
  • duration (Tensor | float) – Duration in seconds.

  • gradient_x (Tensor | float, default: 0.0) – Gradient amplitude in T/m along x.

  • gradient_y (Tensor | float, default: 0.0) – Gradient amplitude in T/m along y.

  • gradient_z (Tensor | float, default: 0.0) – Gradient amplitude in T/m along z.

  • positions (SpatialDimension[Tensor]) – Isochromat positions in meters for (z, y, x).

property duration: Tensor[source]

Duration of the block.

__call__(parameters: Parameters, state: Tensor | None = None, *, zero_matrix: Tensor | None = None, zero_c: Tensor | None = None) tuple[Tensor, tuple[Tensor, ...]][source]

Apply the block.

forward(parameters: Parameters, state: Tensor) tuple[Tensor, tuple[Tensor, ...]][source]

Apply the block.