sft_wick.fields — Fields and Field Operators

Field declarations and field operators.

A Field is a declaration (phi, psi) with metadata. A FieldOperator is a specific instance with bound component index and spatial argument.

class sft_wick.fields.FieldType(*values)[source]

Bases: Enum

PHYSICAL = 'physical'
RESPONSE = 'response'
sft_wick.fields.reset_uid_counter()[source]

Reset the UID counter. Useful for reproducible tests.

Return type:

None

class sft_wick.fields.Field(name, field_type, n_components=1)[source]

Bases: object

Declaration of a field species.

Examples

phi = Field(‘phi’, FieldType.PHYSICAL, n_components=3) psi = Field(‘psi’, FieldType.RESPONSE) # scalar (n_components=1)

Parameters:
name: str
field_type: FieldType
n_components: int = 1
property is_scalar: bool
property is_physical: bool
property is_response: bool
class sft_wick.fields.FieldOperator(field, component_index, spatial_arg, uid)[source]

Bases: object

A field at a specific point with a specific component index.

Each instance has a unique uid to distinguish identical-looking operators (e.g., two phi_a(x) in the same product).

Parameters:
  • field (Field)

  • component_index (str | None)

  • spatial_arg (str)

  • uid (int)

field: Field
component_index: str | None
spatial_arg: str
uid: int
property field_type: FieldType
property is_physical: bool
property is_response: bool