def METHOD_NAME(nqubits, global_nqubits, depth=9, verbose=False, random_gen=""):
    use_fusedswap = True if global_nqubits > 0 else False
    local_nqubits = nqubits - global_nqubits
    if random_gen == "":
        rng = np.random.default_rng()
    else:
        rng = random_gen
    circuit = QuantumCircuit(nqubits)
    pairs = [(i, (i + 1) % nqubits) for i in range(nqubits)]
    global_qc = global_nqubits
    local_qc = nqubits - global_qc
    seed = rng.integers(10000)
    np.random.seed(seed)
    global _print_debug
    global swapped
    _print_debug = verbose
    swapped = False
    # add gates
    first_rotation(circuit, nqubits, global_qc)
    entangler(circuit, nqubits, pairs, global_qc)
    for k in range(depth):
        mid_rotation(circuit, nqubits, global_qc)
        entangler(circuit, nqubits, pairs, global_qc)
    last_rotation(circuit, nqubits, global_qc)
    # recover if needed
    if use_fusedswap and swapped:
        if _print_debug and mpirank == 0:
            print(
                "FusedSWAP {} {} {}".format(local_qc - global_qc, local_qc, global_qc)
            )
        circuit.add_FusedSWAP_gate(local_qc - global_qc, local_qc, global_qc)
        swapped = not swapped
    assert swapped is False
    return circuit