# ccxGate

**Installation Required:** This functionality requires MATLAB Support Package for Quantum Computing.

## Description

applies a controlled controlled X gate to a target qubit based on the state of two control
qubits and returns a `g`

= ccxGate(`controlQubit1`

,`controlQubit2`

,`targetQubit`

)`quantum.gate.SimpleGate`

object. If one or both control qubits are in the $$|0\rangle $$ state, then this gate does nothing. If both control qubits are in the $$|1\rangle $$ state, then this gate applies the Pauli X gate (`xGate`

)
to the target qubit. This gate is also known as the CCNOT gate or Toffoli gate.

If

`controlQubit1`

,`controlQubit2`

, and`targetQubit`

are vectors of the same length,`ccxGate`

returns a column vector of gates, where`g(i)`

represents a controlled controlled X gate applied to the`i`

th element triplet of`controlQubit1`

,`controlQubit2`

, and`targetQubit`

.If any of

`controlQubit1`

,`controlQubit2`

, or`targetQubit`

is a scalar, and at least one of the inputs is a vector, then MATLAB^{®}expands the scalar to match the size of the vector input.The qubit indices in each element triplet of

`controlQubit1`

,`controlQubit2`

, and`targetQubit`

must not be the same.

## Examples

## Input Arguments

## More About

## Version History

**Introduced in R2023a**