---
title: MCMTVChain (latest version)
description: API reference for qiskit.circuit.library.MCMTVChain in the latest version of qiskit
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.circuit.library.MCMTVChain
---

# MCMTVChain

*class* `qiskit.circuit.library.MCMTVChain(gate, num_ctrl_qubits, num_target_qubits)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/circuit/library/generalized_gates/mcmt.py#L123-L185)

Bases: [`MCMT`](/docs/api/qiskit/qiskit.circuit.library.MCMT "qiskit.circuit.library.generalized_gates.mcmt.MCMT")

The MCMT implementation using the CCX V-chain.

This implementation requires ancillas but is decomposed into a much shallower circuit than the default implementation in [`MCMT`](/docs/api/qiskit/qiskit.circuit.library.MCMT "qiskit.circuit.library.MCMT").

Expanded circuit:

![Diagram illustrating the previously described circuit.](https://eu-de.quantum.cloud.ibm.com/docs/images/api/qiskit/qiskit-circuit-library-MCMTVChain-1.avif)

**Examples**

```python
>>> from qiskit.circuit.library import HGate
>>> MCMTVChain(HGate(), 3, 2).draw()
```

**q\_0: ──■────────────────────────■──**

│ │

**q\_1: ──■────────────────────────■──**

│ │

**q\_2: ──┼────■──────────────■────┼──**

│ │ ┌───┐ │ │

**q\_3: ──┼────┼──┤ H ├───────┼────┼──**

│ │ └─┬─┘┌───┐ │ │

**q\_4: ──┼────┼────┼──┤ H ├──┼────┼──**

┌─┴─┐ │ │ └─┬─┘ │ ┌─┴─┐

**q\_5: ┤ X ├──■────┼────┼────■──┤ X ├**

└───┘┌─┴─┐ │ │ ┌─┴─┐└───┘

**q\_6: ─────┤ X ├──■────■──┤ X ├─────**

└───┘ └───┘

> **Deprecated since version 1.4**
>
> The class `qiskit.circuit.library.generalized_gates.mcmt.MCMTVChain` is deprecated as of Qiskit 1.4. It will be removed no earlier than 3 months after the release date. Use MCMTGate with the V-chain synthesis plugin instead.

## Attributes

**Parameters**

- **gate** ([*Gate*](/docs/api/qiskit/qiskit.circuit.Gate "qiskit.circuit.Gate") *| Callable\[\[*[*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")*,* [*circuit.Qubit*](/docs/api/qiskit/circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit")*,* [*circuit.Qubit*](/docs/api/qiskit/circuit#qiskit.circuit.Qubit "qiskit.circuit.Qubit")*],* [*circuit.Instruction*](/docs/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction")*]*)
- **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int))
- **num\_target\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int))

### num\_ancilla\_qubits

Return the number of ancilla qubits required.

### name

Type: [`str`](https://docs.python.org/3/library/stdtypes.html#str)

A human-readable name for the circuit.

**Example**

```python
from qiskit import QuantumCircuit

qc = QuantumCircuit(2, 2, name="my_circuit")
print(qc.name)
```

```text
my_circuit
```

## Methods

### inverse

`inverse(annotated=False)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/circuit/library/generalized_gates/mcmt.py#L184-L185)

Return the inverse MCMT circuit, which is itself.

**Parameters**

**annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool))
