Skip to content

odak.learn.wave.calculate_amplitude

Definition to calculate amplitude of a single or multiple given electric field(s).

Parameters:

Name Type Description Default
field torch.cfloat

Electric fields or an electric field.

required

Returns:

Type Description
torch.float

Amplitude or amplitudes of electric field(s).

Source code in odak/learn/wave/util.py
def calculate_amplitude(field):
    """ 
    Definition to calculate amplitude of a single or multiple given electric field(s).

    Parameters
    ----------
    field        : torch.cfloat
                   Electric fields or an electric field.

    Returns
    -------
    amplitude    : torch.float
                   Amplitude or amplitudes of electric field(s).
    """
    amplitude = torch.abs(field)
    return amplitude

Notes

Regarding usage of this definition, you can find use cases in the engineering notes, specifically at Optimizing holograms using Odak.

See also