mcxGate
Installation Required: This functionality requires MATLAB Support Package for Quantum Computing.
Description
applies a multi-controlled X (MCX) gate. This gate operates on a single target qubit based
on the states of the control qubits, with a number of ancilla qubits that do not affect the
operation. If all control qubits are in the state, then this gate applies a Pauli X gate (cg = mcxGate(controlQubits,targetQubit,ancillaQubits)xGate or
the equivalent classical NOT gate) to the target qubit. Otherwise, the gate has no effect on
the target qubit.
The qubit indices in controlQubits, targetQubit,
and ancillaQubits must not be the same.
Examples
Input Arguments
Output Arguments
References
[1] Barenco, Adriano, et al. “Elementary Gates for Quantum Computation.” Physical Review A 52, no. 5 (November 1, 1995): 3457–67. https://doi.org/10.1103/PhysRevA.52.3457.
Version History
Introduced in R2023a


