def METHOD_NAME(self):
    """Transform a problem to QWave format."""
    lines = []
    onsite_fields, interactions = self.get_qaoa()
    lines.append('c  This is a sample .qubo file\n')
    lines2 = []
    nodes = 0
    lines2.append('c ------------------\n')
    for i, c in enumerate(onsite_fields):
        if abs(c) > 0:
            lines2.append('%s  %s   %s\n' % (i, i, c))
            nodes += 1
    lines2.append('c ------------------\n')
    n_couplers = 0
    for i, row in enumerate(interactions):
        for j, c in enumerate(row):
            if abs(c) > 0.:
                lines2.append('%s  %s   %s\n' % (i, j, c))
                n_couplers += 1
    lines.append('p   qubo  0   %s   %s   %s\n' % (
        len(self.var_names),
        nodes,
        n_couplers))
    return lines + lines2