def METHOD_NAME(n_qubits, params) -> Circuit:
    """
    Build an IQP ansatz on n qubits, if n = 1 returns an Euler decomposition.
    >>> pprint = lambda c: print(str(c.foliation()).replace(' >>', '\\n  >>'))
    >>> pprint(IQPansatz(3, [[0.1, 0.2], [0.3, 0.4]]))
    H @ H @ H
      >> CRz(0.1) @ qubit
      >> H @ CRz(0.2)
      >> qubit @ H @ H
      >> CRz(0.3) @ qubit
      >> qubit @ CRz(0.4)
    >>> print(IQPansatz(1, [0.3, 0.8, 0.4]))
    Rx(0.3) >> Rz(0.8) >> Rx(0.4)
    """
    from discopy.quantum.gates import H, Rx, Rz, CRz
    np = get_backend()
    def layer(thetas):
        hadamards = Id().tensor(*(n_qubits * [H]))
        rotations = Id(qubit ** n_qubits).then(*(
            qubit ** i @ CRz(thetas[i]) @ qubit ** (n_qubits - 2 - i)
            for i in range(n_qubits - 1)))
        return hadamards >> rotations
    if n_qubits == 1:
        circuit = Rx(params[0]) >> Rz(params[1]) >> Rx(params[2])
    elif len(np.shape(params)) != 2\
            or np.shape(params)[1] != n_qubits - 1:
        raise ValueError(
            f"Expected params of shape (depth, {n_qubits - 1})")
    else:
        depth = np.shape(params)[0]
        circuit = Id(qubit ** n_qubits).then(*(
            layer(params[i]) for i in range(depth)))
    return circuit