Skip to content

odak.wave.generate_complex_field

Definition to generate a complex field with a given amplitude and phase.

Parameters:

Name Type Description Default
amplitude ndarray

Amplitude of the field.

required
phase ndarray

Phase of the field.

required

Returns:

Type Description
ndarray

Complex field.

Source code in odak/wave/__init__.py
def generate_complex_field(amplitude, phase):
    """
    Definition to generate a complex field with a given amplitude and phase.

    Parameters
    ----------
    amplitude         : ndarray
                        Amplitude of the field.
    phase             : ndarray
                        Phase of the field.

    Returns
    -------
    field             : ndarray
                        Complex field.
    """
    field = amplitude*np.cos(phase)+1j*amplitude*np.sin(phase)
    return field

See also