def METHOD_NAME(self, cgate, num_controls, num_targets):
    """Test the MCMT V-chain implementation test on a simulation."""
    controls = QuantumRegister(num_controls)
    targets = QuantumRegister(num_targets)
    subsets = [tuple(range(i)) for i in range(num_controls + 1)]
    for subset in subsets:
        qc = QuantumCircuit(targets, controls)
        # Initialize all targets to 1, just to be sure that
        # the generic gate has some effect (f.e. Z gate has no effect
        # on a 0 state)
        qc.x(targets)
        num_ancillas = max(0, num_controls - 1)
        if num_ancillas > 0:
            ancillas = QuantumRegister(num_ancillas)
            qc.add_register(ancillas)
            qubits = controls[:] + targets[:] + ancillas[:]
        else:
            qubits = controls[:] + targets[:]
        for i in subset:
            qc.x(controls[i])
        mcmt = MCMTVChain(cgate, num_controls, num_targets)
        qc.compose(mcmt, qubits, inplace=True)
        for i in subset:
            qc.x(controls[i])
        vec = Statevector.from_label("0" * qc.num_qubits).evolve(qc)
        # target register is initially |11...1>, with length equal to 2**(n_targets)
        vec_exp = np.array([0] * (2 ** (num_targets) - 1) + [1])
        if isinstance(cgate, CZGate):
            # Z gate flips the last qubit only if it's applied an odd number of times
            if len(subset) == num_controls and (num_controls % 2) == 1:
                vec_exp[-1] = -1
        elif isinstance(cgate, CHGate):
            # if all the control qubits have been activated,
            # we repeatedly apply the kronecker product of the Hadamard
            # with itself and then multiply the results for the original
            # state of the target qubits
            if len(subset) == num_controls:
                h_i = 1 / np.sqrt(2) * np.array([[1, 1], [1, -1]])
                h_tot = np.array([1])
                for _ in range(num_targets):
                    h_tot = np.kron(h_tot, h_i)
                vec_exp = np.dot(h_tot, vec_exp)
        else:
            raise ValueError(f"Test not implement for gate: {cgate}")
        # append the remaining part of the state
        vec_exp = np.concatenate(
            (vec_exp, [0] * (2 ** (num_controls + num_ancillas + num_targets) - vec_exp.size))
        )
        f_i = state_fidelity(vec, vec_exp)
        self.assertAlmostEqual(f_i, 1)