def METHOD_NAME(qubits, clauses):
    """Hamiltonian that satisfies all Exact Cover clauses.
    Args:
        qubits (int): # of total qubits in the instance.
        clauses (list): clauses for an Exact Cover instance.
    Returns:
        sham (sympy.Expr): Symbolic form of the problem Hamiltonian.
        smap (dict): Dictionary that maps the symbols that appear in the
            Hamiltonian to the corresponding matrices and target qubits.
    """
    z_matrix = (matrices.I - matrices.Z) / 2.0
    z = [symbols.Symbol(i, z_matrix) for i in range(qubits)]
    return sum((sum(z[i - 1] for i in clause) - 1) ** 2 for clause in clauses)