import math


def get_complex_components(amps, phases):
    """Get the real and imaginary components of amplitudes and phases.

    Args:
        amps (:obj:`list` of :obj:`float`): List of constituent amplitudes
        phases (:obj:`list` of :obj:`float`): List of constituent phases in radians

    Returns:
        :obj:`list` of :obj:`tuple` of :obj:`float`: The list of the complex components,
            e.g. [[real1, imag1], [real2, imag2]]

    """
    components = [[0.0, 0.0] for _ in range(len(amps))]
    for idx, (amp, phase) in enumerate(zip(amps, phases)):
        components[idx][0] = amp * math.cos(phase)
        components[idx][1] = amp * math.sin(phase)
    return components