MCMTVChain
class qiskit.circuit.library.MCMTVChain(gate, num_ctrl_qubits, num_target_qubits)
Bases: 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
.
Expanded Circuit:

Examples:
>>> 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 ├─────
└───┘ └───┘
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 | Callable[[QuantumCircuit, circuit.Qubit, circuit.Qubit], circuit.Instruction]) –
- num_ctrl_qubits (int) –
- num_target_qubits (int) –
num_ancilla_qubits
Return the number of ancilla qubits required.
name
Type: str
A human-readable name for the circuit.
Example
from qiskit import QuantumCircuit
qc = QuantumCircuit(2, 2, name="my_circuit")
print(qc.name)
my_circuit