def __init__(self, R, ct, names=None, prefix=None, bracket=None):
        """
        Initialize self.

        TESTS::

            sage: V = lie_conformal_algebras.Affine(QQ,'A1')
            sage: TestSuite(V).run()
        """
        if type(ct) is str:
            from sage.combinat.root_system.cartan_type import CartanType
            try:
                ct = CartanType(ct)
            except IndexError:
                raise ValueError("ct must be a valid Cartan Type")
        if not (ct.is_finite() and ct.is_irreducible):
            raise ValueError(
                "only affine algebras of simple finite dimensional"
                "Lie algebras are implemented")
        hv = Integer(ct.dual_coxeter_number())
        g = LieAlgebra(R, cartan_type=ct)
        B = g.basis()
        S = B.keys()
        gdict = {}
        for k1 in S:
            for k2 in S:
                if S.rank(k2) <= S.rank(k1):
                    myb = B[k1].bracket(B[k2]).monomial_coefficients()
                    myf = R(2).inverse_of_unit()*R(hv).inverse_of_unit()\
                          *g.killing_form(B[k1],B[k2])
                    if myb or myf:
                        gdict[(k1, k2)] = {}
                        if myb:
                            gdict[(k1,k2)][0] = {(nk,0):v for nk,v in \
                                                                    myb.items()}
                        if myf:
                            gdict[(k1, k2)][1] = {('K', 0): myf}

        weights = (1, ) * B.cardinality()
        self._ct = ct
        if prefix is None and names is None:
            prefix = 'B'

        GradedLieConformalAlgebra.__init__(self,
                                           R,
                                           gdict,
                                           index_set=S,
                                           central_elements=('K', ),
                                           weights=weights,
                                           names=names,
                                           prefix=prefix,
                                           bracket=bracket)