def METHOD_NAME(final_measure=True):
    """Diagonal gate test circuits with deterministic count output."""
    circuits = []
    qr = QuantumRegister(2, "qr")
    if final_measure:
        cr = ClassicalRegister(2, "cr")
        regs = (qr, cr)
    else:
        regs = (qr,)
    # 4 x Swap |00> <--> |01> states
    # 4 x Swap |00> <--> |10> states
    arg = [1, -1]
    for qubit in [0, 1]:
        for diag in [arg, np.array(arg), np.array(arg, dtype=float), np.array(arg, dtype=complex)]:
            circuit = QuantumCircuit(*regs)
            circuit.h(qubit)
            circuit.diagonal(list(diag), [qubit])
            circuit.h(qubit)
            if final_measure:
                circuit.barrier(qr)
                circuit.measure(qr, cr)
            circuits.append(circuit)
    # 4 x Swap |00> <--> |11> states
    arg = [1, -1, -1, 1]
    for diag in [arg, np.array(arg), np.array(arg, dtype=float), np.array(arg, dtype=complex)]:
        circuit = QuantumCircuit(*regs)
        circuit.h(qr)
        circuit.diagonal(list(diag), qr)
        circuit.h(qr)
        if final_measure:
            circuit.barrier(qr)
            circuit.measure(qr, cr)
        circuits.append(circuit)
    # CS01.XX, exp(-1j * np.pi/k)|11> state
    for diag in [np.array([1, 1, 1, np.exp(-1j * np.pi / k)]) for k in [10, 100, 1000, 10000]]:
        circuit = QuantumCircuit(*regs)
        circuit.x(qr)
        circuit.diagonal(list(diag), qr)
        if final_measure:
            circuit.barrier(qr)
            circuit.measure(qr, cr)
        circuits.append(circuit)
    return circuits