Skip to main contentIBM Quantum Documentation Mirror

MCMTVChain

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

GitHub

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:

Diagram illustrating the previously described 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 ├─────

└───┘ └───┘

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

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

Methods

inverse

inverse(annotated=False)

GitHub

Return the inverse MCMT circuit, which is itself.

Parameters

annotated (bool) –