def METHOD_NAME(self, td, refa, refb, places=6):
    mf = td._scf
    a, b = td.get_ab()
    self.assertAlmostEqual(lib.fp(abs(a)), refa, places)
    self.assertAlmostEqual(lib.fp(abs(b)), refb, places)
    ftda = mf.TDA().gen_vind()[0]
    ftdhf = td.gen_vind()[0]
    nocc = numpy.count_nonzero(mf.mo_occ == 1)
    nvir = numpy.count_nonzero(mf.mo_occ == 0)
    numpy.random.seed(2)
    x, y = xy = numpy.random.random((2,nocc,nvir))
    ax = numpy.einsum('iajb,jb->ia', a, x)
    self.assertAlmostEqual(abs(ax - ftda([x]).reshape(nocc,nvir)).max(), 0, 12)
    ab1 = ax + numpy.einsum('iajb,jb->ia', b, y)
    ab2 =-numpy.einsum('iajb,jb->ia', b.conj(), x)
    ab2-= numpy.einsum('iajb,jb->ia', a.conj(), y)
    abxy_ref = ftdhf([xy]).reshape(2,nocc,nvir)
    self.assertAlmostEqual(abs(ab1 - abxy_ref[0]).max(), 0, 12)
    self.assertAlmostEqual(abs(ab2 - abxy_ref[1]).max(), 0, 12)