def IdealTransformer(a=1.0):
    """Ideal Transformer

    Ports 1 and 2 are the primary.

    Ports 3 and 4 are the secondary.

    The dot is on ports 1 and 3.

    a is the turns ratio specified as (secondary/primary) windings

    @param a float (optional) turns ratio (defaults to 1)
    @return the s-parameter matrix of an ideal transformer
    """
    a = float(a)
    D = a * a + 1.0
    return [[1.0 / D, a * a / D, a / D, -a / D], [a * a / D, 1.0 / D, -a /
        D, a / D], [a / D, -a / D, a * a / D, 1.0 / D], [-a / D, a / D, 1.0 /
        D, a * a / D]]
