def METHOD_NAME():
    # fmt: off
    np.testing.assert_allclose(
        cirq.unitary(cirq.qft(*cirq.LineQubit.range(2))),
        np.array(
            [
                [1, 1, 1, 1],
                [1, 1j, -1, -1j],
                [1, -1, 1, -1],
                [1, -1j, -1, 1j],
            ]
        )
        / 2,
        atol=1e-8,
    )
    np.testing.assert_allclose(
        cirq.unitary(cirq.qft(*cirq.LineQubit.range(2), without_reverse=True)),
        np.array(
            [
                [1, 1, 1, 1],
                [1, -1, 1, -1],
                [1, 1j, -1, -1j],
                [1, -1j, -1, 1j],
            ]
        )
        / 2,
        atol=1e-8,
    )
    # fmt: on
    np.testing.assert_allclose(
        cirq.unitary(cirq.qft(*cirq.LineQubit.range(4))),
        np.array([[np.exp(2j * np.pi * i * j / 16) for i in range(16)] for j in range(16)]) / 4,
        atol=1e-8,
    )
    np.testing.assert_allclose(
        cirq.unitary(cirq.qft(*cirq.LineQubit.range(2)) ** -1),
        np.array([[1, 1, 1, 1], [1, -1j, -1, 1j], [1, -1, 1, -1], [1, 1j, -1, -1j]]) / 2,
        atol=1e-8,
    )
    for k in range(4):
        for b in [False, True]:
            cirq.testing.assert_implements_consistent_protocols(
                cirq.QuantumFourierTransformGate(num_qubits=k, without_reverse=b)
            )